Search This Blog

Saturday, February 3, 2007

Oracle Server Time

when we access oracle server from CLIENT then date and time come from Oracle Server Machine not from Oracle client machine.


E:\>sqlplus "scott/tiger@hgc"
SQL*Plus: Release 10.1.0.2.0 - Production on Thu Feb 1 17:12:23 2007
Copyright (c) 1982, 2004, Oracle.
All rights reserved.
Connected to:Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> alter session set nls_date_format = 'dd-mon-yyyy hh24:mi:ss';
Session altered.

SQL> select sysdate from dual;
SYSDATE
--------------------
01-feb-2007 16:13:00---->Server Machine time ( Oracle Server)

SQL> host time
The current time is: 17:12:35.56--> my local machine time ( Oracle Client)
Enter the new time:



NO need to restart Oracle Server when you change OS time ( LOCAL MACHINE).



E:\>sqlplus "sys as sysdba"
SQL*Plus: Release 10.1.0.2.0 - Production on Thu Feb 1 17:14:18 2007
Copyright (c) 1982, 2004, Oracle.
All rights reserved.
Enter password:
Connected to:Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> alter session set nls_date_format = 'dd-mon-yyyy hh24:mi:ss';
Session altered.

SQL> select sysdate from dual;
SYSDATE
--------------------
01-feb-2007 17:14:24

SQL> host time
The current time is: 17:14:26.62
Enter the new time:

SQL>--change my OS machine time from 17:14 to 16:14.

SQL> select sysdate from dual;
SYSDATE
--------------------
01-feb-2007 16:14:42

SQL> host time
The current time is: 16:14:44.80
Enter the new time:

No comments: