测试环境ORACLE 11g单实例打11.2.0.3.13 p19769496 PSU操作流程

来源:互联网 发布:淘宝包邮拒签邮费谁出 编辑:程序博客网 时间:2024/05/16 16:08
                            
1.停止监听  
[oracle@localhost admin]$ lsnrctl stop LISTENER


LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 25-JAN-2015 22:50:17


Copyright (c) 1991, 2011, Oracle.  All rights reserved.


Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
The command completed successfully 


2、检查数据库是否还存在连接。
[oracle@localhost ~]$ps -ef |grep LOCAL=NO  
oracle    4377  2979  1 22:48 pts/1    00:00:00 grep LOCAL=NO


3、切换日志,关闭数据库。
SQL> alter system checkpoint;


System altered.


SQL> alter system switch logfile;


System altered.


SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.


4、备份ORACLE_HOME目录
cp -R <ORACLE_HOME> <ORACLE_HOME_BAK>


5.进入19769496 psu 解压目录,确保19769496权限为oracle:oinstall  
[oracle@localhost patch]$ cd 19769496/
[oracle@localhost 19769496]$ ll
total 112
drwxr-xr-x. 4 oracle oinstall  4096 Dec  9 22:41 13343438
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 13696216
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 13923374
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 14275605
drwxrwxr-x. 5 oracle oinstall  4096 Dec  9 22:41 14727310
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 16056266
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 16619892
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 16902043
drwxrwxr-x. 5 oracle oinstall  4096 Dec  9 22:41 17540582
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 18031683
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 18522512
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 19121548
drwxrwxr-x. 4 oracle oinstall  4096 Dec  9 22:41 19769496
-rw-rw-r--. 1 oracle oinstall 51692 Jan 17 08:30 README.html
-rw-r--r--. 1 oracle oinstall    21 Dec  9 22:41 README.txt
-rw-r--r--. 1 oracle oinstall  2872 Dec  9 22:42 patchmd.xml


6、检查OPATCH版本,如果版本过低需要到metalink下载最近的OPATCH psu号为为6880880。
OPatch Version: 11.2.0.1.7


OPatch succeeded.


7、下载最近的OPATCH psu号为为6880880,备份原先的OPatch目录,并解压到ORACLE_HOME目录下。
[oracle@localhost ~]$cd $ORACLE_HOME
[oracle@localhost db_1]$ mv OPatch/ OPatch_bak/
[oracle@localhost db_1]$ unzip p6880880_112000_Linux-x86-64.zip


8、再次检查OPATCH版本。
OPatch Version: 11.2.0.3.6


OPatch succeeded.


9、检查是否有与19769496有冲突的PSU。
[oracle@localhost ~]$ cd /home/oracle/patch/19769496/
[oracle@localhost 19769496]$ $ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -ph ./ 
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.


PREREQ session


Oracle Home       : /opt/app/oracle/product/11.2.0/db_1
Central Inventory : /opt/app/oraInventory
   from           : /opt/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.3.0
Log file location : /opt/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-01-25_22-25-34PM_1.log


Invoking prereq "checkconflictagainstohwithdetail"


Prereq "checkConflictAgainstOHWithDetail" passed.


OPatch succeeded.


10、安装补丁号为19769496的PSU。
[oracle@localhost ~]$ cd /home/oracle/patch/19769496/
[oracle@localhost 19769496]$ /opt/app/oracle/product/11.2.0/db_1/OPatch/opatch apply
Oracle Interim Patch Installer version 11.2.0.3.6
Copyright (c) 2013, Oracle Corporation.  All rights reserved.




Oracle Home       : /opt/app/oracle/product/11.2.0/db_1
Central Inventory : /opt/app/oraInventory
   from           : /opt/app/oracle/product/11.2.0/db_1/oraInst.loc
OPatch version    : 11.2.0.3.6
OUI version       : 11.2.0.3.0
Log file location : /opt/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-01-25_19-18-41PM_1.log


