Search This Blog

Monday, July 27, 2009

How to set sysdate in Oracle Database

Hi,

Usually SYSDATE depands on OS date but if we need to set or fixed sysdate any other date from current sysdate then we can achieve this task by one parameter at system level.

FIXED_DATE parameter name.

Value = Date / NONE

SQL> select sysdate from dual;
SYSDATE

---------

27-JUL-09

SQL> alter system set fixed_date='25-FEB-09';
System altered.

SQL> select sysdate from dual;
SYSDATE

---------

25-FEB-09

SQL> alter system set fixed_date='none';
System altered.

SQL> select sysdate from dual;
SYSDATE

---------

27-JUL-09
SQL>

2 comments:

rajeshkumar govindarajan said...

we can also see the sysdate by using os command in sql prompt
SQL> !date
Thu Jul 30 10:23:10 IST 2009

am rajesh,i am same like u taj, my blog id
www.oracleinstance.blogspot.com
email id:grajeshkumar82@gmail.com

Babu said...

Excellent Taj