Home » SQL & PL/SQL » SQL & PL/SQL » Database Time in Oracle 9i
Database Time in Oracle 9i [message #217106] Wed, 31 January 2007 12:34 Go to next message
Ranjeeth_ap
Messages: 4
Registered: January 2007
Junior Member
Hi
I would really appreciate if some one can some one help me in pulling the DB time for the oracle 9i.......
Re: Database Time in Oracle 9i [message #217108 is a reply to message #217106] Wed, 31 January 2007 12:39 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
select sysdate from dual;
Re: Database Time in Oracle 9i [message #217117 is a reply to message #217106] Wed, 31 January 2007 14:04 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
If your NLS_DATE_FORMAT has time in it, ebrian's answer will do, otherwise, use a TO_CHAR function against the SYSDATE in your desired format.
Re: Database Time in Oracle 9i [message #217118 is a reply to message #217108] Wed, 31 January 2007 14:08 Go to previous messageGo to next message
Ranjeeth_ap
Messages: 4
Registered: January 2007
Junior Member
Hi

I am looking for the Database time using the below query
select to_char(sysdate, 'MM/DD/YYYY HH24:MM:SS') from dual;
but my system time and the DB time is different how can i sync both
Re: Database Time in Oracle 9i [message #217120 is a reply to message #217106] Wed, 31 January 2007 14:12 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
No OS name or version
No Oracle version to 4 decimal places
>but my system time and the DB time is different how can i sync both
I don't belive this is correct, because AFAIK Oracle obtains its date/time from the OS.
Please cut & paste terminal session to prove your contention.
Re: Database Time in Oracle 9i [message #217121 is a reply to message #217120] Wed, 31 January 2007 14:16 Go to previous messageGo to next message
Ranjeeth_ap
Messages: 4
Registered: January 2007
Junior Member
SQL> select to_char(sysdate, 'MM/DD/YYYY HH24:MM:SS') from dual;

TO_CHAR(SYSDATE,'MM
-------------------
02/01/2007 01:02:35



C:\Documents and Settings\Administrator>time
The current time is: 1:45:12.65
Enter the new time:

OS - Windows 2003
DB - Oracle 9i
Re: Database Time in Oracle 9i [message #217122 is a reply to message #217121] Wed, 31 January 2007 14:19 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
sysdate will return date/time from the server, not client.
Re: Database Time in Oracle 9i [message #217123 is a reply to message #217106] Wed, 31 January 2007 14:23 Go to previous message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member

Z:\>net time /?
The syntax of this command is:


NET TIME
[\\computername | /DOMAIN[:domainname] | /RTSDOMAIN[:domainname]] [/SET]
[\\computername] /QUERYSNTP
[\\computername] /SETSNTP[:ntp server list]


Z:\>

Previous Topic: NLS SETTINGS PROBLEM
Next Topic: Last run SQL Execution Time.
Goto Forum:
  


Current Time: Sun Dec 04 06:19:59 CST 2016

Total time taken to generate the page: 0.07251 seconds