10g安装出现oraInventory目录问题

  • 问题背景
因之前安装过数据库11.2.0.1.0和11.2.0.3.0数据库,在环境变量倒换之间出现错误,通过kill进程的方法删除了数据库。然后删除了datafile等文件。在第二次安装的时候,出现如下情况
[oracle@aisms]./runInstaller
You do not have sufficient permissions to access the inventory '/data/oracle/oraInventory3/logs'. Installation cannot continue. Make sure that you have read/write permissions to the inventory directory and restart the installer.: Permission denied
/data/oracle/oraInventory3为安装11.2.0.3.0数据库的时候创建目录。
之前的环境变量情况为:
$ORACLE_BASE=/data/oracle
$ORACLE_HOME=$ORACLE_BASE/product/11.2.0.3.0
  • 问题分析:
来看看oraInventory目录的介绍
All Oracle software installations rely on this directory.
Ensure that you back it up regularly.
Do not delete this directory unless you have completely removed
all Oracle software from the system.
而oraInventory目录的位置是由oraInst.loc文件决定的,在solaris中oraInst.loc文件位于/var/opt/oracle/OraInst.loc文件下,其内容如下:
[root@ocmserver]more oraInst.loc
inventory_loc=/opt/oracle/oraInventory
inst_group=oinstall
[root@ocmserver]
这样,问题找到了。即最后一次删除的时候,数据库是11.2.0.3.0版本。当删除$ORACLE_BASE和$ORACLE_HOME目录下的所有内容的时候,没有清楚或者修改/var/opt/oracle/oraInst.loc文件。所以在下次清除的时候,他默认从oraInst.loc文件中的那些配置读取,每次都会需要读取此位置,而如果新安装的位置安放在其他地方,在会出现无权读取某文件等。
  • oraInventory知识拓展:
轻易不要删除oraInventory目录,如果在生产环境删除,则会出现各种错误。常见错误总结如下:
example1
$opatch lsinventory
Invoking OPatch 10.2.0.4.3

OPatch failed to locate Central Inventory.
Possible causes are:
        The Central Inventory is corrupted
        The oraInst.loc file specified is not valid.
LsInventorySession failed: OPatch failed to locate Central Inventory.
Possible causes are:
        The Central Inventory is corrupted
        The oraInst.loc file specified is not valid.

OPatch failed with error code 73
explame2
$opatch lsinventory
Invoking OPatch 10.2.0.4.3

List of Homes on this system:

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 Home is a symbolic link
     Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

OPatch failed with error code 73
oraInventory重建方法1
$cd $ORACLE_HOME/oui/bin
$./runInstaller -silent -attachHome \
> ORACLE_HOME=$ORACLE_HOME \
> ORACLE_HOME_NAME= "ORACLE_HOME"
Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini,
no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /app/oracle/oraInventory
'AttachHome' was successful.
js_znjh_1./app/oracle/product/10.2.0/db_1/oui/bin$
oraInventory重建方法2
$cd $ORACLE_HOME/oui/bin        
$./attachHome.sh
Starting Oracle Universal Installer...

No pre-requisite checks found in oraparam.ini,
no system pre-requisite checks will be executed.
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /app/oracle/oraInventory
'AttachHome' was successful.
实验证明
实验一:修改默认oraInventory目录为oraInventory_bak目录,启动数据库,然后运行升级程序。
[oracle@ocmserver]mv oraInventory oraInventory_bak
[oracle@ocmserver]ls
admin                                bak                                    flash_recovery_area    oradata                            sql
archive_log                    core                                 oraInventory_bak         product                            sqlnet.log
[oracle@ocmserver]sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Wed Nov 28 22:21:35 2012

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

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area    230686720 bytes
Fixed Size                                    2019768 bytes
Variable Size                         104861256 bytes
Database Buffers                    117440512 bytes
Redo Buffers                                6365184 bytes
Database mounted.
Database opened.
SQL> !
bash-3.2$ cd /opt/oracle/product/10.2.0.1/OPatch
bash-3.2$ ./opatch lsinventory
Invoking OPatch 10.2.0.1.0

Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation.    All rights reserved..


Oracle Home             : /opt/oracle/product/10.2.0.1
Central Inventory : /opt/oracle/oraInventory
     from                     : /opt/oracle/product/10.2.0.1/oraInst.loc
OPatch version        : 10.2.0.1.0
OUI version             : 10.2.0.1.0
OUI location            : /opt/oracle/product/10.2.0.1/oui
Log file location : /opt/oracle/product/10.2.0.1/cfgtoollogs/opatch/opatch-2012_Nov_28_22-26-47-CST_Wed.log

LsInventory Session failed: OPatch failed to locate Central Inventory.
Possible causes are:
        The Central Inventory is corrupted
        The oraInst.loc file specified is not valid.

OPatch failed with error code 72
bash-3.2$
实验二:修改/var/opt/oracle/oraInst.loc文件以及$ORACLE_HOME/oraInst.loc文件,然后再执行./OPatch lsinventory
SQL> !
bash-3.2$ more / var /opt/oracle/oraInst.loc
inventory_loc=/opt/oracle/oraInventory_bak
inst_group=oinstall
bash-3.2$ more /opt/oracle/product/10.2.0.1/oraInst.loc
inventory_loc=/opt/oracle/oraInventory_bak
inst_group=oinstall
bash-3.2$./opatch lsinventory
Invoking OPatch 10.2.0.1.0

Oracle interim Patch Installer version 10.2.0.1.0
Copyright (c) 2005, Oracle Corporation.    All rights reserved..


Oracle Home             : /opt/oracle/product/10.2.0.1
Central Inventory : /opt/oracle/oraInventory_bak
     from                     : /opt/oracle/product/10.2.0.1/oraInst.loc
OPatch version        : 10.2.0.1.0
OUI version             : 10.2.0.1.0
OUI location            : /opt/oracle/product/10.2.0.1/oui
Log file location : /opt/oracle/product/10.2.0.1/cfgtoollogs/opatch/opatch-2012_Nov_28_22-36-55-CST_Wed.log

Lsinventory Output file location : /opt/oracle/product/10.2.0.1/cfgtoollogs/opatch/lsinv/lsinventory-2012_Nov_28_22-36-55-CST_Wed.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 10g                                                                                                    10.2.0.1.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.

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

OPatch succeeded.
bash-3.2$
由此可知,$ORACLE_HOME/oraInst.loc文件和/var/opt/oracle/oraInst.loc应该是映射关系,在数据库启动的时候修改$ORACLE_HOME目录下的oraInst.loc,当卸载数据库的时候($ORACLE_HOME,$ORACLE_BASE被删除)可以修改/var/opt/oracle/oraInst.loc文件。

本文出自 “Focus on Oracle” 博客,请务必保留此出处http://alexy.blog.51cto.com/6115453/1073510

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值