Oracle Uptime Query Oracle Uptime Query oracle oracle

Oracle Uptime Query


Try this. It doesn't require an admin user, although SELECT access to the v_$instance table.

SELECT to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') "DB Startup Time"FROM sys.v_$instance;

Or, if you assume that PMON startup time is the same as the database startup time, you can get the uptime like this:

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


Your question specifies "non admin user" so I'm afraid the answer is probably no. The usual mechanisms require selecting from V$ views - V$INSTANCE or V$SESSION. Neither of these are granted to PUBLIC by default.

If you ask your DBA nicely they might be prepared to grant you access to those views, or at least write a wrapping function (or functions) to expose those values.


The PMON's sid is not always equal to 1. So it is better to use the query:

SELECT t.LOGON_TIME FROM v$session t where upper(t.PROGRAM) like ('%PMON%')

it works for 11.2.0.4 and 12.1.0.2 on solaris and linux redhat.