The startup history is listed from the latest to the oldest one. SQL> select startup_time open_time from dba_hist_database_instance order by 1 desc To view all startup history of the database, we may extend the above query. If you found the difference of your case is only a few seconds, this is very normal for starting a database from idle to completely open. Answer: Startup information is stored in vinstance.startuptime, and uptime can be easily computed as sysdate - startuptime, but shutdown data is problematic. SQL> select max(startup_time) open_time from dba_hist_database_instance Īs you can see, the database open time was lagged about 10 minutes behind the instance startup time in this case. its because in the same server there would be some other process from srvctl either in stop/hung state - Work around is kill the crsd process which will re-spawn and will fix the above issue. Here we wait for about 10 minutes, then open the database. Database Startup Timeįor database, the startup time is actually the open time. It's the same except the state is MOUNT now. SQL> select status, startup_time from v$instance ![]() ![]() SQL> alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss' To check instance startup time, here we can query the instance under NOMOUNT state.įirst of all, we format the date time of current session. It subtracts the startup time from the current time, multiplies by 24 to. Additionally, we also check the startup history of the database in the last section of this post. ROUND((SYSDATE - startuptime) 24, 2): This calculates the database uptime in hours. To check Oracle database startup or restart time, we have to know the difference between instance startup time and database open time. SQL> SQL> SQL> SQL> select tochar(lasttime,'dd-mon-yyyy hh24:mi') shutdown, 2 tochar(starttime,'dd-mon-yyyy hh24:mi') startup, 3 round((starttime-lasttime)2460,2) minsdown, 4 round((lasttime-lag(starttime) over (order by r)),2) daysup, 5 case when (lead(r) over (order by r) is null ) 6 then round((sysdate-starttime),2) 7 end days.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |