How to check database startup time along with server up time in Oracle.

0 Comments

0
(0)

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!$$$$$$$ 

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.

 586 Total Views,  1 Views Today

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

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?

Spread the Knowledge!

Leave a Reply

Your email address will not be published. Required fields are marked *

one + 3 =

Open chat
1
Contact Us:
Hi,

Greetings of the day! How can we help you?

Thanks.
Team DBsGuru
Direct Call:+91-9310167776
Email: info@dbsguru.com

Share Learn Grow!


Click on the below technical group to join us to share expertise in PostgreSQL and MySQL on WhatsApp group. The purpose of this group is only help to the DBA community.

PostgreSQL Technical Group.

MySQL technical Group.

Technical Links Powered by DBsGuru.

Thanks.
Team DBsGuru.