Friday, November 13, 2009

Database uptime and startup time

SELECT 'Hostname : ' || HOST_NAME "Host name",
'Instance Name : ' || INSTANCE_NAME "Instance Name",
'Started At : ' || TO_CHAR(STARTUP_TIME, 'DD-MON-YYYY HH24:MI:SS') "Startup Time",
'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) || ' seconds' "Uptime"
FROM V$INSTANCE

No comments:

Post a Comment

Command to do active duplicate for Oracle Database

1. First login to target server 2. Validate tns connectivity between Source DB and Target DB 3. Prepare and validate space availability 4. S...