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

in 编程
关注公众号【好便宜】( ID:haopianyi222 ),领红包啦~
阿里云,国内最大的云服务商,注册就送数千元优惠券:https://t.cn/AiQe5A0g
腾讯云,良心云,价格优惠: https://t.cn/AieHwwKl
搬瓦工,CN2 GIA 优质线路,搭梯子、海外建站推荐: https://t.cn/AieHwfX9

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的数据库实例

关注公众号【好便宜】( ID:haopianyi222 ),领红包啦~
阿里云,国内最大的云服务商,注册就送数千元优惠券:https://t.cn/AiQe5A0g
腾讯云,良心云,价格优惠: https://t.cn/AieHwwKl
搬瓦工,CN2 GIA 优质线路,搭梯子、海外建站推荐: https://t.cn/AieHwfX9
扫一扫关注公众号添加购物返利助手,领红包
Comments are closed.

推荐使用阿里云服务器

超多优惠券

服务器最低一折,一年不到100!

朕已阅去看看