April 04, 2025

Oracle Database timezone update

How to update Oracle Database Time Zone:

First make a note of the existing timezone with the below query.


select SYSTIMESTAMP, current_TIMESTAMP from dual;


select to_char(sysdate,'DD-MON-YYYY HH24:MI:SS') from dual;

==================================================

To change timezone:(OS Level)

$tzselect

$timedatectl set-timezone <new_time_zone>

==================================================


Steps to be followed to change DBTIMEZONE:

=============================================================


SQL> SELECT SESSIONTIMEZONE, DBTIMEZONE FROM DUAL;

SESSIONTIMEZONE         DBTIME
----------------        ------
-06:00                  -07:00

SQL> ALTER DATABASE SET TIME_ZONE='Canada/Mountain';

Database altered.

SQL> ALTER DATABASE SET TIME_ZONE='-06:00';

Database altered.

SQL> shutdown immediate;

SQL> Startup;

SQL> SELECT SESSIONTIMEZONE, DBTIMEZONE FROM DUAL;

SESSIONTIMEZONE         DBTIME
------------------      -----------
-06:00                  -06:00

No comments:

Post a Comment

If you have any queries/ any suggestion please do comment and let me know.

Recent Post

Increase Java Heap memory for OEM

 There are certain times when we observer OEM is performing slow or even unable to startup the Admin Server or OMS Server. We can look into ...