linux查看数据库下文件是否存在,怎么查看Linux上是否有存在的数据库或实例

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

通过cat /etc/oratab方式查看

#创建数据库或实例时,会在/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::

#

# 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的数据库(包括实例)

通过ps –ef |grep pmon方式查看

#如果数据库或实例已启动至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的数据库实例

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值