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

Source: Internet
Author: User

On the linux/unix platform, it is not difficult to check which databases or instances exist on the OS. As some colleagues asked this question, I wrote down the method, someone may ask, but maybe another person may not. I hope it will help some friends who are not or just new. On the linux/unix platform, you can view the number of databases on the OS. There are three query methods: 1. You can run the lsnrctl status Command to view the number of databases on the OS, you can view the database instances that have been registered to listener. To a certain extent, it indicates that there are database instances listed in the command results on the OS. Of course, commands except unstarted and unregistered include: # 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 LISTENERVersion TNSLSNR for Linux: version 11.2.0.3.0-ProductionStart Date 04-AUG-2013 05: 57: 12 Uptime 0 days 0 hr. 6 Min. 17 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File/dba/oracle/product/11.2.0/db_1/network/admin/listener. oraListener Log File/dba/oracle/diag/tnslsnr/oraclelinux/listener/alert/log. xmlListening Endpoints Summary... (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 192.168.171.100) (PORT = 1521) (DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC1521) Services Summ Ary... 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, it indicates that at least one database instance named litest exists on the operating system. 2. when viewing the database or instance through cat/etc/oratab, A line of records will be added to the/etc/oratab file, even if the database instance is not started, You can also view this method. 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: <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 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 result of the last row in the table above, we can see that there is an OS named lites T database (including instances) 3. View through ps-ef | grep ora_pmon. If the database or instance has been started in nomount mode, a 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, this means that there are multiple database instance commands on the OS: # ps-ef | grep pmon [root @ oraclelinux ~] # Ps-ef | grep pmonoracle 3491 1 0 06:10? 00:00:00 ora_pmon_litestroot 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.