Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

时间:2024-04-14 11:22:59


这篇文档只是一个升级的步骤,不是一个完整的方案,对于完整的方案还需要更多的前期准备工作和善后工作,如备份和升级后的检查等。 Oracle 10g 目前最新的版本是10.2.0.5.4。该版本也应该是Oracle 10g的最后一个版本了。 Oracle 现在已经不卖Oracle 10g的版本,所以以后更多的精力会花到11g上。

10.2.0.5的Patch No是:8202632

10.2.0.5.4的Patch NO 是:12419392

10.2.0.5.4 的Patch 比较小,下载说明参考:

Oracle10.2.0.5.4 Patch Set Update (PSU) – Patch No: p12419392

http://blog.****.net/tianlesoftware/article/details/6797083

10.2.0.5 的PSU 有1G多,这个自己从Metalink上下载去了。

单实例下的升级步骤比较简单:

1.备份整个ORACLE_HOME目录,Instance

2.升级ORACLE 软件到10.2.0.5

3.升级实例到10.2.0.5.4

4.打10.2.0.5.4 的Patch

5.检查无效对象

Oracle 10g upgrade from10.2.0.1 to 10.2.0.4

http://blog.****.net/tianlesoftware/article/details/5507762

一.系统和DB信息检查

Linux 下查看系统是32位 还是64 位的方法

http://blog.****.net/tianlesoftware/article/details/6267115

查看 Oracle 是32位还是64位的方法

http://blog.****.net/tianlesoftware/article/details/6818709

[[email protected] /]# getconf LONG_BIT

32

[[email protected] /]# uname -a

Linux dave 2.6.18-164.el5xen #1 SMP Tue Aug18 16:06:30 EDT 2009 i686 i686 i386 GNU/Linux

dave:/home/oracle> sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.1.0 - Productionon Sun Oct 9 14:26:17 2011

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

Connected to:

Oracle Database 10g Enterprise EditionRelease 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Miningoptions

SQL> select name from v$database;

NAME

---------

ANQING

SQL> select * from v$version;

BANNER

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

Oracle Database 10g Enterprise EditionRelease 10.2.0.1.0 - Prod

PL/SQL Release 10.2.0.1.0 - Production

CORE10.2.0.1.0 Production

TNS for Linux: Version 10.2.0.1.0 -Production

NLSRTL Version 10.2.0.1.0 - Production

SQL>

二.升级Oracle 软件 到10.2.0.5

2.1 关闭实例,监听 和 OEM

[[email protected] mnt]# su - oracle

dave:/home/oracle> lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.1.0 -Production on 09-OCT-2011 15:26:50

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

The command completed successfully

dave:/home/oracle> emctl stop dbconsole

TZ set to PRC

Oracle Enterprise Manager 10g DatabaseControl Release 10.2.0.1.0

Copyright (c) 1996, 2005 OracleCorporation. All rights reserved.

http://dave:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 10gDatabase Control ...

...Stopped.

dave:/home/oracle> sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.1.0 - Productionon Sun Oct 9 15:27:00 2011

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

Connected to:

Oracle Database 10g Enterprise EditionRelease 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Miningoptions


SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

注意:

(1)我这里是测试环境,就不进行备份操作,如果是生产环境,切记在关闭实例后对ORACLE_HOME和 Instance 进行备份,然后在升级。

(2)运行Patch 必须关闭所有的相关进程,包括sqlplus客户端连接。不然会报错,安装无法继续。

2.2 运行Patch

进入Patch: 8202632,运行runInstaller 就ok了,patch里面有一个readme文档,里面有详细的说明。

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

选择我们需要升级的ORACLE_HOME

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤


这里不写email 地址,这是个收费的metalink 帐号,如果有购买产品,可以写。 没购买,直接跳过。

验证相关的信息,如果有报错,根据提示修改一下相关参数就ok了。我这里修改了/etc/sysctl.conf文件下的三个参数:

net.ipv4.ip_local_port_range = 9000 65500

fs.file-max = 101365

net.core.rmem_default = 1048576

修改完执行:

[[email protected] mnt]# sysctl –p

使修改的参数生效,然后重新检测。全部通过后如下:


Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤


Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤


用root 用户运行脚本:/u01/app/oracle/product/10.2.0/db_1/root.sh。 运行结束后升级操作结束。 整个过程十几分钟搞定。

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

三.升级Instance到10.2.0.5

这里有2种方法,一是手工执行命令,而是使用dbua。 Dbua 工具是把相关的命令封装了起来,操作起来相对简单。

3.1 手工执行命令步骤如下

