【Oracle】RAC 10.2.0.1升级10.2.0.5

时间:2021-07-10 19:37:02

环境:

OS:OEL5.6

RAC:10.2.0.1.0

相关环境变量:

CRS_HOME /u01/app/oracle/product/10.2.0/db_1

ORACLE_HOME   /u01/app/oracle/product/10.2.0/db_2

crs_stop -all关闭全部资源

[oracle@rac1 ~]$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora....B1.inst application    OFFLINE   OFFLINE

ora....B2.inst application    OFFLINE   OFFLINE

ora.RACDB.db   application    OFFLINE   OFFLINE

ora....SM1.asm application    OFFLINE   OFFLINE

ora....C1.lsnr application    OFFLINE   OFFLINE

ora.rac1.gsd   application    OFFLINE   OFFLINE

ora.rac1.ons   application    OFFLINE   OFFLINE

ora.rac1.vip   application    OFFLINE   OFFLINE

ora....SM2.asm application    OFFLINE   OFFLINE

ora....C2.lsnr application    OFFLINE   OFFLINE

ora.rac2.gsd   application    OFFLINE   OFFLINE

ora.rac2.ons   application    OFFLINE   OFFLINE

ora.rac2.vip   application    OFFLINE   OFFLINE

1.解压升级所需补丁包:p8202632_10205_LINUX.zip

[oracle@rac1 soft]$ unzip p8202632_10205_LINUX.zip

2.開始升级集群软件

[oracle@rac1 Disk1]$ ./runInstaller

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

然后依照要求跑脚本:

rac1节点

