10g RAC下安裝10.2.0.4補丁

anycall2010發表於2008-08-02

1.檢查目前補丁的狀態:

SQL> select version from v$timezone_file;

   VERSION
----------
         2
2.檢查oracle_home和oracle_sid的環境變數:

rac1-> more .bash_profile
export PATH
unset USERNAME

export PS1="`/bin/hostname -s`-> "
export EDITOR=vi
export ORACLE_SID=orcl1
export ORACLE_BASE=/u01/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs_1
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$PATH
umask 022

已經設定,可以考慮不必設定。

3.停止所有的服務

$ emctl stop dbconsole
$ isqlplusctl stop
$ lsnrctl stop

1.首先升級CRS

1.每節點都需要在root使用者下執行:

 #u01/oracle/product/10.2.0/crs_1/bin/crsctl stop crs

Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.

備註:如果上面步驟沒做,執行下面命令會出現如下報錯

[root@rac2 oracle]# /u01/oracle/product/10.2.0/crs_1/install/root102.sh
Please shut down the following processes before running this script.
20629 ?        00:00:59 ocssd.bin
14155 ?        00:01:18 crsd.bin
20426 ?        00:00:23 evmd.bin


查詢每個節點狀態:

rac1-> crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

rac2-> CRS-0184: Cannot communicate with the CRS daemon.
bash: CRS-0184:: command not found

2.每個節點都需要在root使用者下執行:

[root@rac1 oracle]# /u01/oracle/product/10.2.0/crs_1/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /u01/oracle/product/10.2.0/crs_1
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/u01/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/oracle/product' is not owned by root
WARNING: directory '/u01/oracle' 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.
.
.
.
10204 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 1: rac1 rac1-priv rac1
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully

備註:安裝文件的說明,在一個節點執行完畢之後,才能執行另外一個節點。

[root@rac2 oracle]#  /u01/oracle/product/10.2.0/crs_1/install/root102.sh
Creating pre-patch directory for saving pre-patch clusterware files
Completed patching clusterware files to /u01/oracle/product/10.2.0/crs_1
Relinking some shared libraries.
Relinking of patched files is complete.
WARNING: directory '/u01/oracle/product/10.2.0' is not owned by root
WARNING: directory '/u01/oracle/product' is not owned by root
WARNING: directory '/u01/oracle' 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.
.
.
.
10204 patch successfully applied.
clscfg: EXISTING configuration version 3 detected.
clscfg: version 3 is 10G Release 2.
Successfully accumulated necessary OCR keys.
Using ports: CSS=49895 CRS=49896 EVMC=49898 and EVMR=49897.
node :
node 2: rac2 rac2-priv rac2
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
clscfg -upgrade completed successfully

然後開始升級DB 。升級DB前要使用“/u01/oracle/product/10.2.0/crs_1/bin/crsctl stop crs”關閉CRS程式,否則升級DB出錯。

注意對兩個節點分別都需要執行./runinstaller,升級CRS.

最後要在每個節點執行root.sh指令碼。


[root@rac1 ~]#  /u01/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/oracle/product/10.2.0/db_1

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]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

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.


[root@rac2 ~]#  /u01/oracle/product/10.2.0/db_1/root.sh
Running Oracle10 root.sh script...

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/oracle/product/10.2.0/db_1

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]: y
   Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin.  Overwrite it? (y/n)
[n]: y
   Copying coraenv to /usr/local/bin ...

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.

最後一步:升級監聽程式:

使用dbua對監聽升級後,升級完畢。


 rac1-> sqlplus /nolog

SQL*Plus: Release 10.2.0.4.0 - Production on Sun Aug 3 01:32:47 2008

Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.

SQL> conn sys/oracle as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area  209715200 bytes
Fixed Size                  1266632 bytes
Variable Size             104860728 bytes
Database Buffers          100663296 bytes
Redo Buffers                2924544 bytes
Database mounted.

討論:如果針對在AIX環境下的RAC,是否是把HACMP停掉打補丁會更安全?

 




 




 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8334342/viewspace-417564/,如需轉載,請註明出處,否則將追究法律責任。

相關文章