After youinstall the patch set, you must perform the following steps on every databaseassociated with the upgraded Oracle home:

Note:

If you do not runthecatupgrd.sqlscript as described in this section and you start upa database for normal operation, thenORA-01092: ORACLE instanceterminated. Disconnection forcederrors will occur and theerrorORA-39700: database must be opened with UPGRADE optionwill bein the alert log.

1.Log in as the Oracle softwareowner user.

2.For Oracle RAC installations,start listener on each node of the cluster as follows:

$ srvctl start listener -n node

3.If you are using AutomaticStorage Management, start the Automatic Storage Management instance.

4.For single-instanceinstallations, start thelisteneras follows:

$ lsnrctl start

5.For single-instance installations, use SQL*Plusto log in to the database as theSYSuserwithSYSDBAprivileges:

$ sqlplus /nolog

SQL> CONNECT SYS AS SYSDBA

Enter password:SYS_password

Users of single-instance implementations should now bypass stepsthat apply to Oracle RAC installations.

6.For Oracle RAC installations:

a.Use SQL*Plus to log in to the database as theSYSuserwithSYSDBAprivileges:

$ sqlplus /nolog

SQL> CONNECT SYS AS SYSDBA

Enter password: SYS_password

SQL> STARTUP NOMOUNT

b.Set theCLUSTER_DATABASEinitializationparameter toFALSE:

SQL> ALTER SYSTEM SET CLUSTER_DATABASE=FALSE SCOPE=spfile;

c.Shut down the database:

SQL> SHUTDOWN

7.Enter the following SQL*Plus commands:

SQL> STARTUP UPGRADE

SQL> SPOOL patch.log

SQL> @?/rdbms/admin/catupgrd.sql

SQL> SPOOL OFF

8.Review thepatch.logfile forerrors and inspect the list of components that is displayed at the end ofcatupgrd.sqlscript.

This list provides the version and status of eachSERVERcomponentin the database.

9.If necessary, rerun thecatupgrd.sqlscriptafter correcting any problems.

10. Restart the database:

SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP


11. Run theutlrp.sqlscriptto recompile all invalid PL/SQL packages now instead of when the packages areaccessed for the first time. This step is optional but recommended.

SQL> @?/rdbms/admin/utlrp.sql

Note:

When the10.2.0.5 patch set is applied to an Oracle10gStandard Edition database,there may be 54 invalid objects after theutlrp.sqlscript runs.These objects belong to the unsupported components and do not affect thedatabase operation.

Ignore any messagesindicating that the database contains invalid recycle bin objects similar tothe following:

BIN$4lzljWIt9gfgMFeM2hVSoA==$0

This issue is tracked with Oracle bug 9386364.


12. Run the following command to check the status of all the componentsafter the upgrade:

SQL> SELECTCOMP_NAME, VERSION, STATUS FROM SYS.DBA_REGISTRY;

In the output of the preceding command, thestatus of all the components should beVALIDfor asuccessful upgrade.


13. If you are using the Oracle Recovery Manager catalog, enter thefollowing command:

$ rman catalog username/[email protected]

RMAN> UPGRADE CATALOG;


14. For Oracle RAC installations:

a.Set theCLUSTER_DATABASEinitializationparameter toTRUE:

SQL> ALTER SYSTEM SET CLUSTER_DATABASE=TRUE SCOPE=spfile;

b.Restart the database:

SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP

c.Start any database services that you want to use:

$ srvctl start service -d db_name -s service_name


15. To configure and secure Enterprise Manager follow these steps:

Ensure the database and Listener are operational.

(1)In the case of a single instance, execute

emca -upgrade db

(2)In the case of Oracle RAC, execute

emca -upgrade db -cluster

3.2 使用DBUA工具


我这里使用DBUA 工具来升级Instance。用Oracle 用户运行dbua命令。

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤


这里我们并没有启动实例,dbua命令会自动完成这些操作。

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

Linux 平台 Oracle 单实例 从10.2.0.1 升级到10.2.0.5.4 步骤

这个过程比较漫长,需要近一个小时。倒数第二步EM配置出错。 这里我们先继续。EM 可以最后在单独配置。

3.3 检查实例版本信息

dave:/home/oracle> sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.5.0 - Productionon Sun Oct 9 17:02:12 2011

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

Connected to:

Oracle Database 10g Enterprise EditionRelease 10.2.0.5.0 - Production

With the Partitioning, OLAP, Data Miningand Real Application Testing options

SQL> col comp_name format a40

SQL> col version for a20