Verifying environment and performing prerequisite checks...
OPatch continues with these patches:   13343438  13696216  13923374  14275605  14727310  16056266  16619892  16902043  17540582  18031683  18522512  19121548  19769496  


Do you want to proceed? [y|n]
y
User Responded with: Y
All checks passed.
Provide your email address to be informed of security issues, install and
initiate Oracle Configuration Manager. Easier for you if you use your My
Oracle Support Email address/User Name.
Visit http://www.oracle.com/support/policies.html for details.
Email address/User Name: 


You have not provided an email address for notification of security issues.
Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  y






Please shutdown Oracle instances running out of this ORACLE_HOME on the local system.
(Oracle Home = '/opt/app/oracle/product/11.2.0/db_1')




Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '13343438' to OH '/opt/app/oracle/product/11.2.0/db_1'


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '13696216' to OH '/opt/app/oracle/product/11.2.0/db_1'


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.sdo.locator, 11.2.0.3.0...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Patching component oracle.sysman.oms.core, 10.2.0.4.4...


Verifying the update...
Applying sub-patch '13923374' to OH '/opt/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.network.cman, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.network.rsf, 11.2.0.3.0...


Patching component oracle.network.listener, 11.2.0.3.0...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '14275605' to OH '/opt/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.network.client, 11.2.0.3.0...


Patching component oracle.network.rsf, 11.2.0.3.0...


Patching component oracle.precomp.common, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms.util, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '14727310' to OH '/opt/app/oracle/product/11.2.0/db_1'


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sdo.locator, 11.2.0.3.0...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Patching component oracle.sysman.oms.core, 10.2.0.4.4...


Verifying the update...
Applying sub-patch '16056266' to OH '/opt/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.network.cman, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.network.listener, 11.2.0.3.0...


Patching component oracle.network.rsf, 11.2.0.3.0...


Patching component oracle.ovm, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sdo.locator, 11.2.0.3.0...


Patching component oracle.rdbms.deconfig, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '16619892' to OH '/opt/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.marvel, 11.2.0.3.0...


Patching component oracle.precomp.common, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sysman.agent, 10.2.0.4.3...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Patching component oracle.sysman.repository.core, 10.2.0.4.4...


Patching component oracle.xdk, 11.2.0.3.0...


Patching component oracle.xdk.parser.java, 11.2.0.3.0...


Patching component oracle.xdk.rsf, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '16902043' to OH '/opt/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.idm.oid, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.ldap.rsf, 11.2.0.3.0...


Patching component oracle.ldap.rsf.ic, 11.2.0.3.0...


Patching component oracle.owb.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '17540582' to OH '/opt/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.sdo, 11.2.0.3.0...


Patching component oracle.ldap.rsf, 11.2.0.3.0...


Patching component oracle.precomp.common, 11.2.0.3.0...


Patching component oracle.ordim.client, 11.2.0.3.0...


Patching component oracle.rdbms.util, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.sdo.locator, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.ordim.jai, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '18031683' to OH '/opt/app/oracle/product/11.2.0/db_1'
ApplySession: Optional component(s) [ oracle.precomp.lang, 11.2.0.3.0 ]  not present in the Oracle Home or a higher version is found.


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.ldap.rsf, 11.2.0.3.0...


Patching component oracle.precomp.common, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.util, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '18522512' to OH '/opt/app/oracle/product/11.2.0/db_1'


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.network.rsf, 11.2.0.3.0...


Patching component oracle.precomp.common, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '19121548' to OH '/opt/app/oracle/product/11.2.0/db_1'


Patching component oracle.sysman.console.db, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.rdbms.rman, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.ordim.client, 11.2.0.3.0...


Patching component oracle.ordim.jai, 11.2.0.3.0...


Verifying the update...
Applying sub-patch '19769496' to OH '/opt/app/oracle/product/11.2.0/db_1'


Patching component oracle.sysman.agent, 10.2.0.4.3...


