0

I'm at the linux prompt of a computer running Oracle 11.

Without connecting to the database, how can I determine what is the instance name of the Oracle server running on this box?

  • 1
    What do you want to see if there is more than one instance? In most Linux distributions you can check the instances by looking at /etc/oratab – a_horse_with_no_name Mar 18 '14 at 16:29
  • I'm flexible on what I want to see. It looks like oratab and grep pmon are both good. Basically I'm logging on to some tests boxes that have been set up and deducing a connection string. – Mark Harrison Mar 19 '14 at 18:12
4

If the DB is running, you can look for the pmon process:

ps auxww | grep pmon | grep -v grep

You'll see one pmon process for each database that is up. For example ora_pmon_YOURDB, where YOURDB is the instance name.

You can also ask the listener which services it is serving connections for, with:

lsnrctl status
0

(Channeling for a_horse_with_no_name, who left a good answer in a comment.)

In most Linux distributions you can check the instances by looking at /etc/oratab.

# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:<N|Y>:
orcl:/data/oracle/software:N
-2

if you've installed Oracle with the installer, you can try with this:

echo $ORACLE_SID

  • 1
    All that tells you is the value of the $ORACLE_SID environment variable in the current shell. It tells you nothing about running services. – Philᵀᴹ Mar 18 '14 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.