Andre Spadini
André Spadini | MultiCloud | DBA

André Spadini | MultiCloud | DBA

Oracle: Time Zone Oracle Database RAC

Oracle: Time Zone Oracle Database RAC

Andre Spadini's photo
Andre Spadini
·Aug 13, 2021·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

How to change the Time Zone in Oracle Database Hosted in OCI with an Example (Doc ID 2459830.1 )

Verify the TZ value set in the database level using srvctl

[opc@dbora ~]$ sudo su - oracle  
[oracle@dbora ~]$ srvctl getenv database -d orcl_NOME_DA_INSTANCIA 

        CCM_iad1zs: 

        ORACLE_UNQNAME=CCM_iad1zs 

        TZ=UTC

Changed the TZ value to desired Time Zone

 [oracle@dbora ~]$ srvctl setenv database -d orcl_NOME_DA_INSTANCIA -T "TZ=America/Sao_Paulo" 

[oracle@dbora ~]$ srvctl getenv database -d CCM_aaa34 
CCM_iad1zs: 
ORACLE_UNQNAME=CCM_iad1zs 
TZ=America/Sao_Paulo

After making the changes, restart the cluster services

[opc@dbora ~]$ sudo su -  
[root@dbora ~]# cd /u01/app/12.2.0.1/grid/bin 
[root@dbora ~]# ./crsctl stop cluster 
[root@dbora ~]#  ./crsctl start cluster

Test

[opc@dboraccm ~]$ sudo su - oracle 
[oracle@dboraccm ~]$ sqlplus system/passccmoracle@orclto 
SQL > select to_char(sysdate,'YYYY-MON-DD hh24:mi:ss') from dual;

Abs!

 
Share this