Tuesday, December 22, 2015

Database present status

SELECT SYSDATE-logon_time "Days", (SYSDATE-logon_time)*24 "Hours", status
from  sys.v_$session where  sid=1

SELECT DECODE(TRUNC(SYSDATE - LOGON_TIME), 0, NULL, TRUNC(SYSDATE - LOGON_TIME) || ' Days' || ' + ') || TO_CHAR(TO_DATE(TRUNC(MOD(SYSDATE-LOGON_TIME,1) * 86400), 'SSSSS'),'HH24:MI:SS') UPTIME FROM v$session WHERE SID = 1;

No comments:

Post a Comment