Patching component oracle.ovm, 11.2.0.3.0...


Patching component oracle.xdk, 11.2.0.3.0...


Patching component oracle.rdbms.util, 11.2.0.3.0...


Patching component oracle.rdbms, 11.2.0.3.0...


Patching component oracle.rdbms.dbscripts, 11.2.0.3.0...


Patching component oracle.xdk.parser.java, 11.2.0.3.0...


Patching component oracle.oraolap, 11.2.0.3.0...


Patching component oracle.rdbms.rsf, 11.2.0.3.0...


Patching component oracle.xdk.rsf, 11.2.0.3.0...


Verifying the update...


OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/opt/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'
/opt/app/oracle/product/11.2.0/db_1/precomp/lib/ins_precomp.mk:19: warning: overriding commands for target `pcscfg.cfg'
/opt/app/oracle/product/11.2.0/db_1/precomp/lib/env_precomp.mk:2160: warning: ignoring old commands for target `pcscfg.cfg'






OPatch found the word "warning" in the stderr of the make command.
Please look at this stderr. You can re-run this make command.
Stderr output:
ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'
/opt/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk:113: warning: overriding commands for target `nmosudo'
/opt/app/oracle/product/11.2.0/db_1/sysman/lib/ins_emagent.mk:52: warning: ignoring old commands for target `nmosudo'




Composite patch 19769496 successfully applied.
OPatch Session completed with warnings.
Log file location: /opt/app/oracle/product/11.2.0/db_1/cfgtoollogs/opatch/opatch2015-01-25_19-18-41PM_1.log


OPatch completed with warnings.


11、进入admin目录,执行catbundle.sql脚本更新数据字典。
[oracle@localhost ~]$ cd $ORACLE_HOME/rdbms/admin
[oracle@localhost admin]$ sqlplus '/as sysdba'


SQL*Plus: Release 11.2.0.3.0 Production on Sun Jan 25 22:01:32 2015


Copyright (c) 1982, 2011, Oracle.  All rights reserved.


Connected to an idle instance.


SQL> 
SQL> 
SQL> 
SQL> startup
ORACLE instance started.


Total System Global Area  780824576 bytes
Fixed Size    2232432 bytes
Variable Size  562040720 bytes
Database Buffers  213909504 bytes
Redo Buffers    2641920 bytes
Database mounted.
Database opened.
SQL> @catbundle.sql psu apply  


12、查询registry$history 来查看PSU级别。
SQL>select substr(action_time,1,30) action_time,   
    substr(id,1,8) id,   
    substr(action,1,10) action,   
    substr(version,1,8) version,   
    substr(comments,1,20) comments   
    from registry$history; 


ACTION_TIME ID ACTION     VERSION  COMMENTS
---------------------------------------- ---------------- ---------- -------------------- ------------------------------
17-SEP-11 10.21.11.595816 AM 0 APPLY      11.2.0.3  Patchset 11.2.0.2.0
19-JAN-15 12.02.35.037223 AM 0 APPLY      11.2.0.3  Patchset 11.2.0.2.0
25-JAN-15 08.04.12.093341 PM 13 APPLY      11.2.0.3  PSU 11.2.0.3.13


13.执行完catbundle.sql后,会在$ORACLE_HOME/rdbms/admin目录下生成catbundle_PSU_<database SID>_APPLY.sql,catbundle_PSU_<database SID>_ROLLBACK.sql两个脚本。  
[oracle@localhost admin]$ cd $ORACLE_HOMErdbms/admin/
[oracle@localhost admin]$ ll catbundle_*
-rw-r-----. 1 oracle oinstall 2262 Jan 25 19:54 catbundle_PSU_ORCL_APPLY.sql
-rw-r-----. 1 oracle oinstall 2311 Jan 25 19:54 catbundle_PSU_ORCL_ROLLBACK.sql
  
catbundle_PSU_ORCL_ROLLBACK.sql用于回滚PSU时使用  
1 0