oracle如何查看已经打过的补丁

oracle如何查看 已经打过的补丁

来源: www.ixdba.net 作者: IXDBA.NET社区


set ORACLE_HOME=[oracle目录]
cd $ORACLE_HOME/Opatch/
opatch lsinventory -all -detail
[删除补丁] 删除这个补丁 opatch rollback -id [patchID]

如果没有安装opatch工具,需要先安装。上传文件p2617419_10102_GENERIC.zip
解压到oracle目录下:
unzip p2617419_10102_GENERIC.zip
Archive: p2617419_10102_GENERIC.zip
creating: OPatch/
creating: OPatch/docs/
inflating: OPatch/docs/FAQ
inflating: OPatch/docs/Users_Guide.txt
inflating: OPatch/docs/bt1.txt
inflating: OPatch/docs/bt2.txt
creating: OPatch/jlib/
inflating: OPatch/jlib/opatch.jar
creating: OPatch/perl_modules/
inflating: OPatch/perl_modules/Apply.pm
inflating: OPatch/perl_modules/AttachHome.pm
inflating: OPatch/perl_modules/Command.pm
inflating: OPatch/perl_modules/LsInventory.pm
inflating: OPatch/perl_modules/Query.pm
inflating: OPatch/perl_modules/RollBack.pm
inflating: OPatch/perl_modules/Version.pm
inflating: OPatch/perl_modules/XML.pm
inflating: OPatch/perl_modules/opatchIO.pm
inflating: OPatch/opatch
inflating: OPatch/opatch.pl
inflating: OPatch/opatch.bat
inflating: OPatch/emdpatch.pl
inflating: OPatch/README.txt

将这个路径加到oracle的path中:
:/home/oracle/OPatch
执行opatch lsinventory检查工具

[转]e.g.
将oracle patch上传到oracle目录下面:p4193286_10103_LINUX.zip
解压在oracle目录下面:
[oracle@**** oracle]$ unzip p4193286_10103_LINUX.zip
Archive: p4193286_10103_LINUX.zip
inflating: 4193286/amdcpu.sql
inflating: 4193286/catcpu.sql
inflating: 4193286/catcpu_rollback.sql
creating: 4193286/etc/
creating: 4193286/etc/config/
inflating: 4193286/etc/config/actions
inflating: 4193286/etc/config/inventory
creating: 4193286/etc/xml/
inflating: 4193286/etc/xml/GenericActions.xml
inflating: 4193286/etc/xml/ShiphomeDirectoryStructure.xml
inflating: 4193286/exfcpu.sql
creating: 4193286/files/
creating: 4193286/files/dm/
creating: 4193286/files/dm/admin/
.......

shutdown 数据 库、stop监听

打patch:
[oracle@**** oracle]$ cd 4193286
[oracle@**** 4193286]$ opatch apply
PERL5LIB=/home/oracle/product/10.1.0/db_1/perl/lib/5.6.1:/home/oracle/OPatch/perl_modules; export PERL5LIB
/home/oracle/product/10.1.0/db_1/perl/bin/perl /home/oracle/OPatch/opatch.pl apply


Oracle Home = /home/oracle/product/10.1.0/db_1
Location of Oracle Inventory = /home/oracle/product/10.1.0/db_1/inventory
Oracle Universal Installer shared library = /home/oracle/product/10.1.0/db_1/oui/lib/linux/liboraInstaller.so
Path to Java = /home/oracle/product/10.1.0/db_1/jre/1.4.2/bin/java
Location of Oracle Inventory Pointer = /etc/oraInst.loc
Location of Oracle Universal Installer components = /home/oracle/product/10.1.0/db_1/oui
Required Jar File under Oracle Universal Installer = jlib/OraInstaller.jar

 

OPatch Version 1.0.0.0.50
Perl Version 5.006001
 
/home/oracle/OPatch/opatch.pl version: 1.0.0.0.50
Copyright (c) 2001-2004 Oracle Corporation. All Rights Reserved.
 
Some commands below are not in your path:
  Command= fuser
  Path= /usr/kerberos/bin:/bin:/usr/bin:/usr/local/bin:
/usr/bin/X11:/usr/X11R6/bin:/home/oracle/bin:/home/oracle/bin:
/home/oracle/product/10.1.0/db_1/bin:/home/oracle/OPatch
 
ERROR: OPatch failed because of Path problem.
 
提示fuser命令没有找到,该命令在/sbin目录下面,将该目录加到用户的path中,再执行
[oracle@bj34 4193286]$ opatch apply
 
Oracle Interim Patch Installer version 1.0.0.0.52
Copyright (c) 2005 Oracle Corporation. All Rights Reserved..
 
We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document
293369.1 which is viewable from metalink.oracle.com
 