SQL> SELECT COMP_NAME, VERSION, STATUSFROM SYS.DBA_REGISTRY;

COMP_NAME VERSION STATUS

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

Oracle Database Catalog Views 10.2.0.5.0 VALID

Oracle Database Packages and Types 10.2.0.5.0 VALID

Oracle Workspace Manager 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

Oracle Expression Filter 10.2.0.5.0 VALID

Oracle Data Mining 10.2.0.5.0 VALID

Oracle Text 10.2.0.5.0 VALID

Oracle XML Database 10.2.0.5.0 VALID

Oracle Rule Manager 10.2.0.5.0 VALID

COMP_NAME VERSION STATUS

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

Oracle interMedia 10.2.0.5.0 VALID

OLAP Analytic Workspace 10.2.0.5.0 VALID

Oracle OLAP API 10.2.0.5.0 VALID

OLAP Catalog 10.2.0.5.0 VALID

Spatial10.2.0.5.0 VALID

Oracle Enterprise Manager 10.2.0.5.0 VALID

17 rows selected.

实例的版本已经升级到10.2.0.5.0了。 不过我们之前还有一个EM 的问题没有搞定。

3.4 重新配置EM(这一步应该放到整个升级的最后来操作,因为这个EM patch 与10.2.0.5.4 的patch 有冲突)

Oracle OEM 的重建参考我的Blog:

Oracle OEM 重建 及 案例 说明

http://blog.****.net/tianlesoftware/article/details/4702978

在Oracle10.2.0.4和10.2.0.5的版本里,OEM 有个bug,具体参考:

Oracle 10.2.0.4和10.2.0.5中 OEM bug 8350262

http://blog.****.net/tianlesoftware/article/details/6568690

不过有的公司规定不启用OEM,那样这部都可以直接省略了。 EM的重建不影响instance 的使用,所以这个重建比较方便。

重建的步骤如下:

(1)检查/etc/hosts 文件:

dave:/home/oracle> cat /etc/hosts

# Do not remove the following line, orvarious programs

# that require network functionality willfail.

127.0.0.1 dave localhost.localdomainlocalhost

192.168.3.2 dave

(2) 启动监听:

dave:/home/oracle> lsnrctl start

LSNRCTL for Linux: Version 10.2.0.5.0 -Production on 09-OCT-2011 17:01:10

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

Starting/u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNR for Linux: Version 10.2.0.5.0 -Production

System parameter file is/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Log messages written to/u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening on:(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))

Listening on:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dave)(PORT=1521)))

Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version10.2.0.5.0 - Production

Start Date 09-OCT-2011 17:01:11

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora

Listener Log File/u01/app/oracle/product/10.2.0/db_1/network/log/listener.log

Listening Endpoints Summary...

(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))

(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=dave)(PORT=1521)))

Services Summary...

Service "PLSExtProc" has 1instance(s).

Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) forthis service...

The command completed successfully

(3)打EM的bug: 8350262

--安装patch

dave:/mnt/OracleSoftware/10.2.0.4-5_OEM_Bug_p8350262/p8350262_10205_Generic/8350262>$ORACLE_HOME/OPatch/opatch apply

Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version10.2.0.4.9

Copyright (c) 2009, Oracle Corporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/10.2.0/db_1

Central Inventory :/u01/app/oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 10.2.0.4.9

OUI version : 10.2.0.5.0

OUI location : /u01/app/oracle/product/10.2.0/db_1/oui

Log file location :/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-09_18-35-54PM.log

Patch history file:/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch'8350262' to OH '/u01/app/oracle/product/10.2.0/db_1'

Running prerequisite checks...

OPatch detected non-cluster Oracle Homefrom the inventory and will patch the local system only.

Backing up files and inventory (not forauto-rollback) for the Oracle Home

Backing up files affected by the patch'8350262' for restore. This might take a while...

Backing up files affected by the patch'8350262' for rollback. This might take a while...

Patching componentoracle.sysman.agent.core, 10.2.0.5.0a...

Updating jar file"/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with"/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"

ApplySession adding interim patch '8350262'to inventory

Verifying the update...

Inventory check OK: Patch ID 8350262 isregistered in Oracle Home inventory with proper meta-data.

Files check OK: Files from Patch ID 8350262are present in Oracle Home.

OPatch succeeded.

(4)删除OEM的 dbconsole 和repository

dave:/u01/app/oracle/product/10.2.0/db_1/bin>emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Oct 9, 2011 5:33:12 PM

EM Configuration Assistant, Version10.2.0.5.0 Production

