Oracle中Inventory目录作用以及如何重建此目录

oraInventory存放的是Oracle软件安装的目录信息,Oralce的安装升级都需要用到这个目录,来看看Oracle文档中对这个目录的一点说明:
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文件决定的:
/etc/oraInst.loc (AIX and Linux Platform)
/var/opt/oracle/OraInst.loc (Solaris and HP-UX platform)

$cat /etc/oraInst.loc 
inventory_loc=/app/oracle/oraInventory
inst_group=dba
删除或丢失oraInventory目录的内容,都有可能导致升级报错,例如在运行opatch时就有可能遇到以下报错:
10G中:
$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
$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
9I中报错:
OPATCH_JAVA_ERROR  : An exception of type "OPatchException" has occurred: 
OPatch Exception:
  Can not lock OUI inventory (READ/WRITE Level)
  An exception occurs
  The inventory pointed at location /app/oraInventory is not valid

There is no Interim Patch

Can not get a list of inventory on this home.
LsInventory: OPatch Exception while accessing O2O

OPATCH_JAVA_ERROR  : An exception of type "OPatchException" has occurred: 
OPatch Exception:
  OUI found no such ORACLE_HOME set in the environment
  Can not get details for given Oracle Home
  An exception occurs
  null

There is no Interim Patch

Can not get a list of inventory on this home.

ERROR: OPatch failed because of Inventory problem.
在10G中可以运行以下命令进行oraInventory目录重建:
$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$
10.2.0.2以上的版本,还可以直接运行attachHome.sh脚本:
$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.
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: 在 Oracle目录配置的数据库名列表通常存储在 $ORACLE_HOME/network/admin/tnsnames.ora 文件。如果您想要卸载这些数据库,可以按照以下步骤进行操作: 1. 使用管理员权限登录到操作系统。 2. 停止所有与 Oracle 相关的服务或进程。 3. 打开命令行界面。 4. 进入 Oracle目录,例如:cd /u01/app/oracle/product/11.2.0/dbhome_1/ 5. 使用以下命令卸载每个数据库: `sqlplus /nolog` `connect / as sysdba` `shutdown immediate;` `exit;` `lsnrctl stop` `lsnrctl status` (确认监听程序已停止) `cd $ORACLE_HOME/network/admin` `vi tnsnames.ora` 在 tnsnames.ora 文件删除相应的数据库条目。 6. 重复步骤 5,直到卸载了所有需要删除的数据库。 7. 从操作系统删除 Oracle目录。 请注意,在执行这些步骤之前,请备份所有相关的数据和配置文件,以防止数据丢失或其他不可预知的问题。 ### 回答2: 要卸载 Oracle 数据库,并指定在此 Oracle目录配置的数据库名的列表,需要执行以下步骤: 1. 确认数据库列表:首先,登录到数据库服务器的操作系统,打开命令行终端,在终端输入以下命令: ``` lsnrctl status ``` 这将显示数据库监听器的状态信息,包括当前配置的数据库列表。记下显示的所有数据库名,这些将是要卸载的数据库。 2. 停止监听器:输入以下命令来停止数据库监听器: ``` lsnrctl stop ``` 3. 停止数据库实例:输入以下命令来停止数据库实例: ``` sqlplus / as sysdba shutdown immediate exit ``` 4. 卸载数据库软件:找到 Oracle 软件安装目录,然后运行其的 `deinstall` 脚本,比如在 Unix/Linux 系统上,输入以下命令: ``` cd <Oracle软件安装目录>/deinstall ./deinstall ``` 脚本将引导您通过卸载过程,并提示您选择要卸载的数据库。 5. 删除数据库文件:删除数据库实例的数据文件和控制文件。通常情况下,这些文件位于数据库的 `$ORACLE_HOME/dbs` 目录下,其 `$ORACLE_HOME` 是 Oracle 软件安装目录。使用操作系统命令行或文件管理器手动删除这些文件。 完成以上步骤后,您的 Oracle 数据库将被成功卸载,并且您指定的数据库列表将从 Oracle目录移除。请注意,在执行卸载过程之前,务必备份数据库和相关文件,以防意外数据丢失。 ### 回答3: 要卸载Oracle并指定要卸载的数据库名称列表,可以按照以下步骤进行操作: 1. 首先,确保已经备份了数据库重要的数据和配置信息。卸载Oracle将删除数据库文件和配置文件,因此在执行卸载操作之前,务必备份相关数据。 2. 打开命令提示符或终端窗口,以管理员权限运行卸载程序。卸载程序的路径通常是$ORACLE_HOME/deinstall/deinstall.bat(在Windows下)或$ORACLE_HOME/deinstall/deinstall(在Linux/UNIX下)。 3. 在卸载程序启动后,它将展示一个菜单,包含几个选项。选择“删除Oracle软件并数据库”。 4. 在下一步,卸载程序会列出当前主目录已配置的数据库名称列表。选择你要卸载的数据库名称。 5. 确认卸载操作。卸载程序会显示一个摘要页面,列出将要删除的数据库和文件。仔细检查摘要,确保没有重要的数据库被遗漏。确认无误后,继续下一步。 6. 卸载操作将会开始执行。卸载程序将删除数据库文件、配置文件和其他相关的Oracle文件。这个过程可能需要一些时间,具体取决于数据库的大小和系统性能。 7. 完成卸载操作后,卸载程序将显示一个总结页面,列出已成功卸载的数据库和相关文件的信息。 请注意,卸载Oracle可能会对现有的系统环境和其他数据库产生影响,因此在执行卸载操作之前,务必备份重要数据并确保对其他数据库没有负面影响。建议在执行卸载操作之前,详细阅读相关文档或咨询专业人员以获取更多帮助。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值