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

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3780|回复: 0
打印 上一主题 下一主题

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

[复制链接]
跳转到指定楼层
楼主
发表于 2019-12-2 15:16:05 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
本帖最后由 橡皮草帽 于 2019-12-2 15:17 编辑

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

  • 通过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的数据库实例
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-9-29 07:30 , Processed in 0.080332 second(s), 21 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表