Useful shortcuts for vi editor

Sunday, 24 May 2015

How to get instance name, database status and instance role in Oracle?

SQL> select instance_name, database_status, instance_role from v$instance; 

e..g.
INSTANCE_NAME    DATABASE_STATUS   INSTANCE_ROLE
---------------- ----------------- ------------------
xe               ACTIVE            PRIMARY_INSTANCE