Fixed sysdate to specific value with FIXED_DATE in Oracle

Fixed sysdate value to particular date for testing in Oracle

FIXED_DATE parameter is make the date value constant for the SYSDATE function. Default setting is NONE. This parameter is specific used for testing data for specific value without alter code which use SYSDATE function.

Change the SYSDATE with FIXED_DATE Function

SQL> select sysdate from dual;

SYSDATE
---------
21-MAY-21

SQL> ALTER SYSTEM SET FIXED_DATE='2021-01-01 12:00:00';

System altered.

SQL> select sysdate from dual;

SYSDATE
---------
01-JAN-21

Rollback the SYSDATE functionality by Setting FIXED_DATE = NONE

SQL> ALTER SYSTEM SET FIXED_DATE=NONE;

System altered.

SQL> select sysdate from dual;

SYSDATE
---------
21-MAY-21
This entry was posted in Oracle on by .
Unknown's avatar

About SandeepSingh

Hi, I am working in IT industry with having more than 15 year of experience, worked as an Oracle DBA with a Company and handling different databases like Oracle, SQL Server , DB2 etc Worked as a Development and Database Administrator.

Leave a Reply