怎么知道一个数据库实例在服务器上是否有没有呢?你想到的方法或许是通过导入ORACLE_SID环境变量,然后通过启动数据库实例的成功与否来判断数据库实例。这种方法的问题显而易见。如果数据库实例已经损坏,那么这种判断数据库实例的方法肯定有问题的。
本文讲的方法是查看/etc/oratab文件:
[oracle@localhost ~]$ cat /etc/oratab
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# A colon, ':', is used as the field terminator. A new line terminates
# the entry. Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
# $ORACLE_SID:$ORACLE_HOME::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not allowed.
#
#
testdb:/opt/oracle/product/11.1.0:N
[oracle@localhost ~]$
这个文件说在安装数据库软件时,由root.sh脚本创建了这个文件。通常可以认为,如果没有这个文件,oracle软件安装是不成功的。如果创建一个实例,那么会在这个文件里面加上一行的。开始是数据库实例名,然后是ORACLE_HOME的目录。最后是说要不要在启动的时候就运行数据库实例。
◆◆
评论读取中....
请登录后再发表评论!
◆◆
修改失败,请稍后尝试