Thursday, December 7, 2017

1) # "DATABASE VERSION"

1) # "DATABASE VERSION"

sqlplus -S /nolog <<EOF
conn / as sysdba
set pages 700 lines 700 timing on colsep '|'
col INSTANCE for a10
col SERVER for a50
col VERSION for a12
col STATUS for a8
col active_state for a12
col "STARTUP TIME" for a20
select INSTANCE_NAME AS INSTANCE
, HOST_NAME AS SERVER
, VERSION
, STATUS
, active_state
, to_char(startup_time,'dd/mm/yyyy hh24:mi') as "STARTUP TIME"
, case when startup_time < sysdate then 'Status OK' when startup_time < sysdate - 7 then 'DB Restarted' else 'Verify Restarted DB' end as "Status DB"
from v\$instance;
quit;
EOF

No comments:

Post a Comment