Displays DB start time, and calculates how long the DB has been up.
Code:
set head off pages 0
Select
'Current System time and date is '||
To_Char(sysdate,'HH24:MI:SS " on " ddth
FMMonth YYYY')||chr(10)||'Database
'||NAME||' has been up since '||
To_Char(To_Date(a.value||b.value,'JSSSSS')
,'HH24:MI:SS " on " ddth FMMonth YYYY')
||chr(10)||' ( Which is
'||Trunc(sysdate-to_date(a.value||b.value,'JSSSSS'))||' days '||To_Char(To_Date(trunc(86400*(
(sysdate-to_date(a.value||b.value,'JSSSSS')
)-trunc(sysdate-to_date(a.value||b.value,'JSSSS'
)))),'SSSSS')
,'HH24 "hours" MI "mins and" SS "seconds )"')
from v$instance a,v$instance b,v$database
where a.key='STARTUP TIME - JULIAN'
and b.key='STARTUP TIME - SECONDS';
Welcome to the GEEK world, best place where you find topic about latest cutting edge technology on website and mobile. Learn and grow your knowledge with the information and tutorials about Website designing, CSS tutorials, Java Script tutorials, Ruby tutorials, ROR tutorials, HTML tutorials, HTML5 , JQuery, Javascript tutorials, Photoshop tutorials, Flash, games tutorials, Cheat sheets, Design tools, Action Scripts as well as MySql, Oracle and many more in a easy way to use and understand.
No comments:
Post a Comment