*****************************************************************************************************
续借上篇:Oracle升级_oracle 10g版本由 10.2.0.1.0升级为10.2.0.4.0(即CPU升级)
***********************************************声明************************************************
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。
表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。
提醒:点击目录,更有助于您的查看。
*****************************************************************************************************
完成PSU升级需要使用专门的工具Opatch(opatch工具版本要比升级数据库目标版本高才可以使用)。
[oracle@rh55 ~]$ ls //在项目一中已经把opatch工具上传到oracle家目录下
上传PSU升级软件包,参考上篇:CPU升级文档中→1、升级准备→(4)上传升级包
[oracle@rh55 ~]$ su -
Password:
[root@rh55 ~]# service smb start
Starting SMB services: [ OK ]
Starting NMB services: [ OK ]
[oracle@rh55 ~]$ ls
1.rcv data p6880880_102000_LINUX.zip spcpkg.lis
catdb_cold_bak.sql Desktop p9352164_1020404_Linux-x86.zip spctab.lis
cpu_up.log Disk1 prod_cold_bak.sql spcusr.lis
cr_control.sql emp.trc prod_hot_bak.sql sqlnet.log
create_dict.sql logmnr README.html test1_contorl.bak
create_test1_db.sql p6810189_10204_Linux-x86.zip soft
[oracle@rh55 ~]$ unzip p9352164_1020404_Linux-x86.zip //解压PSU升级包
查看系统保留的OPatch工具版本是否可用,如下:
[oracle@rh55 OPatch]$ cd /u01/app/oracle/product/10.2.0/db_1/OPatch
[oracle@rh55 OPatch]$ ls
docs emdpatch.pl jlib opatch opatch.ini opatch.pl opatchprereqs
[oracle@rh55 OPatch]$ ./opatch version
//检查opatch版本为10.2.0.4.2低于10.2.0.4.4需要下载新版本
Invoking OPatch 10.2.0.4.2
OPatch Version: 10.2.0.4.2
OPatch succeeded.
[oracle@rh55 home]$ cd oracle
[oracle@rh55 ~]$ ls
1.rcv create_test1_db.sql p6810189_10204_Linux-x86.zip soft
9352164 data p6880880_102000_LINUX.zip spcpkg.lis
catdb_cold_bak.sql Desktop p9352164_1020404_Linux-x86.zip spctab.lis
cpu_up.log Disk1 prod_cold_bak.sql spcusr.lis
cr_control.sql emp.trc prod_hot_bak.sql sqlnet.log
create_dict.sql logmnr README.html test1_contorl.bak
[oracle@rh55 ~]$ unzip p6880880_102000_LINUX.zip
[oracle@rh55 ~]$ cd OPatch/
[oracle@rh55 OPatch]$ ls
crs emdpatch.pl ocm opatch.bat opatch.pl README.txt
docs jlib opatch opatch.ini opatchprereqs
[oracle@rh55 OPatch]$ ./opatch version
Invoking OPatch 10.2.0.5.1
OPatch Version: 10.2.0.5.1
OPatch succeeded.
[oracle@rh55 ~]$ ls
1.rcv data p6880880_102000_LINUX.zip spctab.lis
9352164 Desktop p9352164_1020404_Linux-x86.zip spcusr.lis
catdb_cold_bak.sql Disk1 prod_cold_bak.sql sqlnet.log
cpu_up.log emp.trc prod_hot_bak.sql test1_contorl.bak
cr_control.sql logmnr README.html
create_dict.sql OPatch soft
create_test1_db.sql p6810189_10204_Linux-x86.zip spcpkg.lis
[oracle@rh55 ~]$ cd 9352164
[oracle@rh55 9352164]$ ls
custom etc files patchmd.xml psu_root.sh README.html README.txt
[oracle@rh55 9352164]$ more README.txt
Refer to README.html
SQL> shutdown immediate; //确认数据库关闭状态
[oracle@rh55 ~]$ lsnrctl status //确认监听关闭状态
[oracle@rh55 9352164]$ /home/oracle/OPatch/opatch apply
//一定要进到PSU补丁的目录下再去执行工具
报错了,如下图:
[oracle@rh55 db_1]$ ls
//起初怀疑执行路径问题,将原新版的OPatch放到$ORACLE_HOME下(老版本的做了一下备份OPatch_bak),再次执行/home/oracle/OPatch/opatch apply依旧报错
assistants css install.platform lib odbc owm root.sh srvm
bin ctx inventory log olap perl root.sh.old sysman
ccr dbs javavm md OPatch_bak(旧的OPatch目录) plsql root.sh.old.1 uix
cdata demo jdbc mesg opmn precomp root.sh.old.2 wwg
cfgtoollogs diagnostics jdk mgw oracore racg slax xdk
clone has jlib network oraInst.loc rdbms sqlj
config hs jre nls ord relnotes sqlnet.log
crs install ldap oc4j oui rh55_prod sqlplus
//接下来,尝试重启虚拟机,再次使用oracle家目录下路径执行,此时没有报错
//问题解决方式:重启虚拟机
[oracle@rh55 9352164]$ /home/oracle/OPatch/opatch apply
//接下来根据提示,默认操作即可,选项处均选择“y”
[oracle@rh55 OPatch]$ sqlplus ‘/as sysdba‘
SQL*Plus: Release 10.2.0.4.0 - Production on FriMay 16 12:29:54 2014
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup //启库
ORACLE instance started.
Total System Global Area 729808896 bytes
Fixed Size 1269640 bytes
Variable Size 146800760 bytes
Database Buffers 578813952 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> @?/rdbms/admin/catbundle.sql psu apply //执行脚本
SQL> @?/rdbms/admin/utlrp.sql //执行脚本,定义一下是否有无效的对象
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup upgrade; //以upgrade状态启动数据库
ORACLE instance started.
Total System Global Area 729808896 bytes
Fixed Size 1269640 bytes
Variable Size 146800760 bytes
Database Buffers 578813952 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> @$ORACLE_HOME/cpu/view_recompile/recompile_precheck_jan2008cpu.sql
或SQL> @?/cpu/view_recompile/recompile_precheck_jan2008cpu.sql
//重新编译CPU的相关视图
//为了完成在2008年1月第一次发布CPU补丁时的后续工作
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup upgrade;
ORACLE instance started.
Total System Global Area 729808896 bytes
Fixed Size 1269640 bytes
Variable Size 146800760 bytes
Database Buffers 578813952 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
SQL> @$ORACLE_HOME/cpu/view_recompile/view_recompile_jan2008cpu.sql
//执行第二个脚本
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
至此,PSU的升级已经结束了。
SQL> startup
ORACLE instance started.
Total System Global Area 729808896 bytes
Fixed Size 1269640 bytes
Variable Size 146800760 bytes
Database Buffers 578813952 bytes
Redo Buffers 2924544 bytes
Database mounted.
Database opened.
系统下做一个验证:
[oracle@rh55 9352164]$ /home/oracle/OPatch/opatch lsinventory-bugs_fixed | grep -i ‘DATABASE PSU‘ //PSU升级完成后检验一下
//验证得知,oracle版本已经由10.2.0.4.0升级为10.2.0.4.4
//一般一个季度会发布一个升级包,如上图,2009年7月、2009年10月、2010年1月、2010年4月分别推出了一个升级包
数据库下做一个简单的验证:
SQL> col COMMENTS for a40
SQL> select action,comments from registry$history;
***********************************************声明************************************************
原创作品,出自 “深蓝的blog” 博客,欢迎转载,转载时请务必注明出处(http://blog.csdn.net/huangyanlong)。
表述有错误之处,请您留言或邮件(hyldba@163.com)指明,不胜感激。
提醒:点击目录,更有助于您的查看。
*****************************************************************************************************
Oracle升级_oracle 10g版本由 10.2.0.4.0升级为10.2.0.4.4(即PSU升级),布布扣,bubuko.com
Oracle升级_oracle 10g版本由 10.2.0.4.0升级为10.2.0.4.4(即PSU升级)
原文地址:http://blog.csdn.net/huangyanlong/article/details/38523523