I want to know different ways to find the database name without making connection to the database, neither using sqlplus
or srvctl
In oracle, let's suppose I have 2 nodes in a RAC running the database pstest
. I can get the database name by simply connecting to any one of the db instance and query as below
SQL> select name from v$database;
NAME
---------
PSTEST
or
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string pstest`
But I need to know how can I get the database name which is pstest
here without connecting to the database by sqlplus
(so both above won't be useful).
As my pstest
database is running in 2 instances - pstest1
on node1 and pstest2
on node2. So I can use srvctl as below
srvctl status database -d pstest
Instance pstest1 is running on node1
Instance pstest2 is running on node2
But how can I get <db_name>
to use to in srvctl
without using srvctl
or sqlplus
?
Thanks In Advance.
Without even understanding why you'd need this, which is kind of odd, a way to do this would be ( keeping in consideration that you are using
Oracle RAC
)The utility in this case is
csrsctl
Example
What I did was using
crsctl
to get the database name. Obviously, it would only work in your scenario that you have one database.I remove the
mgmtdb
which is an internal database of the Grid Infrastructure. If you had more than one database inOracle RAC
, then