[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/

[root@rac1 bin]# ./crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@rac1 bin]# /u01/app/oracle/product/10.2.0/db_1/install/root102.sh

Creating pre-patch directory for saving pre-patch clusterware files

Completed patching clusterware files to /u01/app/oracle/product/10.2.0/db_1

Relinking some shared libraries.

Relinking of patched files is complete.

WARNING: directory '/u01/app/oracle/product/10.2.0' is not owned by root

WARNING: directory '/u01/app/oracle/product' is not owned by root

WARNING: directory '/u01/app/oracle' is not owned by root

WARNING: directory '/u01/app' is not owned by root

WARNING: directory '/u01' is not owned by root

Preparing to recopy patched init and RC scripts.

Recopying init and RC scripts.

Startup will be queued to init within 30 seconds.

Starting up the CRS daemons.

Waiting for the patched CRS daemons to start.

This may take a while on some systems.

.

10205 patch successfully applied.

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully deleted 1 values from OCR.

Successfully deleted 1 keys from OCR.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 1: rac1 rac1-priv rac1

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

clscfg -upgrade completed successfully

Creating '/u01/app/oracle/product/10.2.0/db_1/install/paramfile.crs' with data used for CRS configuration

Setting CRS configuration values in /u01/app/oracle/product/10.2.0/db_1/install/paramfile.crs

rac2节点:

[root@rac2 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/

[root@rac2 bin]# ./crsctl stop crs

Stopping resources.

Successfully stopped CRS resources

Stopping CSSD.

Shutting down CSS daemon.

Shutdown request successfully issued.

[root@rac2 bin]#  /u01/app/oracle/product/10.2.0/db_1/install/root102.sh

Creating pre-patch directory for saving pre-patch clusterware files

Completed patching clusterware files to /u01/app/oracle/product/10.2.0/db_1

Relinking some shared libraries.

Relinking of patched files is complete.

WARNING: directory '/u01/app/oracle/product/10.2.0' is not owned by root

WARNING: directory '/u01/app/oracle/product' is not owned by root

WARNING: directory '/u01/app/oracle' is not owned by root

WARNING: directory '/u01/app' is not owned by root

WARNING: directory '/u01' is not owned by root

Preparing to recopy patched init and RC scripts.

Recopying init and RC scripts.

Startup will be queued to init within 30 seconds.

Starting up the CRS daemons.

Waiting for the patched CRS daemons to start.

This may take a while on some systems.

.

10205 patch successfully applied.

clscfg: EXISTING configuration version 3 detected.

clscfg: version 3 is 10G Release 2.

Successfully deleted 1 values from OCR.

Successfully deleted 1 keys from OCR.

Successfully accumulated necessary OCR keys.

Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.

node <nodenumber>: <nodename> <private interconnect name> <hostname>

node 2: rac2 rac2-priv rac2

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

clscfg -upgrade completed successfully

Creating '/u01/app/oracle/product/10.2.0/db_1/install/paramfile.crs' with data used for CRS configuration

Setting CRS configuration values in /u01/app/oracle/product/10.2.0/db_1/install/paramfile.crs

到眼下,Clusterware软件升级完成

[oracle@rac1 Disk1]$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora....B1.inst application    ONLINE    ONLINE    rac1

ora....B2.inst application    ONLINE    ONLINE    rac2

ora.RACDB.db   application    ONLINE    ONLINE    rac1

ora....SM1.asm application    ONLINE    ONLINE    rac1

ora....C1.lsnr application    ONLINE    ONLINE    rac1

ora.rac1.gsd   application    ONLINE    ONLINE    rac1

ora.rac1.ons   application    ONLINE    ONLINE    rac1

ora.rac1.vip   application    ONLINE    ONLINE    rac1

ora....SM2.asm application    ONLINE    ONLINE    rac2

ora....C2.lsnr application    ONLINE    ONLINE    rac2

ora.rac2.gsd   application    ONLINE    ONLINE    rac2

ora.rac2.ons   application    ONLINE    ONLINE    rac2

ora.rac2.vip   application    ONLINE    ONLINE    rac2

如今開始升级数据库软件:

升级数据库软件前我们要关闭CRS的各种服务

[oracle@rac1 Disk1]$ srvctl stop db -d RACDB -o immediate

[oracle@rac1 Disk1]$ srvctl stop asm -n rac1 -o immediate

[oracle@rac1 Disk1]$ srvctl stop asm -n rac2 -o immediate

[oracle@rac1 Disk1]$ srvctl stop listener -n rac1

[oracle@rac1 Disk1]$ srvctl stop listener -n rac2

[oracle@rac1 Disk1]$ crs_stop -all

[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/

[root@rac1 bin]# ./crsctl stop crs

rac2节点:

[root@rac2 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/

[root@rac2 bin]# ./crsctl stop crs

执行补丁包(和升级集群软件使用的同一个补丁包)

[oracle@rac1 Disk1]$ ./runInstaller

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

这次我们选择ORACLE_HOME文件夹

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

rac1节点:

[root@rac1 ~]# /u01/app/oracle/product/10.2.0/db_2/root.sh

Running Oracle 10g root.sh script...

The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_2

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin.  Overwrite it?

(y/n)

[n]:

The file "oraenv" already exists in /usr/local/bin.  Overwrite it?

(y/n)

[n]:

The file "coraenv" already exists in /usr/local/bin.  Overwrite it?

(y/n)

[n]:

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.

rac2节点:

[root@rac2 ~]# /u01/app/oracle/product/10.2.0/db_2/root.sh

Running Oracle 10g root.sh script...

The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME=  /u01/app/oracle/product/10.2.0/db_2

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The file "dbhome" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]:

The file "oraenv" already exists in /usr/local/bin.  Overwrite it?

(y/n)

[n]:

The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)

[n]:

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root.sh script.

Now product-specific root actions will be performed.

数据库软件升级完成后開始升级数据库:

版本号升级后,在新的版本号下,字典表中某些对象的属性也须要随之改变。所以,须要继续升级一下数据库,更新数据库字典。

rac1节点:

[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/

[root@rac1 bin]# ./crsctl start crs

Attempting to start CRS stack

The CRS stack will be started shortly

rac2节点:

[root@rac1 ~]# cd /u01/app/oracle/product/10.2.0/db_1/bin/

[root@rac1 bin]# ./crsctl start crs

Attempting to start CRS stack

The CRS stack will be started shortly

[oracle@rac1 ~]$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora....B1.inst application    ONLINE    OFFLINE

ora....B2.inst application    ONLINE    OFFLINE

ora.RACDB.db   application    ONLINE    OFFLINE

ora....SM1.asm application    ONLINE    ONLINE    rac1

ora....C1.lsnr application    ONLINE    ONLINE    rac1

ora.rac1.gsd   application    ONLINE    ONLINE    rac1

ora.rac1.ons   application    ONLINE    ONLINE    rac1

ora.rac1.vip   application    ONLINE    ONLINE    rac1

ora....SM2.asm application    ONLINE    ONLINE    rac2

ora....C2.lsnr application    ONLINE    ONLINE    rac2

ora.rac2.gsd   application    ONLINE    ONLINE    rac2

ora.rac2.ons   application    ONLINE    ONLINE    rac2

ora.rac2.vip   application    ONLINE    ONLINE    rac2

[oracle@rac1 ~]$ dbua

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

【Oracle】RAC 10.2.0.1升级10.2.0.5

【Oracle】RAC 10.2.0.1升级10.2.0.5

【Oracle】RAC 10.2.0.1升级10.2.0.5

【Oracle】RAC 10.2.0.1升级10.2.0.5

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvYmFkbHk5/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="">

至此升级完成:

[oracle@rac1 ~]$ crs_stat -t

Name           Type           Target    State     Host

------------------------------------------------------------

ora....B1.inst application    ONLINE    ONLINE    rac1

ora....B2.inst application    ONLINE    ONLINE    rac2

ora.RACDB.db   application    ONLINE    ONLINE    rac2

ora....SM1.asm application    ONLINE    ONLINE    rac1

ora....C1.lsnr application    ONLINE    ONLINE    rac1

ora.rac1.gsd   application    ONLINE    ONLINE    rac1

ora.rac1.ons   application    ONLINE    ONLINE    rac1

ora.rac1.vip   application    ONLINE    ONLINE    rac1

ora....SM2.asm application    ONLINE    ONLINE    rac2

ora....C2.lsnr application    ONLINE    ONLINE    rac2

ora.rac2.gsd   application    ONLINE    ONLINE    rac2

ora.rac2.ons   application    ONLINE    ONLINE    rac2

ora.rac2.vip   application    ONLINE    ONLINE    rac2

SQL> select comp_name,version,status from dba_registry;

COMP_NAME                                VERSION                        STATUS

---------------------------------------- ------------------------------ -----------

Oracle Enterprise Manager                10.2.0.5.0                     VALID

Spatial                                  10.2.0.5.0                     VALID

Oracle interMedia                        10.2.0.5.0                     VALID

OLAP Catalog                             10.2.0.5.0                     VALID

Oracle XML Database                      10.2.0.5.0                     VALID

Oracle Text                              10.2.0.5.0                     VALID

Oracle Expression Filter                 10.2.0.5.0                     VALID

Oracle Rule Manager                      10.2.0.5.0                     VALID

Oracle Workspace Manager                 10.2.0.5.0                     VALID

Oracle Data Mining                       10.2.0.5.0                     VALID

Oracle Database Catalog Views            10.2.0.5.0                     VALID

Oracle Database Packages and Types       10.2.0.5.0                     VALID

JServer JAVA Virtual Machine             10.2.0.5.0                     VALID

Oracle XDK                               10.2.0.5.0                     VALID

Oracle Database Java Packages            10.2.0.5.0                     VALID

OLAP Analytic Workspace                  10.2.0.5.0                     VALID

Oracle OLAP API                          10.2.0.5.0                     VALID

Oracle Real Application Clusters         10.2.0.5.0                     VALID

18 rows selected.

SQL> select * from v$version;

BANNER

----------------------------------------------------------------

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod

PL/SQL Release 10.2.0.5.0 - Production

CORE    10.2.0.5.0      Production

TNS for Linux: Version 10.2.0.5.0 - Production

NLSRTL Version 10.2.0.5.0 - Production