Solved

Oracle 11g - System Date & Time

Posted on 2013-05-30
4
718 Views
Last Modified: 2013-05-30
Hello:

Would like to have the general query command to run against an Oracle 11g database that will provide me the system date and time for the database.  I've used it before, but can't find it.  

"select * from v$instance" does work, but at one time I thought it did.  I'm using SQL Developer to run my queries and usually I have no problems with simple queries.  I've obviously not typing my command correctly.
0
Comment
Question by:akdreaming
  • 2
4 Comments
 
LVL 20

Expert Comment

by:dsacker
ID: 39209318
The SYSDATE may be what you're looking for:

select to_char(SYSDATE, 'Dy DD-Mon-YYYY HH24:MI:SS') as "Current Time"
from dual;

Open in new window

0
 
LVL 73

Accepted Solution

by:
sdstuber earned 500 total points
ID: 39209329
select sysdate from dual;  -- to the second

select systimestamp from dual; -- subsecond value with timezone
0
 

Author Closing Comment

by:akdreaming
ID: 39209359
This guy gave two bulls-eye scripts for me to run.  I was able to get what I needed.  First responder provided an error in the script, something to do about "From".  Thanks for the tip.  I'm not an true Oracle DBA, so this is very helpful.
0
 
LVL 73

Expert Comment

by:sdstuber
ID: 39209627
dsacker's post should have worked too,  the only difference between that query and mine is he formatted the output as a string where as mine returns the date value in native form, leaving it to the client to interpret/display it.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
sql query Help 12 52
Unable to save view in SSMS 21 53
PL/SQL Display based on value 4 16
Need help with fine tuning the windows batch script to change password 9 16
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

914 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now