重庆思庄Oracle、Redhat认证学习论坛

标题: 怎么查看Linux上是否有存在的数据库或实例 [打印本页]

作者: 橡皮草帽    时间: 2019-12-2 15:16
标题: 怎么查看Linux上是否有存在的数据库或实例
本帖最后由 橡皮草帽 于 2019-12-2 15:17 编辑

1.怎么查看Linux上是否有存在的数据库或实例

      #创建数据库或实例时,会在/etc/oratab文件中增加一行记录,哪怕是数据库实例没有启动,用此方法也可以查看到。
[oracle@redhat70 ~]$ cat /etc/oratab
#


# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# 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:<N|Y>:
#
# 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.
#
#

orcl:/u01/app/oracle/product/11.2.0.4/dbhome_1:N

从/etc/oratab中最后一行结果中,可以看出该Linux上存在一个叫orcl的数据库(包括实例)

      #如果数据库或实例已启动至nomount模式,就会产生pmon进程,可以通过查看pmon进程的方式来查看数据库实例是否存在,一个实例对应一个pmon进程,如果查到多个pmon进程,就意味着存在多个数据库实例
[oracle@redhat70 ~]$ ps -ef | grep pmon
oracle     8365      1  0 02:00 ?        00:00:00 ora_pmon_orcl
oracle     9440   2862  0 02:11 pts/1    00:00:00 grep --color=auto pmon

从查询到的结果来看,Linux上运行着一个叫orcl的数据库实例





欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2