Copyright (c) 2003, 2009, Oracle. All rights reserved.

Enter the following information:

Database SID: anqing

Listener port number: 1521

Password for SYS user:

Password for SYSMAN user:

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

WARNING : While repository is dropped thedatabase will be put in quiesce mode.

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

Do you wish to continue? [yes(Y)/no(N)]: y

Oct 9, 2011 5:33:35 PMoracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/anqing/emca_2011-10-09_05-33-12-PM.log.

Oct 9, 2011 5:33:38 PMoracle.sysman.emcp.util.DBControlUtil stopOMS

INFO: Stopping Database Control (this maytake a while) ...

Oct 9, 2011 5:33:50 PM oracle.sysman.emcp.EMReposConfiginvoke

INFO: Dropping the EM repository (this maytake a while) ...

Oct 9, 2011 5:33:50 PMoracle.sysman.emcp.EMReposConfig dropRepository

INFO: Dropping the EM repository (this maytake a while) ...

Oct 9, 2011 5:35:14 PM oracle.sysman.emcp.EMReposConfiginvoke

INFO: Repository successfully dropped

Enterprise Manager configuration completedsuccessfully

FINISHED EMCA at Oct 9, 2011 5:35:15 PM

--执行用了3分钟

(5)重建EM的dbcontrol 和 repository

dave:/u01/app/oracle/admin/anqing/bdump>emca -config dbcontrol db -repos create

STARTED EMCA at Oct 9, 2011 8:03:22 PM

EM Configuration Assistant, Version10.2.0.5.0 Production

Copyright (c) 2003, 2009, Oracle. All rights reserved.

Enter the following information:

Database SID: anqing

Listener port number: 1521

Password for SYS user:

Password for DBSNMP user:

Password for SYSMAN user:

Email address for notifications (optional):

Outgoing Mail (SMTP) server fornotifications (optional):

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

You have specified the following settings

Database ORACLE_HOME ................/u01/app/oracle/product/10.2.0/db_1

Local hostname ................ dave

Listener port number ................ 1521

Database SID ................ anqing

Email address for notifications...............

Outgoing Mail (SMTP) server fornotifications ...............

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

Do you wish to continue? [yes(Y)/no(N)]: y

Oct 9, 2011 8:03:40 PM oracle.sysman.emcp.EMConfigperform

INFO: This operation is being logged at/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/anqing/emca_2011-10-09_08-03-22-PM.log.

Oct 9, 2011 8:03:44 PMoracle.sysman.emcp.EMReposConfig createRepository

INFO: Creating the EM repository (this maytake a while) ...

Oct 9, 2011 8:06:32 PMoracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully created

Oct 9, 2011 8:06:51 PMoracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Securing Database Control (this maytake a while) ...

Oct 9, 2011 8:08:02 PMoracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Database Control securedsuccessfully.

Oct 9, 2011 8:08:02 PMoracle.sysman.emcp.util.DBControlUtil startOMS

INFO: Starting Database Control (this maytake a while) ...

Oct 9, 2011 8:09:57 PMoracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: Database Control started successfully

Oct 9, 2011 8:09:57 PMoracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO:>>>>>>>>>>> The Database Control URL is https://dave:1158/em<<<<<<<<<<<

Enterprise Manager configuration completedsuccessfully

FINISHED EMCA at Oct 9, 2011 8:09:57 PM

四.打10.2.0.5.4Patch

现在数据库和实例的版本都是10.2.0.5.0的版本,在这个版本的基础上,我们在升级到10.2.0.5.4. Patch NO 是:12419392

4.1 OPatch 版本检测

安装10.2.0.5.4 的Patch,OPatch 的版本至少需要10.2.0.5.4.

You must use theOPatch 10.2 version 10.2.0.5.0 or later to apply this patch. Oracle recommendsthat you use the latest released OPatch 10.2, which is available for downloadfrom My Oracle Support patch6880880byselecting the 10.2.0.0.0 release.

查看现有OPatch 的版本:

dave:/mnt/OracleSoftware/10.2.0.5.4_PSU_p12419392/p12419392_10205_LINUX/12419392>$ORACLE_HOME/OPatch/opatch version

Invoking OPatch 10.2.0.4.9

OPatch Version: 10.2.0.4.9

OPatch succeeded.

这里显示的OPatch的版本低于10.2.0.5。 不能用来安装10.2.0.5.4的patch。 需要从MOS 上下载10.2.0.5的OPatch。Patch NO: 6880880.该Patch 28M。

关于OPatch 工具的更新,参考:

