()

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.



Loading

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?

DBsGuru

Hello and welcome to DBsGuru,DBsGuru is a group of experienced DBA professionals and serves databases and their related community by providing technical blogs, projects, training. Technical blogs are the source of vast information not about databases but its related product like middleware, PL/SQL, replication methodology, and so on.Thanks for the visits!Share Learn Grow!