Oracle案例:tar安装数据库并从10.2.0.4.8升级到10.2.0.4.9

news/2025/10/28 17:01:10/文章来源:https://www.cnblogs.com/www-htz-pw/p/19172239

我们的文章会在微信公众号IT民工的龙马人生和博客网站( www.htz.pw )同步更新 ,欢迎关注收藏,也欢迎大家转载,但是请在文章开始地方标注文章出处,谢谢!
由于博客中有大量代码,通过页面浏览效果更佳。

Oracle案例:tar安装数据库并从10.2.0.4.8升级到10.2.0.4.9

   今天同事说tar安装的数据库在做打补丁的时候会出时候,原来还真没有注意过,一般tar安装的数据库,都是已经打好了补丁的。个人觉得他说的出问题,应该是指tar过来后,数据库使用的relink方式来编译了一次,而没有使用clone或者oui的方式来安装,在环境一样的时候,很多时候我们都只用了relink方式,这个要方便一些,下面的测试环境是

OS:RHEL 4.8 TO RHEL 5.4 OS:10.2.0.4.8 to 10.2.0.4.9

测试结果是能正常打补丁,也能正常回退。

1,源环境tar软件,建议使用root用户来tar包,我的环境,源环境与目标环境,存在OS版本不一样,用户的名字与id都不一样。

[root@rhel4 product]# pwd
/u01/app/oracle/product
[root@rhel4 product]# tar -czvf /soft/test.tar.gz 10.2.0

2,目标库上安装数据库

2.1 系统环境准备,由于这里只是测试,所以部分参数配置不合理

groupadd -g 500 dba
groupadd -g 501 oinstall 
useradd -u 500 -g dba -G oinstall oracle
echo "oracle"|passwd oracle --stdinecho "kernel.shmmni = 4096 
kernel.sem = 250 32000 100 128 
fs.file-max = 65536 
net.ipv4.ip_local_port_range = 1024 65000 
net.core.rmem_default = 262144 
net.core.rmem_max = 262144 
net.core.wmem_default = 262144 
net.core.wmem_max = 262144 
net.ipv4.tcp_wmem = 262144 262144 262144
net.ipv4.tcp_rmem = 262144 262144 262144">>/etc/sysctl.conf/etc/security/limits.conf
echo "oracle soft memlock 5242880
oracle hard memlock 524280
oracle soft nproc 2047 
oracle hard nproc 16384
oracle soft nofile 65536 
oracle hard nofile 65536">> /etc/security/limits.confecho "session     required      pam_limits.so">>/etc/pam.d/loginexport PATH
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db
export ORA_CRS_HOME=$ORACLE_BASE/product/10.2.0/crs
export ORACLE_SID=rac1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:$PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/lib32:$CRS_HOME/lib32:$ORA_CRS_HOME/lib32
export DISPLAY=192.168.100.1:0.0
set -o vi
stty erase ^h[root@vxvm db_1]# tail -1 /etc/hosts
192.168.111.43 vxvm.htz.pw

2.2 修改文件的权限

[root@vxvm oracle]#  find . -group 210 -exec chgrp dba {} \;
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libicuuc.so.26': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libXML4CMessages.so.54': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libicudata.so': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libxml4c.so': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libXML4CMessages.so': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libxml4c.so.54': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libicuuc.so': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/ctx/lib/libicudata.so.26': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/bin/lbuilder': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/lib/liborasdkbase.so': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/lib/liborasdk.so': No such file or directory
chgrp: changing group of `./produce/10.2.0/db_1/lib32/ldflags': No such file or directory
[root@vxvm oracle]#  find . -user 211 -exec chown oracle  {} \;
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libicuuc.so.26': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libXML4CMessages.so.54': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libicudata.so': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libxml4c.so': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libXML4CMessages.so': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libxml4c.so.54': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libicuuc.so': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/ctx/lib/libicudata.so.26': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/bin/lbuilder': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/lib/liborasdkbase.so': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/lib/liborasdk.so': No such file or directory
chown: changing ownership of `./produce/10.2.0/db_1/lib32/ldflags': No such file or directory[root@vxvm app]# chmod 777 oracle
[root@vxvm app]# ls -lrt
total 4
drwxrwxrwx 3 root root 4096 Jun  4 15:21 oracle
[root@vxvm app]# pwd
/u01/app