Oracle 更新 OPatch 工具版本 的方法 说明

http://blog.****.net/tianlesoftware/article/details/6857059

4.2 One-off Patch Conflict Detection and Resolution(Patch 冲突检测)

dave:/mnt/OracleSoftware/10.2.0.5.4_PSU_p12419392/p12419392_10205_LINUX>$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir./12419392

Invoking OPatch 10.2.0.4.9

Oracle Interim Patch Installer version10.2.0.4.9

Copyright (c) 2009, OracleCorporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/10.2.0/db_1

Central Inventory :/u01/app/oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 10.2.0.4.9

OUI version : 10.2.0.5.0

OUI location : /u01/app/oracle/product/10.2.0/db_1/oui

Log file location :/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-09_20-23-29PM.log

Patch history file:/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Invoking prereq"checkconflictagainstohwithdetail"

ZOP-40: The patch(es) hasconflicts/supersets with other patches installed in the Oracle Home (or) amongthemselves.

Prereq"checkConflictAgainstOHWithDetail" failed.

Summary of Conflict Analysis:

Patches that can be applied now without anyconflicts are :

12419392

Following patches are not required, as theyare subset of the patches in Oracle Home or subset of the patches in the givenlist :

8350262

Following patches will be rolled back fromOracle Home on application of the patches in the given list :

8350262

Conflicts/Supersets for each patch are:

Patch : 12419392

Bug Superset of 8350262

Super set bugs are:

8350262

OPatch succeeded.

这里提示8350262 与我们要安装的patch 12419392 冲突,而8350262 是我们刚才为了解决EM 问题而打的bug,该bug存在10.2.0.4 和10.2.0.5 版本。 在10.2.0.5.4 中已经修复了该bug。所以这2个bug有冲突。 解决这个问题的方法是rollback 掉8350262。

注意一个问题,从这个问题,发现我们升级的操作步骤有问题。 OEM 我们应该放到最后来重建,这样就不会导致这个问题。 我的文档已经整理好,就不做删除操作。 希望其他同学操作时,注意这个顺序问题。

dave:/mnt/OracleSoftware>cd 10.2.0.4-5_OEM_Bug_p8350262/

dave:/mnt/OracleSoftware/10.2.0.4-5_OEM_Bug_p8350262>export PATH=$PATH:$ORACLE_HOME/OPatch

dave:/mnt/OracleSoftware/10.2.0.4-5_OEM_Bug_p8350262>opatch rollback -id 8350262

Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version10.2.0.5.1

Copyright (c) 2010, OracleCorporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/10.2.0/db_1

Central Inventory :/u01/app/oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 10.2.0.5.1

OUI version : 10.2.0.5.0

OUI location : /u01/app/oracle/product/10.2.0/db_1/oui

Log file location :/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-09_21-33-24PM.log

Patch history file:/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

RollbackSession rolling back interim patch'8350262' from OH '/u01/app/oracle/product/10.2.0/db_1'

Running prerequisite checks...

OPatch detected non-cluster Oracle Homefrom the inventory and will patch the local system only.

Backing up files affected by the patch'8350262' for restore. This might take a while...

Patching componentoracle.sysman.agent.core, 10.2.0.5.0a...

Updating jar file"/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with"/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_13_2010_14_09_12/files//sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"

Updating jar file"/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with"/u01/app/oracle/product/10.2.0/db_1/.patch_storage/8350262_Sep_13_2010_14_09_12/files//sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"

RollbackSession removing interim patch'8350262' from inventory

OPatch succeeded.

在次检测,通过:

dave:/mnt/OracleSoftware/10.2.0.5.4_PSU_p12419392/p12419392_10205_LINUX>$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir./12419392

Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version10.2.0.5.1

Copyright (c) 2010, OracleCorporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/10.2.0/db_1

Central Inventory :/u01/app/oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 10.2.0.5.1

OUI version : 10.2.0.5.0

OUI location : /u01/app/oracle/product/10.2.0/db_1/oui

Log file location :/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-09_21-34-40PM.log

Patch history file:/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Invoking prereq"checkconflictagainstohwithdetail"

Prereq"checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

4.3 安装Patch

dave:/mnt/OracleSoftware/10.2.0.5.4_PSU_p12419392/p12419392_10205_LINUX/12419392>opatch apply

Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version10.2.0.5.1

Copyright (c) 2010, OracleCorporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/10.2.0/db_1

Central Inventory :/u01/app/oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 10.2.0.5.1

OUI version : 10.2.0.5.0

OUI location : /u01/app/oracle/product/10.2.0/db_1/oui

