Find out Instance is Primary or Standby

Option 1:

In Primary database controlfile_type will show “CURRENT” and in standby conrolfile_type will show “STANDBY”.

SQL> SELECT controlfile_type FROM V$database;

CONTROLFILE_TYPE

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

CURRENT

 

SQL> SELECT controlfile_type FROM V$database;

CONTROLFILE_TYPE

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

STANDBY

 

Option 2:

In Primary database role will show “PRIMARY” and in standby database role will show “PHYSICAL STANDBY”

SQL> select database_role from v$database;

DATABASE_ROLE
----------------------------------
PRIMARY

SQL> select database_role from v$database;

DATABASE_ROLE
------------------------------------
PHYSICAL STANDBY

Comments