分类: Oracle
2017-09-16 22:22:10
参考来至Oracle官方文档(Doc ID 1577628.1)
在线联机文档
适用于:
Oracle Database -
Enterprise Edition - 版本 10.1.0.2 到 11.2.0.3 [发行版 10.1 到 11.2]
本文档所含信息适用于所有平台
目标
在主库和备库上都安装补丁集,例如10.2.0.4 Patchset或者2010年1月份10.2.0.4 RDBMS PSU。
对于逻辑备库,请参看文档“Document 437276.1 Upgrading Oracle Database with a Logical Standby Database In
Place”
在主库和备库中安装Patchset/PSU/CPU的过程与安装Patchset一致,下面是完成这个操作的方法:
解决方案
过程总览:
1. 在主库上停止传送日志到备库。
2. 关闭备库,按照README安装补丁集到RDBMS 软件。这包括Patchset/Patchset
Update(PSU)/Critical Patch Update (CPU)。对备库RDBMS本身您将无法也不需要运行脚本(catpatch.sql等)。启动备库到mount状态,不要启动日志应用服务。
3. 关闭主库,按照README安装Patchset/PSU/CPU到RDBMS软件和RDBMS本身(运行catpatch/catbundle/catcpu等)。
注意: Oracle11gR2的(11.2.0)的最新补丁集需要被安装到一个新的ORACLE_HOME。所以记得重置您的环境变量并复制相应的文件(SPFILE,网络文件等..)到新的ORACLE_HOME。详细信息参看数据库升级指南。
4. 启动主库,重新启用日志传送到备库。
5. 在备库启动日志应用服务,主库中的RDBMS变更(catpatch/ catbundle/catcpu 脚本)通过重做日志被应用到备库。
注意: 备库上的数据库软件升级后应立即执行步骤5。这是为了确保数据字典(CATPROC)版本与数据库软件的版本匹配。如果不匹配(例如,您首先升级了备库软件,升级主库前在备库中执行了角色转换(switchover)),你可能会遇到严重的问题。在Data Guard物理备库环境中不支持不同的补丁级别,详细的信息请参看
Document 785347.1 Mixed Oracle Version support with Data Guard Redo Transport
Services
6. 执行检查,以确保补丁已成功安装在主库和备库。
补丁集安装的详细步骤– 例如10.2.0.4 PSU 3 或 Patch 9119284
注意: 如果您使用Oracle Restart(从11.2.0.x),你必须使用类似RAC 数据库中的SRVCTL命令,停止/启动数据库和服务。
1. 如果您使用Data Guard Broker配置,在主库禁用归档到备库。
如果是RAC,您将需要确保所有主库实例禁用归档。如果配置了Data Guard Broker,需要通过DGMGRL管理。如果您使用sqlplus,并没有配置broker,将需要在sql提示符中执行。
1.1 使用DGMGRL禁用日志传送
DGMGRL> connect /
Connected.
DGMGRL> show database verbose plb_prm
Database
Name: plb_prm
Role: PRIMARY
Enabled: YES
Intended State: ONLINE
Instance(s):
plb
Properties:
InitialConnectIdentifier = 'plb_prm_dgmgrl'
..
.
Current status for "plb_prm":
SUCCESS
DGMGRL> edit database plb_prm set state='LOG-TRANSPORT-OFF';
Succeeded.
DGMGRL> exit
或
1.2 如果您使用sqlplus管理环境
在这种情况下,您没有Data
Guard Broker配置。使用sqlplus禁用从主库到备库的归档传送目标地址。
SQL> alter system set log_archive_dest_state_X=defer scope=both sid='*'
2. 在备库软件上安装补丁。
如果这是一个RAC备库,这个补丁将安装到所有节点。
2.1.1 如果这是一个单实例环境,关闭此home下所有正在运行的进程。
包括此home下所有正在运行的监听程序,数据库实例,asm实例等。
[oracle@aulnx9 patches]$
lsnrctl stop lsnrplb
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 04-FEB-2010 08:41:29
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=aulnx9.au.oracle.com)(PORT=1666)))
The command completed successfully
[oracle@aulnx9 patches]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 4 08:42:02 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
或
2.1.2 如果这是一个RAC备库,关闭需要打补丁的ORACLE_HOME下正在运行的所有RAC服务。
在这个示例中,RAC数据库被称为plb,此ORACLE_HOME下正在运行的监听程序名称是lsnrplb。
[oracle@aulnx13 ~]
srvctl stop database -d plb_std
[oracle@aulnx13 ~] srvctl stop listener -n aulnx13.au.oracle.com -l
lsnrplb_aulnx13
[oracle@aulnx13 ~] srvctl stop listener -n aulnx14.au.oracle.com -l
lsnrplb_aulnx14
2.2 10.2.0.4发行版的OPatch无法安装PSU,会出现下面的错误。
[oracle@aulnx9 9119284]$
pwd
/home/oracle/patches/9119284
[oracle@aulnx9 9119284]$ which opatch
/u01/oracle/product/10.2.0/db_plb/OPatch/opatch
[oracle@aulnx9 9119284]$ opatch apply
Invoking OPatch 10.2.0.4.2
Oracle Interim Patch Installer version 10.2.0.4.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /u01/oracle/product/10.2.0/db_plb
Central Inventory : /u01/oraInventory
from : /etc/oraInst.loc
OPatch version : 10.2.0.4.2
OUI version : 10.2.0.4.0
OUI location : /u01/oracle/product/10.2.0/db_plb/oui
Log file location :
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/opatch2010-02-04_08-45-30AM.log
ApplySession failed: Patch ID is null.
System intact, OPatch will not attempt to restore the system
OPatch failed with error code 73
2.2.1 解决这个问题,需要在home中安装补丁6880880,它是最新的OPatch版本。
如果你已经有了一个新版本的OPatch,那么此步骤不必执行。
下载补丁6880880,按照README的提示安装。
[oracle@aulnx9 patches]$
mv /u01/oracle/product/10.2.0/db_plb/OPatch
/u01/oracle/product/10.2.0/db_plb/OPatch_10204
[oracle@aulnx9 patches]$ pwd
/home/oracle/patches
[oracle@aulnx9 patches]$ ls
9119284 OPatch
[oracle@aulnx9 patches]$ cp -rp OPatch/ /u01/oracle/product/10.2.0/db_plb/
2.3 OPatch为新版本后,安装补丁到备库
请注意:在备库中只安装补丁到数据库软件,不需要运行catupgrade/catcpu/catbundle.sql脚本,因为这部分会通过重做日志应用到备库。
下面的示例是安装PSU补丁9119284到单实例备库。
[oracle@aulnx9 9119284]$
opatch apply
Invoking OPatch 11.2.0.1.1
Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /u01/oracle/product/10.2.0/db_plb
Central Inventory : /u01/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.1
OUI version : 10.2.0.4.0
OUI location : /u01/oracle/product/10.2.0/db_plb/oui
Log file location :
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/opatch2010-02-04_08-57-57AM.log
Patch history file:
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/opatch_history.txt
ApplySession applying interim patch '9119284' to OH
'/u01/oracle/product/10.2.0/db_plb'
Running prerequisite checks...
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 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
OPatch detected non-cluster Oracle Home from the inventory and will patch the
local system only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local
system.
(Oracle Home = '/u01/oracle/product/10.2.0/db_plb')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9119284' for restore. This might take a
while...
Backing up files affected by the patch '9119284' for rollback. This might take
a while...
Execution of 'sh /home/oracle/patches/9119284/custom/scripts/pre -apply 9119284
':
Return Code = 0
Patching component oracle.rdbms.rsf, 10.2.0.4.0...
Updating archive file
"/u01/oracle/product/10.2.0/db_plb/lib/libgeneric10.a" with
"lib/libgeneric10.a/qcodfdef.o"
..
.
Updating jar file "/u01/oracle/product/10.2.0/db_plb/rdbms/jlib/qsma.jar"
with "/rdbms/jlib/qsma.jar/oracle/qsma/QsmaFileManager.class"
Copying file to
"/u01/oracle/product/10.2.0/db_plb/rdbms/lib/env_rdbms.mk"
..
.
Running make for target idgmgrl
Running make for target ioracle
Running make for target client_sharedlib
Running make for target itnslsnr
Running make for target iwrap
Running make for target genplusso
ApplySession adding interim patch '9119284' to inventory
Verifying the update...
Inventory check OK: Patch ID 9119284 is registered in Oracle Home inventory
with proper meta-data.
Files check OK: Files from Patch ID 9119284 are present in Oracle Home.
--------------------------------------------------------------------------------
********************************************************************************
********************************************************************************
** ATTENTION **
** **
** Please note that the Patch Set Update Installation (PSU Deinstallation) **
** is not complete until all the Post Installation (Post Deinstallation) **
** instructions noted in the Readme accompanying this PSU, have been **
** successfully completed. **
** **
********************************************************************************
********************************************************************************
--------------------------------------------------------------------------------
Execution of 'sh /home/oracle/patches/9119284/custom/scripts/post -apply
9119284 ':
Return Code = 0
The local system has been patched and can be restarted.
OPatch succeeded.
2.4 启动备库到mount状态,重启监听程序。
2.4.1 如果这是单实例环境(非RAC备库)
启动监听程序:
[oracle@aulnx9 9119284]$
lsnrctl start lsnrplb
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 04-FEB-2010 09:06:02
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /u01/oracle/product/10.2.0/db_plb/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is /u01/oracle/product/10.2.0/db_plb/network/admin/listener.ora
Log messages written to
/u01/oracle/product/10.2.0/db_plb/network/log/lsnrplb.log
Listening on:
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aulnx9.au.oracle.com)(PORT=1666)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=aulnx9.au.oracle.com)(PORT=1666)))
STATUS of the LISTENER
------------------------
Alias lsnrplb
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 04-FEB-2010 09:06:02
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u01/oracle/product/10.2.0/db_plb/network/admin/listener.ora
Listener Log File /u01/oracle/product/10.2.0/db_plb/network/log/lsnrplb.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aulnx9.au.oracle.com)(PORT=1666)))
Services Summary...
Service "plb_std_DGMGRL.au.oracle.com" has 1 instance(s).
Instance "plb_std", status UNKNOWN, has 1 handler(s) for this
service...
The command completed successfully
启动数据库:
[oracle@aulnx9 9119284]$
sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 4 15:12:24 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup mount
ORACLE instance started.
Total System Global Area 268435456 bytes
Fixed Size 1266968 bytes
Variable Size 138414824 bytes
Database Buffers 125829120 bytes
Redo Buffers 2924544 bytes
Database mounted.
或
2.4.2 如果这是RAC备库
[oracle@aulnx13 ~]$
srvctl start listener -n aulnx11 -l lsnrplb_aulnx13
[oracle@aulnx13 ~]$ srvctl start listener -n aulnx12 -l lsnrplb_aulnx14
[oracle@aulnx13 ~]$ srvctl start database -d plb_std -o mount???????????¨
3. 在主库上安装补丁。
请注意:主库可能也需要OPatch升级,按照备库安装补丁6880880同样的方式处理。
切换到主库的补丁目录并安装PSU
[oracle@aulnx8 patches]$
cd 9119284/
[oracle@aulnx8 9119284]$ pwd
/home/oracle/patches/9119284
3.1 停止即将安装补丁的home下正在运行的所有进程。
包括监听程序和数据库等等。
3.1.1 如果这是一个单实例主库(非RAC)
[oracle@aulnx8 9119284]$
lsnrctl stop lsnrplb
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 04-FEB-2010 09:06:28
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=aulnx8.au.oracle.com)(PORT=1666)))
The command completed successfully
[oracle@aulnx8 9119284]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 4 09:06:36 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
或
3.1.2 如果这是一个RAC主库
[oracle@aulnx11 ~]$
srvctl stop listener -n aulnx11 -l lsnrplb_aulnx11
[oracle@aulnx11 ~]$ srvctl stop listener -n aulnx12 -l lsnrplb_aulnx12
[oracle@aulnx11 ~]$ srvctl stop database -d plb
3.2 在主库软件上安装补丁。
如备库一样,下面的示例是安装PSU补丁9119284到单实例主库。
[oracle@aulnx8 9119284]$
opatch apply
Invoking OPatch 11.2.0.1.1
Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /u01/oracle/product/10.2.0/db_plb
Central Inventory : /u01/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.1
OUI version : 10.2.0.4.0
OUI location : /u01/oracle/product/10.2.0/db_plb/oui
Log file location :
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/opatch2010-02-04_09-10-28AM.log
Patch history file: /u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/opatch_history.txt
ApplySession applying interim patch '9119284' to OH
'/u01/oracle/product/10.2.0/db_plb'
Running prerequisite checks...
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 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
OPatch detected non-cluster Oracle Home from the inventory and will patch the
local system only.
Please shutdown Oracle instances running out of this ORACLE_HOME on the local
system.
(Oracle Home = '/u01/oracle/product/10.2.0/db_plb')
Is the local system ready for patching? [y|n]
y
User Responded with: Y
Backing up files and inventory (not for auto-rollback) for the Oracle Home
Backing up files affected by the patch '9119284' for restore. This might take a
while...
Backing up files affected by the patch '9119284' for rollback. This might take
a while...
Execution of 'sh /home/oracle/patches/9119284/custom/scripts/pre -apply 9119284
':
Return Code = 0
Patching component oracle.rdbms.rsf, 10.2.0.4.0...
Updating archive file
"/u01/oracle/product/10.2.0/db_plb/lib/libgeneric10.a" with
"lib/libgeneric10.a/qcodfdef.o"
..
.
Updating jar file
"/u01/oracle/product/10.2.0/db_plb/rdbms/jlib/qsma.jar" with
"/rdbms/jlib/qsma.jar/oracle/qsma/QsmaFileManager.class"
..
.
Running make for target client_sharedlib
Running make for target idgmgrl
Running make for target ioracle
Running make for target client_sharedlib
Running make for target itnslsnr
Running make for target iwrap
Running make for target genplusso
ApplySession adding interim patch '9119284' to inventory
Verifying the update...
Inventory check OK: Patch ID 9119284 is registered in Oracle Home inventory
with proper meta-data.
Files check OK: Files from Patch ID 9119284 are present in Oracle Home.
--------------------------------------------------------------------------------
********************************************************************************
********************************************************************************
** ATTENTION **
** **
** Please note that the Patch Set Update Installation (PSU Deinstallation) **
** is not complete until all the Post Installation (Post Deinstallation) **
** instructions noted in the Readme accompanying this PSU, have been **
** successfully completed. **
** **
********************************************************************************
********************************************************************************
--------------------------------------------------------------------------------
Execution of 'sh /home/oracle/patches/9119284/custom/scripts/post -apply
9119284 ':
Return Code = 0
The local system has been patched and can be restarted.
OPatch succeeded.
3.3 升级/修补RDBMS和字典对象。
在RAC环境中,这步只需在一个实例执行,并确保其他的集群实例关闭。下面的示例再次显示安装PSU9119284到单实例(非RAC)主库。
更改目录到$ORACLE_HOME/rdbms/admin,补丁已安装到此目录,执行以下命令。
[oracle@aulnx8 9119284]$
cd $ORACLE_HOME/rdbms/admin
[oracle@aulnx8 admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 4 09:25:09 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> startup restrict
ORACLE instance started.
Total System Global Area 268435456 bytes
Fixed Size 1266968 bytes
Variable Size 138414824 bytes
Database Buffers 125829120 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> @catbundle psu apply
PL/SQL procedure successfully completed.
..
.
SQL> COMMIT;
Commit complete.
SQL> SPOOL off
SQL> SET echo off
Check the following log file for errors:
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/catbundle/catbundle_PSU_PLB_APPLY_2010Feb04_09_25_28.log???????????¨
注:如果这是一个Patchset,请您运行:
SQL>@catupgrade
如果这是一个Critical Patch Update(CPU),请您运行:
SQL>@catcpu
4. 在主库中重新建立Data Guard环境。
4.1.1 在单实例主库已经安装过补丁的ORACLE_HOME中重启进程。
这包括监听程序,数据库实例,ASM实例和这个ORACLE_HOME中之前运行的其他进程。
[oracle@aulnx8 admin]$
lsnrctl start lsnrplb
LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 04-FEB-2010 09:45:43
Copyright (c) 1991, 2007, Oracle. All rights reserved.
Starting /u01/oracle/product/10.2.0/db_plb/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 10.2.0.4.0 - Production
System parameter file is
/u01/oracle/product/10.2.0/db_plb/network/admin/listener.ora
Log messages written to
/u01/oracle/product/10.2.0/db_plb/network/log/lsnrplb.log
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aulnx8.au.oracle.com)(PORT=1666)))
Connecting to
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=aulnx8.au.oracle.com)(PORT=1666)))
STATUS of the LISTENER
------------------------
Alias lsnrplb
Version TNSLSNR for Linux: Version 10.2.0.4.0 - Production
Start Date 04-FEB-2010 09:45:43
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File
/u01/oracle/product/10.2.0/db_plb/network/admin/listener.ora
Listener Log File /u01/oracle/product/10.2.0/db_plb/network/log/lsnrplb.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=aulnx8.au.oracle.com)(PORT=1666)))
Services Summary...
Service "plb_prm_DGMGRL.au.oracle.com" has 1 instance(s).
Instance "plb", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
或
4.1.2 如果这是一个RAC环境,使用srvctl在每个节点,从安装过补丁的ORACLE_HOME中重启监听。
[oracle@aulnx11 ~]$
srvctl start listener -n aulnx11 -l lsnrplb_aulnx11
[oracle@aulnx11 ~]$ srvctl start listener -n aulnx12 -l lsnrplb_aulnx12
4.1.3. 强制主库在监听程序中注册它的服务。
[oracle@aulnx8 admin]$
sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Thu Feb 4 09:45:50 2010
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> alter system register;
System altered.
4.2.1 在单实例(非RAC)中禁用限制会话,允许最终用户连接
SQL> alter system
disable restricted session;
System altered.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 -
Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
或
4.2.2 在RAC的主库,重启主库和它所有的实例
[oracle@aulnx11 ~]
srvctl stop database -d plb
[oracle@aulnx11 ~] srvctl start database -d plb
如果有其它的RAC服务连接到这个数据库,都将需要使用srvctl重新启动
[oracle@aulnx11 ~] srvctl start service -d plb
4.3 重新启用日志传送到备库
这将使通过catupgrade/catbundle/catcpu脚本对数据库的改变被应用到备库。
4.3.1 如果您使用Data Guard Broker配置
[oracle@aulnx8 admin]$
dgmgrl
DGMGRL for Linux: Version 10.2.0.4.0 - Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect /
Connected.
DGMGRL> edit database plb_prm set state='ONLINE';
Succeeded.
DGMGRL> exit
或
4.3.2 如果您使用sqlplus重新启用从主库到备库传送归档的目标地址
SQL> alter system set log_archive_dest_state_X=enable scope=both sid='*'
其中,X是用于传送重做日志到备库的目标数值。
5. 主库将继续传送重做日志,备库将继续介质恢复并应用主库在安装补丁过程中的变更。
在备库警报日志中,你会看到运行cat脚本过程中生成的日志,传送并应用到备库:
Thu Feb 4 09:45:57 2010
RFS[1]: Archived Log:
'/oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_79_5pmz52s2_.arc'
RFS[1]: Archived Log:
'/oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_76_5pmz55l4_.arc'
RFS[1]: Archived Log:
'/oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_77_5pmz55oo_.arc'
RFS[1]: Archived Log:
'/oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_78_5pmz561c_.arc'
Thu Feb 4 09:46:24 2010
Media Recovery Log
/oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_76_5pmz55l4_.arc
Media Recovery Log
/oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_77_5pmz55oo_.arc
Media Recovery Log /oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_78_5pmz561c_.arc
Thu Feb 4 09:46:44 2010
Media Recovery Log
/oradata/flash_recovery_area/PLB_STD/archivelog/2010_02_04/o1_mf_1_79_5pmz52s2_.arc
Media Recovery Waiting for thread 1 sequence 80
6.检查补丁已成功安装在主库和备库。
例如PSU补丁 9119284。
请注意:目前(10.2.0.4 PSU)的版本不会更新到工具的头信息中,如sqlplus,也不会更新到数据库的版本信息中。它们会保持在10.2.0.4.0,例如在安装过PSU后不会更新到10.2.0.4.3。您将只能通过inventory看到PSU信息,或查看版本
[oracle@aulnx8 admin]$
opatch lsinventory
Invoking OPatch 11.2.0.1.1
Oracle Interim Patch Installer version 11.2.0.1.1
Copyright (c) 2009, Oracle Corporation. All rights reserved.
Oracle Home : /u01/oracle/product/10.2.0/db_plb
Central Inventory : /u01/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.2.0.1.1
OUI version : 10.2.0.4.0
OUI location : /u01/oracle/product/10.2.0/db_plb/oui
Log file location :
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/opatch2010-02-04_10-01-18AM.log
Patch history file:
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/opatch_history.txt
Lsinventory Output file location :
/u01/oracle/product/10.2.0/db_plb/cfgtoollogs/opatch/lsinv/lsinventory2010-02-04_10-01-18AM.txt
--------------------------------------------------------------------------------
Installed Top-level Products (2):
Oracle Database 10g 10.2.0.1.0
Oracle Database 10g Release 2 Patch Set 3 10.2.0.4.0
There are 2 products installed in this Oracle Home.
Interim patches (1) :
Patch 9119284 : applied on Thu Feb 04 10:15:51 EST 2010
Unique Patch ID: 11999265
Created on 17 Dec 2009, 03:32:08 hrs PST8PDT
Bugs fixed:
6418420, 7835247, 7207654, 7592346, 6724797, 7936993, 7331867, 9093300
..
.
7523787, 6029179, 5231155, 6455659
--------------------------------------------------------------------------------
OPatch succeeded.
或
通过registry history视图查看PSU信息。
SQL> select
ACTION_TIME,ACTION,NAMESPACE,VERSION,BUNDLE_SERIES,ID from registry$history;
ACTION_TIME
---------------------------------------------------------------------------
ACTION NAMESPACE
------------------------------ ------------------------------
VERSION BUNDLE_SERIES ID
------------------------------ ------------------------------ ----------
04-FEB-10 09.26.25.026334 AM
APPLY SERVER
10.2.0.4 PSU 3