2.3 修改oracle用户组

[oracle@vxvm ~]$ cd $ORACLE_HOME/rdbms/lib
[oracle@vxvm lib]$ pwd
/u01/app/oracle/product/10.2.0/db_1/rdbms/lib[oracle@vxvm lib]$ mv config.o config.o_backup
[oracle@vxvm lib]$  vi config.c
/*  SS_DBA_GRP defines the UNIX group ID for adminstrative access.  */
/*  Refer to the Installation and User's Guide for further information.  */#define SS_DBA_GRP "dba"
#define SS_OPER_GRP "dba"char *ss_dba_grp[] = {SS_DBA_GRP, SS_OPER_GRP};

2.4 编译oracle

[oracle@vxvm lib]$ make -f ins_rdbms.mk config.o
/usr/bin/gcc  -O3  -trigraphs -fPIC -I/u01/app/oracle/product/10.2.0/db_1/rdbms/demo -I/u01/app/oracle/product/10.2.0/db_1/rdbms/public -I/u01/app/oracle/product/10.2.0/db_1/plsql/public -I/u01/app/oracle/product/10.2.0/db_1/network/public -DLINUX -DORAX86_64 -D_GNU_SOURCE -D_LARGEFILE64_SOURCE=1 -D_LARGEFILE_SOURCE=1 -DSLTS_ENABLE -DSLMXMX_ENABLE -D_REENTRANT -DNS_THREADS -DLONG_IS_64 -fno-strict-aliasing -DSS_64BIT_SERVER      -c -o config.o config.c
[oracle@vxvm lib]$ make -f ins_rdbms.mk ioracle
chmod 755 /u01/app/oracle/product/10.2.0/db_1/bin- Linking Oracle 
rm -f /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/oracle
gcc  -o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/oracle -L/u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ -L/u01/app/oracle/product/10.2.0/db_1/lib/ -L/u01/app/oracle/product/10.2.0/db_1/lib/stubs/   -Wl,-E `test -f /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/sskgpsmti.o && echo /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/sskgpsmti.o` /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/opimai.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ssoraed.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/ttcsoi.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/defopt.o  -Wl,--whole-archive -lperfsrv10 -Wl,--no-whole-archive /u01/app/oracle/product/10.2.0/db_1/lib/nautab.o /u01/app/oracle/product/10.2.0/db_1/lib/naeet.o /u01/app/oracle/product/10.2.0/db_1/lib/naect.o /u01/app/oracle/product/10.2.0/db_1/lib/naedhs.o /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/config.o  -lserver10 -lodm10 -lnnet10 -lskgxp10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lhasgen10 -lcore10 -lskgxn2 -locr10 -locrb10 -locrutl10 -lhasgen10 -lcore10 -lskgxn2   -lclient10  -lvsn10 -lcommon10 -lgeneric10 -lknlopt `if /usr/bin/ar tv /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/libknlopt.a | grep xsyeolap.o > /dev/null 2>&1 ; then echo "-loraolap10" ; fi` -lslax10 -lpls10  -lplp10 -lserver10 -lclient10  -lvsn10 -lcommon10 -lgeneric10 `if [ -f /u01/app/oracle/product/10.2.0/db_1/lib/libavserver10.a ] ; then echo "-lavserver10" ; else echo "-lavstub10"; fi` `if [ -f /u01/app/oracle/product/10.2.0/db_1/lib/libavclient10.a ] ; then echo "-lavclient10" ; fi` -lknlopt -lslax10 -lpls10  -lplp10 -ljox10 -lserver10 -lclsra10 -ldbcfg10 -locijdbcst10 -lwwg  `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lmm -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/product/10.2.0/db_1/lib/ldflags`    -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10   -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `if /usr/bin/ar tv /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/libknlopt.a | grep "kxmnsd.o" > /dev/null 2>&1 ; then echo " " ; else echo "-lordsdo10"; fi` -lctxc10 -lctx10 -lzx10 -lgx10 -lctx10 -lzx10 -lgx10 -lordimt10 -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lsnls10 -lunls10  -lsnls10 -lnls10  -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -laio    `cat /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/product/10.2.0/db_1/lib -lm    `cat /u01/app/oracle/product/10.2.0/db_1/lib/sysliblist` -ldl -lm   -L/u01/app/oracle/product/10.2.0/db_1/lib
/u01/app/oracle/product/10.2.0/db_1/lib//libcore10.a(lcd.o): In function `lcdprm':
lcd.c:(.text+0xb71): warning: the `gets' function is dangerous and should not be used.
mv -f /u01/app/oracle/product/10.2.0/db_1/bin/oracle /u01/app/oracle/product/10.2.0/db_1/bin/oracleO
mv /u01/app/oracle/product/10.2.0/db_1/rdbms/lib/oracle /u01/app/oracle/product/10.2.0/db_1/bin/oracle
chmod 6751 /u01/app/oracle/product/10.2.0/db_1/bin/oracle

2.5 创建/etc/oraInst.loc

[root@vxvm soft]# cat /etc/oraInst.loc
inventory_loc=/u01/app/oracle/oraInventory

2.6 克隆安装数据库软件

[oracle@vxvm bin]$ cd $ORACLE_HOME/clone/bin
[oracle@vxvm bin]$ mkdir /u01/app/oracle/oraInventory
[oracle@vxvm bin]$ perl clone.pl ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME="OraDbName10gr2" 
./runInstaller -silent -clone -waitForCompletion  "ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1" "ORACLE_HOME_NAME=OraDbName10gr2" -noConfig -nowait 
Starting Oracle Universal Installer...No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-06-04_03-28-19PM. Please wait ...Oracle Universal Installer, Version 10.2.0.4.0 Production
Copyright (C) 1999, 2008, Oracle. All rights reserved.You can find a log of this install session at:/u01/app/oracle/oraInventory/logs/cloneActions2013-06-04_03-28-19PM.log[oracle@vxvm bin]$ perl clone.pl ORACLE_HOME=$ORACLE_HOME ORACLE_HOME_NAME="OraDbName10gr2" 
./runInstaller -silent -clone -waitForCompletion  "ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1" "ORACLE_HOME_NAME=OraDbName10gr2" -noConfig -nowait 
Starting Oracle Universal Installer...No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2013-06-04_03-28-19PM. Please wait ...Oracle Universal Installer, Version 10.2.0.4.0 Production
Copyright (C) 1999, 2008, Oracle. All rights reserved.You can find a log of this install session at:/u01/app/oracle/oraInventory/logs/cloneActions2013-06-04_03-28-19PM.log
.................................................................................................... 100% Done.Installation in progress (Tuesday, June 4, 2013 3:28:38 PM CST)
..........................................................................                                                      74% Done.
Install successfulLinking in progress (Tuesday, June 4, 2013 3:28:47 PM CST)Link successfulSetup in progress (Tuesday, June 4, 2013 3:32:42 PM CST)
Setup successfulEnd of install phases.(Tuesday, June 4, 2013 3:32:53 PM CST)
WARNING:
The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/u01/app/oracle/product/10.2.0/db_1/root.sh
To execute the configuration scripts:1. Open a terminal window2. Log in as "root"3. Run the scriptsThe cloning of OraDbName10gr2 was successful.
Please check '/u01/app/oracle/oraInventory/logs/cloneActions2013-06-04_03-28-19PM.log' for more details.

在root用户下面执行root.sh脚本

2.7 dbca创建数据库

[oracle@vxvm bin]$ export DISPLAY=192.168.111.1:0.0
[oracle@vxvm bin]$ dbca

dbca创建数据库成功

3、开始升级

3.1 查看现在的版本

[oracle@vxvm OPatch]$ ./opatch lsinventory
Invoking OPatch 10.2.0.5.1Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventoryfrom           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.4.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/opatch2013-06-04_15-41-55PM.logPatch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txtLsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2013-06-04_15-41-55PM.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 (2) :Patch  11724977     : applied on Mon Jan 07 13:44:17 CST 2013
Unique Patch ID:  13596298Created on 25 Mar 2011, 23:17:54 hrs PST8PDTBugs fixed:9713537, 9655017, 9573054, 9654991, 9714832, 11725015, 10014012, 1178776211787763, 11787764, 10249540, 10014015, 11724977, 11787765, 117877669952234, 9442335, 10014009, 11787767, 10248636, 10325885, 1001397510325878, 9173248, 8309642, 9678690, 7609058, 9952272, 9678695, 9678697This patch overlays patches:9352164This patch needs patches:9352164as prerequisites

数据库的版本是10.2.0.4.8,现在升级到10.2.0.4.9看报错不。

3.2 把软件解压到/tmp/目录

[oracle@vxvm 12419397]$ pwd
/tmp/12419397

3.3 停数据库与监听,如果有em这些也要停

[oracle@vxvm 12419397]$ export ORACLE_SID=test
[oracle@vxvm 12419397]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.4.0 - Production on Tue Jun 4 15:45:29 2013Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionswww.htz.pw >shutdown abort;
ORACLE instance shut down.

3.3到补丁目录,开始opatch apply

[oracle@vxvm 12419397]$ /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch apply
Invoking OPatch 10.2.0.5.1Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventoryfrom           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.4.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/opatch2013-06-04_15-45-57PM.logPatch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txtApplySession applying interim patch '12419397' to OH '/u01/app/oracle/product/10.2.0/db_1'
Interim patch 12419397 is a superset of the patch(es) [  11724977 ] in the Oracle Home
OPatch will rollback the subset patches and apply the given patch.Running prerequisite checks...
Patch 12419397: Optional component(s) missing : [ oracle.rdbms.dv, 10.2.0.4.0 ] , [ oracle.rdbms.dv.oc4j, 10.2.0.4.0 ] 
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]:  N
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]:  YOPatch 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/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 '12419397' for restore. This might take a while...
Backing up files affected by the patch '11724977' for restore. This might take a while...
ApplySession rolling back interim patch '11724977' from OH '/u01/app/oracle/product/10.2.0/db_1'
Execution of 'sh /u01/app/oracle/product/10.2.0/db_1/.patch_storage/11724977_Mar_25_2011_23_17_54/original_patch/custom/scripts/pre -rollback 11724977 ':Return Code = 0Patching component oracle.rdbms, 10.2.0.4.0...
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kwqit.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kkzl.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kkxe.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kpolon.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kkxs.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kza.o"
Updating archive file "/u01/app/oracle/product/10.2.0/db_1/lib/libserver10.a"  with "lib/libserver10.a/kzvdve.o"
Deleting file "/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/bundledata_OPSU.xml"...................................................
Running make for target itnslsnr
Running make for target client_sharedlib
ApplySession adding interim patch '12419397' to inventoryVerifying the update...
Inventory check OK: Patch ID 12419397 is registered in Oracle Home inventory with proper meta-data.
Files check OK: Files from Patch ID 12419397 are present in Oracle Home.The local system has been patched and can be restarted.--------------------------------------------------------------------------------
The following warnings have occurred during OPatch execution:
1) OUI-67620:Interim patch 12419397 is a superset of the patch(es) [  11724977 ] in the Oracle Home
--------------------------------------------------------------------------------
OPatch Session completed with warnings.OPatch completed with warnings.

3.4 运行catbundle.sql

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle.sql opsu apply
SQL> @utlrp.sql
SQL> QUITwww.htz.pw >select * from dba_registry_history2  ;ACTION_TIME                    ACTION     NAMESPACE  VERSION            ID BUNDLE_SERIES   COMMENTS
------------------------------ ---------- ---------- ---------- ---------- --------------- ------------------------------
04-JUN-13 03.56.09.350649 PM   APPLY      SERVER     10.2.0.4            5 OPSU            PSU 10.2.0.4.91 row selected.www.htz.pw >select comp_name, version, status from sys.dba_registry2  ;COMP_NAME                                          VERSION    STATUS
-------------------------------------------------- ---------- ----------------------
Oracle Database Catalog Views                      10.2.0.4.0 VALID
Oracle Database Packages and Types                 10.2.0.4.0 VALID
Oracle Workspace Manager                           10.2.0.4.3 VALID
JServer JAVA Virtual Machine                       10.2.0.4.0 VALID
Oracle XDK                                         10.2.0.4.0 VALID
Oracle Database Java Packages                      10.2.0.4.0 VALID
Oracle Expression Filter                           10.2.0.4.0 VALID
Oracle Data Mining                                 10.2.0.4.0 VALID
Oracle Text                                        10.2.0.4.0 VALID
Oracle XML Database                                10.2.0.4.0 VALID
Oracle Rules Manager                               10.2.0.4.0 VALID
Oracle interMedia                                  10.2.0.4.0 VALID
OLAP Analytic Workspace                            10.2.0.4.0 VALID
Oracle OLAP API                                    10.2.0.4.0 VALID
OLAP Catalog                                       10.2.0.4.0 VALID
Spatial                                            10.2.0.4.0 VALID
Oracle Enterprise Manager                          10.2.0.4.0 VALID

3.5 编译对象

[oracle@vxvm ~]$ cd $ORACLE_HOME/cpu/view_recompile
[oracle@vxvm view_recompile]$ sqlplus / as sysdbaSQL*Plus: Release 10.2.0.4.0 - Production on Tue Jun 4 17:21:50 2013Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing optionswww.htz.pw >@recompile_precheck_jan2008cpu.sqlRunning precheck.sql...Number of views to be recompiled :2062
-----------------------------------------------------------------------Number of objects to be recompiled :4149
Please follow the README.txt instructions for running viewrecomp.sqlPL/SQL procedure successfully completed.www.htz.pw >shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
www.htz.pw >startup upgrade
ORACLE instance started.Total System Global Area  285212672 bytes
Fixed Size                  2083368 bytes
Variable Size             117442008 bytes
Database Buffers          159383552 bytes
Redo Buffers                6303744 bytes
Database mounted.
Database opened.
www.htz.pw >@view_recompile_jan2008cpu.sql
www.htz.pw >@view_recompile_jan2008cpu.sqlPL/SQL procedure successfully completed.PL/SQL procedure successfully completed.PL/SQL procedure successfully completed.1 row created.Commit complete.No. of Invalid Objects is :244
Please refer to README.html to for instructions on validating these objectsPL/SQL procedure successfully completed.Logfile for the current viewrecomp.sql session is : vcomp_TEST_04Jun2013_17_23_18.log
www.htz.pw >shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
www.htz.pw >startup
ORACLE instance started.Total System Global Area  285212672 bytes
Fixed Size                  2083368 bytes
Variable Size             138413528 bytes
Database Buffers          138412032 bytes
Redo Buffers                6303744 bytes
Database mounted.
Database opened.

3.6 无效对象

www.htz.pw >@?/rdbms/admin/utlrpTIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_BGN  2013-06-04 17:31:20DOC>   The following PL/SQL block invokes UTL_RECOMP to recompile invalid
DOC>   objects in the database. Recompilation time is proportional to the
DOC>   number of invalid objects in the database, so this command may take
DOC>   a long time to execute on a database with a large number of invalid
DOC>   objects.
DOC>
DOC>   Use the following queries to track recompilation progress:
DOC>
DOC>   1. Query returning the number of invalid objects remaining. This
DOC>      number should decrease with time.
DOC>         SELECT COUNT(*) FROM obj$ WHERE status IN (4, 5, 6);
DOC>
DOC>   2. Query returning the number of objects compiled so far. This number
DOC>      should increase with time.
DOC>         SELECT COUNT(*) FROM UTL_RECOMP_COMPILED;
DOC>
DOC>   This script automatically chooses serial or parallel recompilation
DOC>   based on the number of CPUs available (parameter cpu_count) multiplied
DOC>   by the number of threads per CPU (parameter parallel_threads_per_cpu).
DOC>   On RAC, this number is added across all RAC nodes.
DOC>
DOC>   UTL_RECOMP uses DBMS_SCHEDULER to create jobs for parallel
DOC>   recompilation. Jobs are created without instance affinity so that they
DOC>   can migrate across RAC nodes. Use the following queries to verify
DOC>   whether UTL_RECOMP jobs are being created and run correctly:
DOC>
DOC>   1. Query showing jobs created by UTL_RECOMP
DOC>         SELECT job_name FROM dba_scheduler_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>
DOC>   2. Query showing UTL_RECOMP jobs that are running
DOC>         SELECT job_name FROM dba_scheduler_running_jobs
DOC>            WHERE job_name like 'UTL_RECOMP_SLAVE_%';
DOC>#PL/SQL procedure successfully completed.TIMESTAMP
--------------------------------------------------------------------------------
COMP_TIMESTAMP UTLRP_END  2013-06-04 17:32:03PL/SQL procedure successfully completed.DOC> The following query reports the number of objects that have compiled
DOC> with errors (objects that compile with errors have status set to 3 in
DOC> obj$). If the number is higher than expected, please examine the error
DOC> messages reported with each object (using SHOW ERRORS) to see if they
DOC> point to system misconfiguration or resource constraints that must be
DOC> fixed before attempting to recompile these objects.
DOC>#OBJECTS WITH ERRORS
-------------------0DOC> The following query reports the number of errors caught during
DOC> recompilation. If this number is non-zero, please query the error
DOC> messages in the table UTL_RECOMP_ERRORS to see if any of these errors
DOC> are due to misconfiguration or resource constraints that must be
DOC> fixed before objects can compile successfully.
DOC>#ERRORS DURING RECOMPILATION
---------------------------0PL/SQL procedure successfully completed.

升级成功,没有出现报错。

4、回退过程

4.1 停数据库,停监听,停EM

www.htz.pw >shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

4.2 回退软件部分

[oracle@vxvm 12419397]$ /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch rollback -id 12419397
..............................
Patching component oracle.sysman.repository.db, 10.2.0.4.0...
Copying file to "/u01/app/oracle/product/10.2.0/db_1/sysman/admin/emdrep/sql/db/latest/eml/eml_pkgbodys.sql"
Copying file to "/u01/app/oracle/product/10.2.0/db_1/sysman/admin/emdrep/sql/db/latest/eml/eml_pkgdefs.sql"
Copying file to "/u01/app/oracle/product/10.2.0/db_1/sysman/admin/emdrep/sql/db/latest/policy/default_policy_setup.sql"
Running make for target ioracle
Running make for target client_sharedlib
Running make for target itnslsnr
Running make for target client_sharedlib
RollbackSession removing interim patch '12419397' from inventoryThe local system has been patched and can be restarted.

4.3 回退数据库与无效对象编译

cd $ORACLE_HOME/rdbms/admin
sqlplus /nolog
SQL> CONNECT / AS SYSDBA
SQL> STARTUP
SQL> @catbundle_OPSU_TEST_ROLLBACK.sql
SQL> @utlrp.sql
SQL> QUITOPatch succeeded.www.htz.pw >select * from dba_registry_history;ACTION_TIME                    ACTION     NAMESPACE  VERSION            ID BUNDLE_SERIES   COMMENTS
------------------------------ ---------- ---------- ---------- ---------- --------------- ------------------------------
04-JUN-13 03.56.09.350649 PM   APPLY      SERVER     10.2.0.4            5 OPSU            PSU 10.2.0.4.9
04-JUN-13 05.24.28.814302 PM   CPU                                 6452863                 view recompilation
04-JUN-13 05.44.52.514759 PM   ROLLBACK   SERVER     10.2.0.4            5 OPSU            PSU 10.2.0.4.9

4.4 查看数据库的版本,已经回退到10.2.0.4这个版本去了

[oracle@vxvm 12419397]$ /u01/app/oracle/product/10.2.0/db_1/OPatch/opatch lsinventory
Invoking OPatch 10.2.0.5.1Oracle Interim Patch Installer version 10.2.0.5.1
Copyright (c) 2010, Oracle Corporation.  All rights reserved.Oracle Home       : /u01/app/oracle/product/10.2.0/db_1
Central Inventory : /u01/app/oracle/oraInventoryfrom           : /etc/oraInst.loc
OPatch version    : 10.2.0.5.1
OUI version       : 10.2.0.4.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/opatch2013-06-04_17-48-59PM.logPatch history file: /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch_history.txtLsinventory Output file location : /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2013-06-04_17-48-59PM.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  9352164      : applied on Mon Jan 07 13:33:54 CST 2013
Unique Patch ID:  12307477Created on 1 Apr 2010, 11:33:14 hrs PST8PDT

整个打补丁与回退都成功了,并没有出现报错

------------------作者介绍-----------------------
姓名:黄廷忠
个人博客: (http://www.htz.pw)
CSDN地址: (https://blog.csdn.net/wwwhtzpw)
博客园地址: (https://www.cnblogs.com/www-htz-pw)

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/948967.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

2025 年西北环线旅行社,青海口碑最好的旅行社,青甘大环线旅行社最新推荐,聚焦资质、案例、售后的五家旅行社深度解读

引言 随着西北环线、青甘大环线旅游热度持续攀升,选择靠谱旅行社成为游客出行关键。为给游客提供权威参考,旅游协会联合地方旅游行业协会开展 2025 年相关旅行社测评工作。测评从资质合规性、服务案例质量、售后保障…

读书笔记:Oracle分区黑科技:间隔引用分区与虚拟列分区详解

我们的文章会在微信公众号IT民工的龙马人生和博客网站( www.htz.pw )同步更新 ,欢迎关注收藏,也欢迎大家转载,但是请在文章开始地方标注文章出处,谢谢! 由于博客中有大量代码,通过页面浏览效果更佳。本文为个人学…

2025 年青海旅行社,青海性价比高的旅行社,西宁旅行社最新推荐,聚焦资质、案例、售后的五家旅行社深度解读

引言 为助力消费者精准挑选 2025 年青海及西宁地区高性价比旅行社,青海省旅游协会联合第三方专业测评机构开展权威测评。本次测评从资质合规性、服务案例满意度、售后保障体系三大核心维度入手,对青海省内 50 余家旅…

2025年在线折光浓度仪厂家权威推荐榜单:在线折光计/在线近红外光谱仪/在线折光率仪源头厂家精选

在工业过程控制与智能制造快速发展的背景下,在线折光浓度仪作为关键的流程分析设备,正以其高精度、实时性的测量优势成为多个行业的标配装备。 据流程工业仪器仪表市场报告显示,2024年全球在线浓度仪市场规模达到42…

第五届电子通信与计算机科学技术国际学术会议(ECCST 2025)

第五届电子通信与计算机科学技术国际学术会议(ECCST 2025) 2025 5th International Conference on Electronic Communication,Computer Science and Technology 在这里看会议官网详情 会议时间:2025年12月26-28日 会…

2025 年方形无缝钢管,无缝钢管圆改方,镀锌无缝钢管厂家最新推荐,产能、专利、环保三维数据透视

引言 方形无缝钢管、无缝钢管圆改方及镀锌无缝钢管在建筑结构、机械制造、流体输送等领域应用日益广泛,但市场产品质量差异显著,部分产品存在镀锌层脱落、方管角度偏差大、圆改方精度不足等问题,给采购决策带来困扰…

VSCode Debug 插件

首先得有这个插件1.创建一个 launch.json文件2.选择debugger类型

2025 年精密无缝钢管、合金无缝钢管、高压锅炉无缝钢管厂家最新推荐,精准检测与稳定性能深度解析

引言 精密、合金及高压锅炉用无缝钢管作为高端制造与能源领域的核心耗材,其质量直接关系到设备运行安全与工程可靠性。为破解市场选型难题,本次推荐基于第三方检测机构(具备 CMA/CNAS 双重认证)的权威数据,结合行…

2025年分子动力学仿真厂家权威推荐榜单:动力学模拟/分子动力学模拟/粗粒化模拟源头厂家精选

在科研与工业研发需求日益增长的今天,分子动力学模拟软件已成为化学物理、材料科学和生物物理学等领域不可或缺的工具。 根据QYR最新研究数据,2024年全球分子动力学软件市场规模已达数亿元人民币,预计到2031年将保持…

SQL改写:99%DBA估计都会忽略的重大知识点

我们的文章会在微信公众号IT民工的龙马人生和博客网站( www.htz.pw )同步更新 ,欢迎关注收藏,也欢迎大家转载,但是请在文章开始地方标注文章出处,谢谢! 由于博客中有大量代码,通过页面浏览效果更佳。今天在给一个…

NAS助手 — 纯血鸿蒙时代的 NAS 文件分享新方案

​ 🚀 NAS助手 — 纯血鸿蒙时代的 NAS 文件分享新方案​在当前阶段,官方尚未发布原生鸿蒙版本的 NAS 管理类应用,导致我们在日常使用中面临一些限制: 📁 无法直接将图片或视频批量上传至 NAS 🧾 办公文件传输…

2025年办公室玻璃隔断型材厂家权威推荐榜单:专业玻璃隔断/广州办公室隔断/双层玻璃百叶隔断源头厂家精选

随着现代办公环境不断升级,玻璃隔断市场需求持续增长。据行业统计数据显示,2024年全国办公室隔断市场规模突破280亿元,其中玻璃隔断占比达64%,年增长率稳定在15% 左右。广州作为粤港澳大湾区的核心城市,办公空间装…

Draco 编译及配置

1.下载Draco源码 地址:https://github.com/google/draco/tree/main 下载 Draco 1.5.7 release 或直接克隆 master 2.依赖环境 克隆源码后,打开third_party文件夹可看到其依赖的第三方库,下载源码:eigen(3.4.1) :…

第十一届中国大学生程序设计竞赛 女生专场

https://qoj.ac/contest/2564 一些题目挺经典

JAVA 对于class文件反编译,CFR 通常能产生最完整的代码。

JAVA 对于class文件反编译,CFR 通常能产生最完整的代码。Posted on 2025-10-28 16:49 且行且思 阅读(0) 评论(0) 收藏 举报推荐工具排序(按完整性) 1. CFR(最推荐) 1. 官方下载 http://www.benf.org/other/c…

2025全焊接换热器/板式换热器/清洗维修推荐榜:科睿泽换热(苏州)领跑,四大企业以高效传热赋能工业节能

随着工业领域对能效提升与低碳运营的重视,板式换热器凭借传热效率高、体积小、易维护等优势,成为化工、暖通、水处理等行业的关键设备。基于技术实力、场景适配性与行业口碑,2025 年板式换热器领域优质企业推荐如下…

2025橡胶/变形缝中埋式/中置式橡胶/预埋式橡胶/内埋式/止水带推荐榜:众航防水领跑衡水市场,四大企业以技术筑牢工程防渗防线

随着基建与建筑行业对防渗标准的日趋严格,止水带作为接缝防水关键材料,市场对其耐候性、定制化、供货效率的需求持续攀升。基于产品性能、工程案例与行业口碑,2025 年止水带领域优质企业推荐如下: 衡水众航防水材料…

2025 年 upe 超高分子量聚乙烯板,upe 板超高分子量聚乙烯板,uhmwpe 超高分子量聚乙烯板厂家最新推荐,产能、专利、环保三维数据透视

引言 超高分子量聚乙烯板(UPE/UHMWPE 板)作为运输、化工、煤炭等领域的核心耐磨材料,其品质直接影响工业生产效率。2025 年行业调研显示,市场合格产品仅占 68%,原材料掺假、性能虚标等问题仍存。本次推荐基于耐磨…

2025废气处理设备推荐榜:兴瀚环境领跑青岛市场,四大企业以技术突围环保赛道

废气治理需求升级,设备企业迎发展机遇 随着工业环保要求日趋严格,废气处理设备成为企业合规生产的核心装备,市场对高效、智能、定制化设备的需求持续攀升。基于技术创新、场景落地与行业口碑,2025 年废气处理设备领…

2025 浸没式/全/液冷超充推荐榜:中碳创新领跑 “超充之城”,四大企业解锁低碳补能新范式

随着新能源出行渗透率攀升,液冷超充以高效散热、长寿命等优势成为补能基础设施核心方向。基于技术突破与场景落地能力,2025 年液冷超充领域优质企业推荐如下: 中碳创新(北京)科技集团有限公司🌟🌟🌟🌟🌟…