On Linux/Unix platform, how does one check which databases or instances exist on the OS?

Source: Internet
Author: User
On the LinuxUnix platform, how does one check which databases or instances exist on the OS?

On Linux/Unix platform, how does one check which databases or instances exist on the OS?

In fact, this is not difficult. A colleague asked this question, so I wrote down the method of this question. Someone may ask this question. Maybe another person may not, hope it will be helpful to friends who haven't or just entered the line.

On the linux/unix platform, there are three methods to query how many databases exist on the OS:

1. Run the lsnrctl status Command to view

By using this method, you can view the database instances that have been registered to listener. To some extent, it indicates that there are database instances listed in the command results on the OS, of course, except for unstarted and unregistered

Command: # su-Oracle

$ Lsnrctl status

[Oracle @ oraclelinux ~] $ Lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0-Production on 04-AUG-2013 06:03:29

Copyright (c) 1991,201 1, Oracle. All rights reserved.

Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.171.100) (PORT = 1521 )))

STATUS of the LISTENER

------------------------

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.3.0-Production

Start Date 04-AUG-2013 05:57:12

Uptime 0 days 0 hr. 6 min. 17 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File/dba/oracle/product/11.2.0/db_1/network/admin/listener. ora

Listener Log File/dba/oracle/diag/tnslsnr/oraclelinux/listener/alert/log. xml

Listening Endpoints Summary...

(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.171.100) (PORT = 1521 )))

(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC1521 )))

Services Summary...

Service "litest" has 1 instance (s ).

Instance "litest", status READY, has 1 handler (s) for this service...

Service "litestXDB" has 1 instance (s ).

Instance "litest", status READY, has 1 handler (s) for this service...

The command completed successfully

From the result set in the above table, we can see that there is a "litest" database instance registered to listener, indicating that at least one database instance named litest exists on the OS.

2. Use cat/etc/oratab to view

When you create a database or instance, a row of records will be added to the/etc/oratab file, even if the database instance is not started, you can view this method. As follows:

Command: # cat/etc/oratab

[Root @ oraclelinux ~] # 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 shocould, "Y", or shocould not,

# "N", be brought up at system boot time.

# Multiple entries with the same $ ORACLE_SID are not allowed.

#

Litest:/dba/oracle/product/11.2.0/db_1: N

From the results of the last row in the table above, we can see that there is a database (including instances) called litest on the OS)

3. Run ps-ef | grep ora_pmon to view

If the database or instance has been started to the nomount mode, the pmon process will be generated. Therefore, we can check whether the OS has a pmon process to check whether several database instances exist, each instance has a pmon process. If multiple pmon processes exist, multiple database instances exist on the OS.

Command: # ps-ef | grep pmon

[Root @ oraclelinux ~] # Ps-ef | grep pmon

Oracle 3491 1 0? 00:00:00 ora_pmon_litest

Root 3528 3459 0 00:00:00 pts/1 grep pmon

From the results in the above table, we can see that a database instance named "litest" is running on the OS.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.