Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Oracle 11g - System Date & Time

Posted on 2013-05-30
4
Medium Priority
?
735 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 74

Accepted Solution

by:
sdstuber earned 2000 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 74

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

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

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

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Via a live example, show how to take different types of Oracle backups using RMAN.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

722 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