Log file location :/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-09_21-36-53PM.log

Patch history file:/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch'12419392' to OH '/u01/app/oracle/product/10.2.0/db_1'

Running prerequisite checks...

Prerequisite check "CheckActiveFilesAndExecutables"failed.

The details are:

Following executables are active :

/u01/app/oracle/product/10.2.0/db_1/bin/oracle

ApplySession failed during prerequisitechecks: Prerequisite check "CheckActiveFilesAndExecutables" failed.

System intact, OPatch will not attempt torestore the system

OPatch failed with error code 74

报错:

ApplySession failed during prerequisitechecks: Prerequisite check "CheckActiveFilesAndExecutables" failed.

有活动的文件存在,该Patch 的安装文档上并没有提到需要关闭监听和实例。 不过从这个错误提示来看,是需要关闭监听和实例的。

dave:/> lsnrctl stop

LSNRCTL for Linux: Version 10.2.0.5.0 -Production on 09-OCT-2011 21:45:32

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

Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))

The command completed successfully

dave:/> emctl stop dbconsole

TZ set to PRC

Oracle Enterprise Manager 10g DatabaseControl Release 10.2.0.5.0

Copyright (c) 1996, 2010 OracleCorporation. All rights reserved.

https://dave:1158/em/console/aboutApplication

Stopping Oracle Enterprise Manager 10gDatabase Control ...

...Stopped.

dave:/> sqlplus / as sysdba;

SQL*Plus: Release 10.2.0.5.0 - Productionon Sun Oct 9 21:46:10 2011

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

Connected to:

Oracle Database 10g Enterprise EditionRelease 10.2.0.5.0 - Production

With the Partitioning, OLAP, Data Miningand Real Application Testing options

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> exit

Disconnected from Oracle Database 10g EnterpriseEdition Release 10.2.0.5.0 - Production

With the Partitioning, OLAP, Data Miningand Real Application Testing options

dave:/>

关闭监听,EM和instance 之后,在打Patch。 可以正常安装Patch了。 Oracle 的文档也有不靠谱的时候。

dave:/mnt/OracleSoftware/10.2.0.5.4_PSU_p12419392/p12419392_10205_LINUX/12419392>opatch apply

Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version10.2.0.5.1

Copyright (c) 2010, OracleCorporation. All rights reserved.

Oracle Home : /u01/app/oracle/product/10.2.0/db_1

Central Inventory :/u01/app/oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 10.2.0.5.1

OUI version : 10.2.0.5.0

OUI location : /u01/app/oracle/product/10.2.0/db_1/oui

Log file location :/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-09_21-46-56PM.log

Patch history file:/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

ApplySession applying interim patch'12419392' to OH '/u01/app/oracle/product/10.2.0/db_1'

Running prerequisite checks...

Patch 12419392: Optional component(s)missing : [ oracle.rdbms.dv, 10.2.0.5.0 ] , [ oracle.rdbms.dv.oc4j, 10.2.0.5.0]

Provide your email address to be informedof security issues, install and

initiate Oracle Configuration Manager.Easier for you if you use your My

Oracle Support Email address/User Name.

Visithttp://www.oracle.com/support/policies.html for details.

Email address/User Name:

You have not provided an email address fornotification of security issues.

Do you wish to remain uninformed ofsecurity issues ([Y]es, [N]o) [N]: y

OPatch detected non-cluster Oracle Homefrom the inventory and will patch the local system only.

Please shutdown Oracle instances runningout of this ORACLE_HOME on the local system.

(Oracle Home ='/u01/app/oracle/product/10.2.0/db_1')

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'12419392' for restore. This might take a while...

Backing up files affected by the patch'12419392' for rollback. This might take a while...

Execution of 'sh /mnt/OracleSoftware/10.2.0.5.4_PSU_p12419392/p12419392_10205_LINUX/12419392/custom/scripts/pre-apply 12419392 ':

Return Code = 0

Patching component oracle.rdbms,10.2.0.5.0...

Updating archive file"/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a" with "lib/libserver10.a/kcbl.o"

…..

Updating jar file"/u01/app/oracle/product/10.2.0/db_1/sysman/jlib/emjsp.jar" with"/sysman/jlib/emjsp.jar/_database/_dbObjectsList.class"

Copying file to"/u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/oc4j_applications/applications/em/em/admin/rep/editUserSummary.uix"

Patching component oracle.xdk.rsf,10.2.0.5.0...

Updating archive file"/u01/app/oracle/product/10.2.0/db_1/lib/libxml10.a" with "lib/libxml10.a/lpxpar.o"

Patching component oracle.precomp.common,10.2.0.5.0...

Patching component oracle.rdbms.rman,10.2.0.5.0...

Running make for target client_sharedlib

Running make for target ioracle

Running make for target iwrap

Running make for target client_sharedlib

Running make for target proc

Running make for target irman

ApplySession adding interim patch'12419392' to inventory

Verifying the update...

Inventory check OK: Patch ID 12419392 isregistered in Oracle Home inventory with proper meta-data.

Files check OK: Files from Patch ID12419392 are present in Oracle Home.

The local system has been patched and canbe restarted.

OPatch succeeded.

成功安装。 不过还有一些后续的工作需要处理。

4.4 后续工作

4.4.1 再次进行patch的冲突检测

dave:/mnt/OracleSoftware/10.2.0.5.4_PSU_p12419392/p12419392_10205_LINUX>$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir./12419392

Invoking OPatch 10.2.0.5.1

Oracle Interim Patch Installer version10.2.0.5.1

Copyright (c) 2010, OracleCorporation. All rights reserved.

PREREQ session

Oracle Home : /u01/app/oracle/product/10.2.0/db_1

Central Inventory :/u01/app/oracle/oraInventory

from : /etc/oraInst.loc

OPatch version : 10.2.0.5.1

OUI version : 10.2.0.5.0

OUI location : /u01/app/oracle/product/10.2.0/db_1/oui

Log file location :/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-10-09_21-52-52PM.log

Patch history file:/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txt

Invoking prereq"checkconflictagainstohwithdetail"

ZOP-47: The patch(es) has supersets withother patches installed in the Oracle Home (or) among themselves.

Prereq"checkConflictAgainstOHWithDetail" failed.

Summary of Conflict Analysis:

Patches that can be applied now without anyconflicts are :

12419392

Following patches will be rolled back fromOracle Home on application of the patches in the given list :

12419392

Conflicts/Supersets for each patch are:

Patch : 12419392

Bug Superset of 12419392

Super set bugs are:

6402302, 10269717, 10327190,8865718, 10017048, 9024850,8394351, 8546356, 9360157,9770451, 9020537, 9772888,8664189, 10091698, 12551710,7519406, 10132870, 8771916,9109487, 10173237, 10068982,8350262, 11792865, 11724962,11725006, 9184754, 8544696,9320130, 7026523, 8277300,9726739, 8412426, 12419392,6651220, 9150282, 9659614,9949948, 10327179, 8882576,7612454, 9711859, 9714832,10248542, 9952230, 9469117,9952270, 8660422, 10324526,12419258, 9713537, 10010310,9390484, 9963497, 12551700,12551701, 10249537, 12551702,12551703, 8211733, 12551704,9548269, 12551705, 12551706,9337325, 12551707, 7602341,12551708, 9308296, 10157402,11737047

OPatch succeeded.

4.4.2 Loading Modified SQL Files into the Database

dave:/u01/app/oracle/product/10.2.0/db_1/rdbms/admin>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.5.0 - Productionon Sun Oct 9 21:55:05 2011

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

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 377487360 bytes

Fixed Size 1273804 bytes

Variable Size 130023476 bytes

Database Buffers 243269632 bytes

Redo Buffers 2920448 bytes

Database mounted.

Database opened.

--loading modified SQL files

SQL> @?/rdbms/admin/catbundle.sqlpsu apply

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Generating apply and rollback scripts...

Check the following file for errors:

/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/catbundle/catbundle_PSU_ANQING_GENERATE_2011Oct09_21_55_33.log

…..

Commit complete.

Check the following log file for errors:

/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/catbundle/catbundle_PSU_ANQING_APPLY_2011Oct09_21_55_39.log

--编译无效对象

SQL> @?/rdbms/admin/utlrp.sql

至此所有的升级操作结束。

五.检查组件版本信息

SQL> select * from v$version;

BANNER

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

Oracle Database 10g Enterprise EditionRelease 10.2.0.5.0 - Prod

PL/SQL Release 10.2.0.5.0 - Production

CORE10.2.0.5.0 Production

TNS for Linux: Version 10.2.0.5.0 -Production

NLSRTL Version 10.2.0.5.0 - Production

SQL> SELECT COMP_NAME, VERSION, STATUSFROM SYS.DBA_REGISTRY;

COMP_NAME VERSION STATUS

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

Oracle Enterprise Manager 10.2.0.5.0 VALID

Spatial10.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

COMP_NAME VERSION STATUS

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

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

17 rows selected.