Oracle Home = /home/oracle/product/10.1.0/db_1
Location of Oracle Universal Installer components = /home/oracle/product/10.1.0/db_1/oui
Location of OraInstaller.jar  = "/home/oracle/product/10.1.0/db_1/oui/jlib"
Oracle Universal Installer shared library = /home/oracle/product/10.1.0/db_1/oui/lib/linux/liboraInstaller.so
Location of Oracle Inventory Pointer = /etc/oraInst.loc
Location of Oracle Inventory = /home/oracle/product/10.1.0/db_1/inventory
Path to Java = /home/oracle/product/10.1.0/db_1/jre/1.4.2/bin/java
Log file = /home/oracle/product/10.1.0/db_1/.patch_storage/<patch ID>/*.log
 
Backing up comps.xml ...
 
OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.
 

Please shut down Oracle instances running out of this ORACLE_HOME
(Oracle Home = /home/oracle/product/10.1.0/db_1)
Is this system ready for updating?
Please respond Y|N >
y
Patching...
 
Updating inventory...
IXDBA.NET技术社区
Backing up comps.xml ...
 

OPatch succeeded.
 
执行opatch lsinventory察看patch是否正确安装:
[oracle@bj34 4193286]$ opatch lsinventory
 
Oracle Interim Patch Installer version 1.0.0.0.52
Copyright (c) 2005 Oracle Corporation. All Rights Reserved..
 
We recommend you refer to the OPatch documentation under
OPatch/docs for usage reference. We also recommend using
the latest OPatch version. For the latest OPatch version
and other support related issues, please refer to document

293369.1 which is viewable from metalink.oracle.com
 
Oracle Home = /home/oracle/product/10.1.0/db_1
Location of Oracle Universal Installer components = /home/oracle/product/10.1.0/db_1/oui
Location of OraInstaller.jar  = "/home/oracle/product/10.1.0/db_1/oui/jlib"
Oracle Universal Installer shared library = /home/oracle/product/10.1.0/db_1/oui/lib/linux/liboraInstaller.so
Location of Oracle Inventory Pointer = /etc/oraInst.loc
Location of Oracle Inventory = /home/oracle/product/10.1.0/db_1/inventory
Path to Java = /home/oracle/product/10.1.0/db_1/jre/1.4.2/bin/java
Log file = /home/oracle/product/10.1.0/db_1/.patch_storage/<patch ID>/*.log
 
Result:
 

  Installed Patch List:
  =====================
  1) Patch 4193286 applied on Mon Apr 25 11:42:00 CST 2005
      [ Base Bug(s): 4003062 4125530 3906246 3965635 3528288 3756949 4048145 4006984 3925449 3909356 3878841 4199450 3878754 4167241 3889519 3878756 3483420 3878793 4193286 3897017 4105639 3925450 4125581 4125549 3878810 4167230 3878817 3458489 4167233 3878835 4118781 3878749 3878839 3878766 4008180 4167237 4057733 3878783 4008181 4008182 4167239 4125511 3111225  ]
 
 
 
OPatch succeeded.
 
启动数据 库,执行catcpu.sql,log里面发现一些错误。
SQL> spool logfile
SQL> @catcpu.sql
 
[lisa@**** 4193286]$ grep -n 'ORA-' logfile.lst
452:ORA-00955: name is already used by an existing object
461:ORA-00955: name is already used by an existing object
533:ORA-00955: name is already used by an existing object
545:ORA-00955: name is already used by an existing object
563:ORA-00955: name is already used by an existing object
609:ORA-00955: name is already used by an existing object
618:ORA-00955: name is already used by an existing object
659:ORA-00955: name is already used by an existing object
668:ORA-00955: name is already used by an existing object
678:ORA-04043: object MDPRVT_IDX does not exist
853:ORA-00955: name is already used by an existing object
 
安装文档提到这些错误可以忽略:
9. The following ignorable errors may be encountered during execution of catcup.sql and catcpu_rollback.sql
 
ORA-00942: table or view does not exist
ORA-04043: object <object-name> does not exist
ORA-01917: user or role 'XDB' does not exist
ORA-01435: user does not exist
ORA-00955: name is already used by an existing object
ORA-04043: Object Missing.
ORA-01430: column being added already exists in table
 
重启数据库,察看警告日志,没有发现异常,启动监听,至此patch打完了。
如果准备充分的话,当掉数据库到重新启动大约也就20分钟,还是比较顺利的。
 
备注:20050425
今天察看安装文档,发现要求的opatch版本比我使用的要新,还是特别标注的,不知道有什么不同,重新下载了新的opatch,卸掉原来的patch,重新打patch,并没有什么特别的地方。
IXDBA.NET技术社区
但是在运行了一段时间以后,发现我的admin/*/bdump下面有个文件centdb_mmon_9603.trc一直在写,基本上每分钟都写:
内容大致如下:
*** 2005-04-25 15:00:56.580
Unable to schedule a MMON slave at: Auto Flush Main 1

Attempt to create slave process failed.
  Can happen for several reasons:
    - No process state objects
    - Reached OS set limits
    - A shutdown was going on
  Check alert log for more details.
 
查询了alert.log和udump下面,并没有什么特别的东西,查询了metalink,也没有人提到,最后我重新启动了数据 库就好了。可能是打完了patch还是需要重启数据库的吧。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值