Below is command to check database startup time along with server up time. This is require whenever we perform reboot of database due to patching, change of parameters activities etc.
SQL command to check database startup time along with server up time in standalone database. Click here to get sample output.
COLUMN HOST_NAME FOR A60
COLUMN INSTANCE_NAME FOR A60
COLUMN STIME FOR A60
COLUMN SERVER_UPTIME FOR A60
SELECT
'HOSTNAME : ' || HOST_NAME,
'INSTANCE NAME : ' || INSTANCE_NAME,
'STARTED AT : ' || TO_CHAR(STARTUP_TIME,'DD-MON-YYYY HH24:MI:SS') STIME,
'UPTIME : ' || FLOOR(SYSDATE - STARTUP_TIME) || ' DAYS(S) ' ||
TRUNC( 24*((SYSDATE-STARTUP_TIME) -
TRUNC(SYSDATE-STARTUP_TIME))) || ' HOUR(S) ' ||
MOD(TRUNC(1440*((SYSDATE-STARTUP_TIME) -
TRUNC(SYSDATE-STARTUP_TIME))), 60) ||' MINUTE(S) ' ||
MOD(TRUNC(86400*((SYSDATE-STARTUP_TIME) -
TRUNC(SYSDATE-STARTUP_TIME))), 60) ||' SECOND(S)' SERVER_UPTIME
FROM
SYS.V_$INSTANCE;
prompt$$$$$$$Welcome to DBsGuru and Happly Learning!$$$$$$$
SQL command to check database startup time along with server up time in RAC database. Click here to get sample output
SET LINE 66
set pages 66
COLUMN HOST_NAME FOR A60
COLUMN INSTANCE_NAME FOR A60
COLUMN STIME FOR A60
COLUMN SERVER_UPTIME FOR A63
SELECT
'HOST_NAME : ' || HOST_NAME,
'INSTANCE_NUMBER : ' || INST_ID,
'INSTANCE NAME : ' || INSTANCE_NAME,
'STARTED AT : ' || TO_CHAR(STARTUP_TIME,'DD-MON-YYYY HH24:MI:SS') STIME,
'SERVER_UPTIME : ' || FLOOR(SYSDATE - STARTUP_TIME) || ' DAYS(S) ' ||
TRUNC( 24*((SYSDATE-STARTUP_TIME) -
TRUNC(SYSDATE-STARTUP_TIME))) || ' HOUR(S) ' ||
MOD(TRUNC(1440*((SYSDATE-STARTUP_TIME) -
TRUNC(SYSDATE-STARTUP_TIME))), 60) ||' MINUTE(S) ' ||
MOD(TRUNC(86400*((SYSDATE-STARTUP_TIME) -
TRUNC(SYSDATE-STARTUP_TIME))), 60) ||' SECOND(S)' SERVER_UPTIME
FROM
SYS.GV_$INSTANCE;
prompt$$$$$$$Welcome to DBsGuru and Happly Learning!$$$$$$$
We always encourage the technical person to visit section SCRIPTS to get more daily usage SQL commands.
Hope so you like this article!
Please share your valuable feedback/comments/subscribe and follow us below and don’t forget to click on the bell icon to get the most recent update. Click here to know more about our pursuit.