这里版本的信息并没有变化,有一点可以确认的是我们已经打上了10.2.0.5.4 的Patch。 关于这个问题,MOS的文档[ID: 861152.1] 有说明:

DoPatchset Updates (PSU's) Change the Oracle Release Version/Fifth Digit? [ID861152.1]

http://blog.****.net/tianlesoftware/article/details/6858053

The PSUi.e 10.2.0.4.x/10.2.0.5.x , 11.1.0.7.x and11.2.0.1.x/11.2.0.2.xreleased for Oracle Database Server version10.2.0.4.0/10.2.0.5.x , 11.1..0.7.0and 11.2.0.1.0/11.2.0.2.0respectively does NOT change the databaseversion .ThatmeansPSU 10.2.0.4.x /10.2.0.5.x, 11.1.0.7.x,11.2.0.1.x /11.2.0.2.x( where x is the fifth digit ) does NOT change the 5thdigit of the OracleDatabase Server version.

After applyingthe PSU 10.2.0.4.x/10.2.0.5.x ,11.1.0.7.x,11.2.0.1.x/11.2.0.2.x"opatch lsinventory"still shows theversion as10.2.0.4.0/10.2.0.5.0 for Oracle 10g R2, 11.1.0.7 for Oracle 11gR1 and11.2.0.1 /11.2.0.2 for Oracle 11g R2

PSU'salsowillnotchange the version of oracle binaries (likesqlplus, exp/imp etc.)

Note : It isalso applicable for the Oracle Enterprise ManagerGrid Control and EMAgent

文档里提供了三种方法查看打了PSU之后的版本:

(1)通过OPatch 版本:

dave:/home/oracle>$ORACLE_HOME/OPatch/opatch version

Invoking OPatch 10.2.0.5.1

OPatch Version: 10.2.0.5.1

OPatch succeeded.

这个不太靠谱。因为这个OPatch是我们自己更新的。

(2)验证PSU

dave:/home/oracle> $ORACLE_HOME/OPatch/opatch lsinv -bugs_fixed|grep PSU

995223012419392 Sun Oct 09 21:49:39 CST2011 DATABASE PSU 10.2.0.5.1 (INCLUDESCPUOCT2010)

1024854212419392 Sun Oct 09 21:49:39 CST2011 DATABASE PSU 10.2.0.5.2 (INCLUDESCPUJAN2011)

1172496212419392 Sun Oct 09 21:49:39 CST2011 DATABASE PSU 10.2.0.5.3 (INCLUDESCPUAPR2011)

1241939212419392 Sun Oct 09 21:49:39 CST2011 DATABASE PSU 10.2.0.5.4 (INCLUDESCPUJUL2011)

这个命令可以看出我们的PSU版本,这里确实是10.2.0.5.4

(3)Verify the PSU Post Install steps were run in theDB

SQL> selectsubstr(action_time,1,30)action_time,

2 substr(id,1,10) id,

3 substr(action,1,10) action,

4 substr(version,1,8) version,

5 substr(BUNDLE_SERIES,1,6)bundle,

6 substr(comments,1,20) comments

7 from registry$history;


ACTION_TIME ID ACTION VERSION BUNDLECOMMENTS

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

09-OCT-11 04.52.54.436948 PM 8289601 VIEW RECOM view recompilation

09-OCT-11 04.52.54.603388 PM UPGRADE 10.2.0.5 Upgraded from 10.2.0

09-OCT-11 09.55.50.869894 PM 4APPLY 10.2.0.5 PSUPSU 10.2.0.5.4

10-OCT-11 12.20.41.197612 AM 8289601VIEW RECOMview recompilation

10-OCT-11 12.20.41.292160 AM UPGRADE 10.2.0.5 Upgraded from 10.2.0

10-OCT-11 12.22.56.184854 AM 4APPLY 10.2.0.5 PSUPSU 10.2.0.5.4

10-OCT-11 08.57.22.100941 AM 4APPLY 10.2.0.5 PSUPSU 10.2.0.5.4


7 rows selected.

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

Blog: http://blog.****.net/tianlesoftware

Weibo: http://weibo.com/tianlesoftware

Email: [email protected]

DBA1 群:62697716(满); DBA2 群:62697977(满)DBA3 群:62697850(满)

DBA 超级群:63306533(满); DBA4 群:83829929(满) DBA5群: 142216823(满)

DBA6 群:158654907(满) DBA7 群:69087192(满)DBA8 群:172855474

DBA 超级群2:151508914 DBA9群:102954821 聊天 群:40132017(满)

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请