Tuesday, June 4, 2013

Oracle RAC Timezone woes and solution

Recently had a timezone issue with an Oracle 11gR2 RAC cluster. Even though I had set the host time and date, for some reason it did not get propagated to the Oracle RAC configuration.

There are couple of ways to set timezone for an Oracle 11.2 RAC cluster. First is the easy way by using srvctl commands:

srvctl setenv database -d -T =

srvctl setenv database -d racdb -T TZ=US/Eastern

In the first case, if this did not work, we need to edit a configuration file called s_crsconfig_{racnodename}_env.txt located under the $GRID_HOME/crs/install directory.

Here is my example for the edits performed of the above file on both RAC nodes, using first node as sample:

[root@racnode1$ vi /oracle/11.2.0/grid/crs/install/s_crsconfig_racnode1_env.txt

### This file can be used to modify the NLS_LANG environment variable, which determines the charset to be used for messages.

### For example, a new charset can be configured by setting NLS_LANG=JAPANESE_JAPAN.UTF8

### Do not modify this file except to change NLS_LANG, or under the direction of Oracle Support Services





Restart the Oracle 11.2 Clusterware services and database and run srvctl to confirm setting changes.


Aaron Diehl said...

Thank you Ben. Your second solution was a great help! I was changing from Eastern to Central time zone. I set TZ=America/Chicago in each node's crs config file like what was needed for the OS where /etc/localtime is linked to /usr/share/zoneinfo/America/Chicago.


Aravind Kumar said...

Thank you very much Ben !!!!
Your second solution of editing the config.txt file fixed our issue. After restart of cluster all came up as expected in Pacific timezone.

Thank you!!!!

skymaster said...

You are most welcome. Always glad that my tips helped solve your pain points.

Happy holidays!