Archive for April, 2019

Changing the Timezone for a particular Database *only* in a RAC

April 16th, 2019 No comments

Sometimes there are requests that multiple databases running on the same RAC return different time values — so they must run in different time zones.

This goal cannot achieved by changing the server time zone because that would affect ALL databases.

The solution is fairly simple:

bash-4.2$ srvctl setenv database -db ORCL -env "TZ=CET-1"
bash-4.2$ srvctl stop database -d ORCL
bash-4.2$ srvctl start  database -d ORCL

This effectively changes the environment variables in the clusterware for this particular database:


bash-4.2$ sqlplus c##ronny/ronny@ORCL

SQL*Plus: Release - Production on Wed Feb 6 09:29:03 2019


Copyright (c) 1982, 2018, Oracle.  All rights reserved.

Connected to:

Oracle Database 18c Enterprise Edition Release - Production


SQL> select to_char(sysdate, 'HH24:MI') from dual;


SQL> !date

Wed Feb  6 09:29:16 CET 2019

Note that this only works if you connect via SQLNet. Local connetions are unaffected!

Categories: Oracle in general Tags: