UPTIME in Oracle


Many people will have seen the various SQL's to present the 'uptime' of the database. Most seem to have dated back to Oracle 7 days where a nice complex set of joins to V$INSTANCE and the like were present.

A reasonable and much simpler alternative is to see when PMON logged on, after all, if PMON isn't running, you have more to worry about than what time your database started :-)

SELECT to_char(logon_time,'DD/MM/YYYY HH24:MI:SS')
FROM   v$session
WHERE  sid=1