Query the views v$database and v$thread.

V$DATABASE gives DB_NAME
V$THREAD gives ORACLE_SID

If ORACLE_SID = DB_SID and db_name = DBNAME:

To find the current value of ORACLE_SID:

SVRMGR> select instance from v$thread;

INSTANCE
----------------
DB_SID

To find the current value of DB_NAME:

SVRMGR> select name from v$database;

NAME
---------
DBNAME

订阅: 博文 (Atom)