Solved

Oracle database up time

Posted on 2002-07-24
5
577 Views
Last Modified: 2010-08-05
Is there a way to figure out Oracle 8.1.7 database instance up time?
0
Comment
Question by:kishoremajji
5 Comments
 
LVL 2

Expert Comment

by:LeeMiller
ID: 7175272
select floor(sysdate - startup_time) || ' days(s) ' ||
       trunc( 24*((sysdate-startup_time) -
       trunc(sysdate-startup_time))) || ' hour(s) ' ||
       mod(trunc(1440*((sysdate-startup_time) -
       trunc(sysdate-startup_time))), 60) ||' minute(s) ' ||
       mod(trunc(86400*((sysdate-startup_time) -
       trunc(sysdate-startup_time))), 60) ||' seconds' uptime
from v$instance
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 25 total points
ID: 7175696
Here's a simpler approach to get the answer in days:

column "Days" format 9999;
select name "DB name", log_mode,
to_char(startup_time,'Dy DD-Mon-YY fmHH:fmMI:SS am') "Started",
sysdate - startup_time "Days"
from v$database, v$instance;
0
 
LVL 1

Assisted Solution

by:Ammar
Ammar earned 25 total points
ID: 7226937
Hi,
 Try the below SQL select ..

select
to_char(LOGON_TIME,'Dy dd/mm/yyyy fmHH:fmMI:SS am')
from
v$session
where
SID = 1;


Thanx,
Ammar
0
 

Expert Comment

by:modulo
ID: 7429488
Dear: Ammar

I've rejected your proposed answer as Experts Exchange holds an experiment to work without the answer button.

See:        http://www.experts-exchange.com/jsp/communityNews.jsp
Paragraph: Site Update for Wednesday, November 06, 2002

By this rejection the Asker will be notified by mail and hopefully he will take his responsibility to finalize the question or post an additional comment.
The Asker sees a button beside every post which says "Accept This Comment As Answer" (including rejected answers) -- so if he/she thinks yours is the best, you'll be awarded the points and the grade.

Thanks !

modulo

Community Support Moderator
Experts Exchange
0
 
LVL 3

Expert Comment

by:patelgokul
ID: 9392488
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
split points between ammar and markgeer
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

patelgokul
EE Cleanup Volunteer
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why doesn't the Oracle optimizer use my index? Querying too much data Most Oracle developers know that an index is useful when you can use it to restrict your result set to a small number of the total rows in a table. So, the obvious side…
This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Via a live example, show how to restore a database from backup after a simulated disk failure using RMAN.
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question