Oracle Database Blog: Experiments & Learnings

November 4, 2012

Grid Infrastructure 11.2.0.3 – Connections via listener show different Time-stamp ?

Last Sunday (28 October ’12), there was a time change in NL, from Daylight savings time to Winter time. For few of our 11.2.0.3 databases, connections via listener were showing DST time, while bequeath connections were showing correct time. At Unix level, the time shown was correct. Operating system : AIX 6.1 with TL7.

%echo $TZ
 EAT-1DST,M3.5.0/2:00,M10.5.0/3:00

%grep TZ /etc/environment
TZ=EAT-1DST,M3.5.0/2:00,M10.5.0/3:00
#TZ=MET-1METDST

%ls -ltr /etc/environment
-rw-rw-r-- 1 root system 2037 Jun 20 12:36 /etc/environment

The file /etc/environment was last modified on Jun 20th, lets check when was the listener started ?

%ps -ef |grep tns
 oracle 11010136 1 0 Jun 14 - 2:27 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit
 oracle 24248480 18874570 0 21:01:04 pts/0 0:00 grep tns
%ps eww 11010136
 PID TTY STAT TIME COMMAND
 11010136 - A 2:27 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit _=/u01/app/11.2.0/grid/bin/oraagent.bin LANG=C LOGIN=oracle __CLSAGENT_INCARNATION=1... __CLSAGENT_USER_NAME=oracle ... CRS_LIMIT_CORE=unlimited TZ=MET-1METDST CRF_HOME=/u01/app/11.2.0/grid AIXTHREAD_SCOPE=S RT_GRQ=TNS_ADMIN=/u01/app/11.2.0/grid/network/admin/

-- output of above command cut short for readability.

So, the listener was started on Jun 14 with a different TZ setting. This prompted us to perform a listener restart, which corrected the environmental settings of TZ variable for listener but connections via listener still showed DST time. A quick scan of alert log on both RDBMS and ASM revealed that time was still DST. Oracle support pointed us to note 1209444.1, which points out that starting 11.2.0.2, TZ settings for grid are stored in $GRID_HOME/crs/install/s_crs_config_<node_name>_env.txt . This text file gets populated as per environmental settings during the GRID install.

To fix the problem, we changed TZ variable in the file to exact value pointed to by the OS . This was followed by GI restart. Changed file looks like this:

%more s_crsconfig_<n1>_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
TZ=EAT-1DST,M3.5.0/2:00,M10.5.0/3:00
NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1
RT_GRQ=ON
EXTSHM=OFF
TNS_ADMIN=
ORACLE_BASE=

Note: root owns this file, so only root has privileges to edit it.

For Oracle Restart environment, this grid env. settings file is also present under $GRID_HOME/crs/install directory. Any changes to this file would entail a restart of High availability services daemon.

Advertisements

2 Comments »

  1. Wanted to thank you for this – it saved me a lot of hunting to find where this seemingly random GMT time was coming from in my server!

    Comment by Martin R — June 10, 2014 @ 7:48 am

  2. I couldn’t agree more with Martin. Thank you very much

    Comment by Samuel Palukuri — June 1, 2015 @ 11:52 am


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: