11.2.0.4 RAC 某系统主库使用auto rolling的方式打补丁
在一节点执行1-5,结束后然后在二节点执行1-5,结束后最后再在某个节点执行6。
1.backup GI_HOME&DB_HOME
su - root cd /u01/app/oracle/product/11.2.0/ tar -czvpf /u01/backup/db_1.tar.gz db_1 ls -lrt /u01/backup/db_1.tar.gz cd /u01/app/ tar -czvpf /u01/backup/grid.tar.gz grid
2.update OPatch
su - root cd /u01/app/grid mv OPatch OPatch.bak0617 unzip /u01/software/p6880880_112000_Linux-x86-64.zip -d /u01/app/grid/ chown -R grid:oinstall OPatch chmod -R 755 OPatch cd /u01/app/oracle/product/11.2.0/db_1 mv OPatch OPatch.bak0617 unzip /u01/software/p6880880_112000_Linux-x86-64.zip -d /u01/app/oracle/product/11.2.0/db_1/ chown -R oracle:oinstall OPatch chmod -R 755 OPatch /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch version /u01/app/grid/OPatch/opatch version -- Validation of Oracle Inventory /u01/app/oracle/product/11.2.0/db_1/OPatch/opatch lsinventory -detail -oh /u01/app/oracle/product/11.2.0/db_1/ /u01/app/grid/OPatch/opatch lsinventory -detail -oh /u01/app/grid/
3. unzip
su - grid cd /u01/software unzip p31718723_112040_Linux-x86-64.zip chmod -R 775 31718723 cd 31718723 $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./
4.opatch auto
su -root /u01/app/grid/OPatch/opatch auto /u01/software/31718723
5.check
/u01/app/grid/OPatch/opatch lsinv crsctl stat res -t
6. Loading Modified SQL Files into the Database
su - oracle cd $ORACLE_HOME/rdbms/admin sqlplus /nolog SQL> CONNECT / AS SYSDBA SQL> --STARTUP SQL> @catbundle.sql psu apply SQL> @utlrp.sql
--check set linesize 300 col ACTION_TIME for a40 col ACTION for a10 col NAMESPACE for a10 col VERSION for a10 col COMMENTS for a40 select * from dba_registry_history;
总结:
1.保留权限备份。
tar -czvpf fabu.tar.gz fabu --打包
tar -zxvpf fabu.tar.gz fabu --解包
2.执行@catbundle.sql psu apply时可能输出不正常,可以重复执行。
3.auto方式无需手动启停集群,auto会自动启停,并且打补丁大部分时间是耗在集群的启停上。
4.rollback
As root user, execute the following command on each node of the cluster. # opatch auto /u01/software/31718723 -rollback su - oracle cd $ORACLE_HOME/rdbms/admin sqlplus /nolog SQL> CONNECT / AS SYSDBA SQL> STARTUP SQL> @catbundle_PSU_<database SID PREFIX>_ROLLBACK.sql SQL> @utlrp.sql