Mastering Date Manipulation in Oracle Database: Oracle change sysdate Tips and Tricks

In this tutorial

How to change sysdate for Oracle Database server. Oracle gets the system day from OS server data. You can change Oracle SYSDATE for testing.

In Oracle Database, the SYSDATE function returns the current date and time of the database server. However, you cannot directly change the value of SYSDATE as it is a read-only function that always provides the current timestamp. It reflects the system time when the query or statement is executed.

If you want to manipulate or change dates in Oracle, you can use various date manipulation functions and arithmetic operations. For example, you can use the ADD_MONTHS, TO_DATE, TRUNC, DATEADD, and other functions to perform date calculations and transformations.

Oracle change sysdate Tips and Tricks

Oracle change SYSDATE.

SQL> ALTER SYSTEM SET fixed_date = '2018-01-28-13:00:00' SCOPE = MEMORY;
  • Compatibility and Availability: The use of fixed_date is available only in Oracle Database releases before Oracle Database 21c. Starting from Oracle Database 21c, the fixed_date parameter has been desupported and cannot be used to alter the system date and time.
  • Scope: The SCOPE parameter determines whether the change takes effect immediately (MEMORY scope) or at the next database startup (SPFILE scope).
  • Format: The fixed_date parameter expects the date and time in the YYYY-MM-DD-HH24:MI:SS format.
  • Privileges: Modifying system parameters typically requires administrative privileges, such as the ALTER SYSTEM privilege.

Oracle Reset SYSDATE

SQL> ALTER SYSTEM SET fixed_date=NONE;

Beware! Changing Oracle sysdate for testing. After you can reset sysdate for the Oracle database server.

Checking the change SYSDATE Oracle.

SQL> select sysdate from dual;

Conclusion

You have used Oracle change sysdate for testing. My topic is another  “Install Oracle Database 12c on Centos 7”. I hope will this your helpful.

About HuuPV

My name is Huu. I love technology, especially Devops Skill such as Docker, vagrant, git, and so forth. I like open-sources, so I created DevopsRoles.com to share the knowledge I have acquired. My Job: IT system administrator. Hobbies: summoners war game, gossip.
View all posts by HuuPV →

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.