Saturday, June 25, 2016

Instance Status

set linesize 1000
col strtd hea 'STARTED' format a20
col instance_name for a8 hea 'INSTANCE'
col host_name for a15 hea 'HOSTNAME'
col version for a10

select instance_name, version, host_name, status
, database_status, to_char(startup_time,'DD-MON-YYYY HH:MI:SS') strtd
from v$instance;

col inst_id for 9
col instance_name format a7
col host_name format a20
col version format a10
col thread# format 9
col database_status for a10
col linesize 180
select inst_id,instance_name,host_name,version,thread#,database_status from gv$instance;
---------------------------------------------------------------------------------------------------

--Use GV$INSTANCE for RAC Database

select instance_name, version, host_name, status
, database_status,to_char(startup_time,'DD-MON-YYYY HH:MI:SS') strtd
from gv$instance;

--Or use V$THREAD

select instance, status, enabled, open_time, checkpoint_time
from v$thread;

No comments: