本文描述的情况适合以下数据库:
Oracle Universal Installer – Version 10.2.0.1.0 and later
Oracle Server – Enterprise Edition – Version 10.2.0.1 and later
Oracle Server – Standard Edition – Version 10.2.0.1 and later
Information in this document applies to any platform
ora-12516,描述:
Opatch是给ORACLE打补丁的一个工具,如果opatch出现问题也就是说不能正常给数据库打补丁。今天就遇到了oraInventory目录有错误的情况,如下:
$ ./opatch lsinventory
Invoking OPatch 11.1.0.6.2
Oracle Interim Patch Installer version 11.1.0.6.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
oracle索引重建,Oracle Home : /ebsdb/UAT/db/tech_st/11.1.0
Central Inventory : /ebsdb/UAT/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.1.0.6.2
OUI version : 11.1.0.7.0
OUI location : /ebsdb/UAT/db/tech_st/11.1.0/oui
orical数据库?Log file location : /ebsdb/UAT/db/tech_st/11.1.0/cfgtoollogs/opatch/opatch2013-06-28_17-10-57PM.log
List of Homes on this system:
Home name= Ora_home1, Location= “/ebsdb/UAT/db/tech_st/11.1.0”
Inventory load failed… OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
Oracle Home dir. path does not exist in Central Inventory
oracle dblink。Oracle Home is a symbolic link
Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo
OPatch failed with error code 73
从以上报错信息得出,opatch是无法获取ORACLE HOME的目录导致的报错。下面就分析一下有哪几种情况会导致opatch的不可用。
1) 丢失oraInst.loc文件
ora-01427?如果丢失或损坏oraInst.loc文件,同样会执行opatch报错,对于AIX系统和LINUX系统该文件位于/etc/oraInst.loc,如果系统中缺失该文件或文件不对只要手工删除/etc/oraInst.loc后重新创建该文件并写入oraInventory的目录,如下
inventory_loc=
inst_group=
Example:
inventory_loc=/u01/oracle/oraInventory
inst_group=oinstall
ora-01033,注:确保ORACLE用户对于指定的oraInventory文件具有755权限。
对于丢失oraInst.loc文件的丢失一般会报104错误
$ ./opatch lsinventory
Invoking OPatch 11.1.0.6.2
Oracle Interim Patch Installer version 11.1.0.6.2
Copyright (c) 2007, Oracle Corporation. All rights reserved.
数据库 orcl?Oracle Home : /ebsdev_bp/DEV/db/tech_st/11.1.0
Central Inventory : /ebsdb/UAT/oraInventory
from :
OPatch version : 11.1.0.6.2
OUI version : 11.1.0.7.0
OUI location : /ebsdev_bp/DEV/db/tech_st/11.1.0/oui
oracle数据库实例。Log file location : /ebsdev_bp/DEV/db/tech_st/11.1.0/cfgtoollogs/opatch/opatch2013-06-28_16-58-57PM.log
OPatch cannot find a valid oraInst.loc file to locate Central Inventory.
OPatch failed with error code 104
2) oraInventory文件缺失或损坏
如果说出现oraInventory文件的缺失或者损坏等情况就会出现我开头找不到ORACLE HOME的报错,下面演示该问题的处理过程。
A、如果现有系统有oraInventory文件,可以先把该文件重命名一下
oracle。$ mv oraInventory oraInventory_orig
该文件位于ORACLE BASE目录,当前我的环境该文件在/ebsdb/UAT目录下,对于windows系统可以使用windows的图形界面去改名。
B、进入OUI目录
(Unix/Linux): $ cd $ORACLE_HOME/oui/bin
(Windows): > cd %ORACLE_HOME%\oui\bin
C、执行重建oraInventory命令
oracle恢复数据库、UNIX/LINUX
$ ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME=”” ORACLE_HOME_NAME=””
Windows
> setup.exe -silent -ignoreSysPrereqs -attachHome ORACLE_HOME=”” ORACLE_HOME_NAME=””
其中涉及到的Oracle Home Location根据实际环境的Oracle Home去设置,ORACLE_HOME_NAME的话可以根据自己的喜好进行命名。
下面是对我上面报错环境的一个修复:
ora01109数据库未打开,$ ./runInstaller -silent -ignoreSysPrereqs -attachHome
ORACLE_HOME=”/ebsdb/UAT/db/tech_st/11.1.0″ ORACLE_HOME_NAME=”Ora_Home1″
No pre-requisite checks found in oraparam.ini, no system pre-requisite checks will be executed.
>>> Ignoring required pre-requisite failures. Continuing…
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /ebsdb/UAT/oraInventory
oracle database configuration、‘AttachHome’ was successful.
至此看到successful的提示说明已经创建成功。
D、使用OPATCH查看相关补丁信息
$ ./opatch lsinventory
Invoking OPatch 11.1.0.6.2
Oracle Interim Patch Installer version 11.1.0.6.2
ora 00054。Copyright (c) 2007, Oracle Corporation. All rights reserved.
Oracle Home : /ebsdb/UAT/db/tech_st/11.1.0
Central Inventory : /ebsdb/UAT/oraInventory
from : /etc/oraInst.loc
OPatch version : 11.1.0.6.2
OUI version : 11.1.0.7.0
oracle备份还原数据库?OUI location : /ebsdb/UAT/db/tech_st/11.1.0/oui
Log file location : /ebsdb/UAT/db/tech_st/11.1.0/cfgtoollogs/opatch/opatch2013-06-28_19-43-49PM.log
Lsinventory Output file location : /ebsdb/UAT/db/tech_st/11.1.0/cfgtoollogs/opatch/lsinv/lsinventory2013-06-28_19-43-49PM.txt
——————————————————————————–
Installed Top-level Products (3):
Oracle Database 11g 11.1.0.6.0
00942 oracle?Oracle Database 11g Examples 11.1.0.6.0
Oracle Database 11g Patch Set 1 11.1.0.7.0
There are 3 products installed in this Oracle Home.
.
.
.
oracle重建表?Patch 7295298 : applied on Thu Mar 26 20:13:53 CST 2009
Created on 18 Dec 2008, 09:32:01 hrs UTC
Bugs fixed:
7295298
Patch 6972189 : applied on Thu Mar 26 20:13:31 CST 2009
Created on 18 Nov 2008, 12:43:27 hrs UTC
Bugs fixed:
6972189
——————————————————————————–
OPatch succeeded.
对于重建oraInventory的相关具体信息可以参考MOS Doc id:556834.1
Steps To Recreate Central Inventory(oraInventory) In RDBMS Homes [ID 556834.1]
版权声明:本站所有资料均为网友推荐收集整理而来,仅供学习和研究交流使用。
工作时间:8:00-18:00
客服电话
电子邮件
admin@qq.com
扫码二维码
获取最新动态