Tuesday, May 29, 2012


11g Agent Crashes After Start-up / Time Zone Issue With Agent / 
Time Zone Skew Between OEM & Agent





I recently came across the issue that agent was removed from one of our cluster and was re-installed later on. However, during the re-installation the timezone was not selected properly. The timezone has to be named timezone but was not set correctly. Due to this, the moment the agent starts, it crashes. 


We tried to correct the Timezone at OS level but still the issue didn't get resolved coz the entry in emd.properties was still having the old value. 


So the value in emd.properties files needs to get updated. Following is the way to correct it...


[oracle@racnode1 config]$ echo $TZ
+05:30


[oracle@racnode1 config]$ emctl config agent getTZ
EM Configuration issue. /u01/app/oracle/product/11.2.0/dbhome_1/racnode1_ORCL not found.


[oracle@racnode1 config]$ export TZ=IST-5:30IST
[oracle@racnode1 config]$ echo $TZ
IST-5:30IST


[oracle@racnode1 config]$ emctl config agent getTZ
EM Configuration issue. /u01/app/oracle/product/11.2.0/dbhome_1/racnode1_ORCL not found.


[oracle@racnode1 config]$ /u01/app/oracle/product/11.2.0/agent11g/bin/emctl config agent getTZ
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
GMT+05:30


[oracle@racnode1 config]$ export ORACLE_HOME=/u01/app/oracle/product/11.2.0/agent11g
[oracle@racnode1 config]$ export PATH=$ORACLE_HOME/bin:$PATH
[oracle@racnode1 config]$  cd $ORACLE_HOME/bin


[oracle@racnode1 bin]$ ./emctl resetTZ agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Updating /u01/app/oracle/product/11.2.0/agent11g/sysman/config/emd.properties...
----- Mon Apr  9 16:16:21 2012::tzOffset for +05:30 is 330(min), but agent is runnning with tzOffset 390(min)
 -----
----- Mon Apr  9 16:16:21 2012::trying again after waiting for 1 sec to account for daylight transition
 -----
----- Mon Apr  9 16:16:21 2012::tzOffset for +05:30 is 330(min), but agent is runnning with tzOffset 390(min)
 -----
resetTZ failed.
The agentTZRegion in:
/u01/app/oracle/product/11.2.0/agent11g/sysman/config/emd.properties
is not in agreement with what the agent thinks it should be.
Fix your environment.
Pick a TZ value that corresponds to time zone settings listed in:
/u01/app/oracle/product/11.2.0/agent11g/sysman/admin/supportedtzs.lst


-- check the correct value from following file, find out the calcutta tz setting and set it in TZ env variable
[oracle@racnode1 bin]$ vi /u01/app/oracle/product/11.2.0/agent11g/sysman/admin/supportedtzs.lst


[oracle@racnode1 bin]$ export TZ=Asia/Calcutta


[oracle@racnode1 bin]$ ./emctl resetTZ agent
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
Updating /u01/app/oracle/product/11.2.0/agent11g/sysman/config/emd.properties...
Successfully updated /u01/app/oracle/product/11.2.0/agent11g/sysman/config/emd.properties.


Since you have successfully modified the Agent configuration, now its the time to modify the settings in the OEM Repository.


-- Login as the em repository user and run the  script:
SQL> exec mgmt_target.set_agent_tzrgn('racnode1.localdomain:3872','Asia/Calcutta')
SQL> commit; 


Log in to the repository database as SYSMAN and run (again) -
SQL> select timezone_region from mgmt_targets where target_name ='racnode1.localdomain:3872';
'Asia/Calcutta'


The above query confirms that TZ setting is correct now in OEM. 


Try to restart the agent and give few minutes to sync up. It issues should have resolved now!!


Sometimes, you may have to clear state of the agent and secure it again.

2 comments: