Archive

Posts Tagged ‘Cannot start grid agent’

Oracle – The agentTZRegion value error

June 13, 2011 16 comments

The below error messages occurs when you go to manually start the grid agent on a server:

$ emctl start agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Starting agent ...... failed.
The agentTZRegion value in $ORACLE_HOME/sysman/config/emd.properties is not in agreement with what agent thinks it should be.Please verify your environment to make sure that TZ setting has not changed since the last start of the agent.
If you modified the timezone setting in the environment, please stop the agent and exectute 'emctl resetTZ agent' and also execute the script mgmt_target.set_agent_tzrgn(, ) to get the value propagated to repository.
Consult the log files in: $ORACLE_HOME/sysman/log

When you query $TZ you get something like the following:

$ echo $TZ
Africa/Tunis

When you try to run emctl resetTZ agent you get the following message:

emctl resetTZ agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Updating $ORACLE_HOME/sysman/config/emd.properties...
----- Mon Jun 13 11:45:20 2011::tzOffset for Africa/Tunis is 120(min), but agent is runnning with tzOffset 60(min)
-----
----- Mon Jun 13 11:45:20 2011::trying again after waiting for 1 sec to account for daylight transition
-----
----- Mon Jun 13 11:45:20 2011::tzOffset for Africa/Tunis is 120(min), but agent is runnning with tzOffset 60(min)
-----
resetTZ failed.
The agentTZRegion in:
$ORACLE_HOME/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:
$ORACLE_HOME/sysman/admin/supportedtzs.lst

Emd.properties shows the agentTZRegion to be correct:

$ cat emd.properties
...
agentTZRegion=Africa/Tunis

Fix the error

As the resetTZ Agent was showing a time difference of 60 minutes, I set the TZ to the following:

export TZ=Etc/GMT+1

Then run the

$ emctl resetTZ agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Updating $ORACLE_HOME/sysman/config/emd.properties...
Successfully updated $ORACLE_HOME/sysman/config/emd.properties.
Login as the em repository user and run the script:
exec mgmt_target.set_agent_tzrgn(':','Etc/GMT+1')
and commit the changes
This can be done for example by logging into sqlplus and doing
SQL> exec mgmt_target.set_agent_tzrgn('':'','Etc/GMT+1')
SQL> commit

Log onto the Grid Agent database and run the sql script as above.
Now when you go to start grid agent it should start successfully:

$ emctl start agent
Oracle Enterprise Manager 10g Release 5 Grid Control 10.2.0.5.0.
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
Starting agent ........ started.

Advertisements