1. 程式人生 > >GC啟動 agent失敗:時區不一致

GC啟動 agent失敗:時區不一致

時區問題

[[email protected] bin]$ ./emctl start agent

Oracle Enterprise Manager 10g Release 10.2.0.1.0.
Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
Starting agent ….. failed.
The agentTZRegion value in /oinstall/agent10g/agent10g/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: /oinstall/agent10g/agent10g/sysman/log

看到是因為時區的資訊與配置檔案中的不一致了,修改emd.properties中的時區與之前的時區一致,啟動正常,時區的設定對於agent很重要,要是兩者的時區不一致或沒有,會導致agent無法上傳檔案資訊。

問題原因:裝系統時時區隨意選擇,導致時區不一致

解決方法
linux系統修改系統時間與時區
時區設定:
1、 tzselect:(root下操作)
執行tzselect命令–>選擇Asia–>選擇China–>選擇east China - Beijing, Guangdong, Shanghai, etc–>然後輸入1。
執行完tzselect命令選擇時區後,時區並沒有更改,
2、在命令最後提示你可以執行TZ=’Asia/Shanghai’; export TZ

並將這行命令新增到.bash_profile中,然後退出並重新登入。
[[email protected]dg2 ~]# vi .bash_profile
TZ=’Asia/Shanghai’; export TZ
參考date命令看到的結果,最終時區顯示為CST,即中國標準時間。
3、 修改配置檔案來修改時區
修改/etc/sysconfig/clock
ZONE=Asia/Shanghai
4、rm /etc/localtime
5、連結到上海時區檔案
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
執行完上述過程後,重啟機器,即可看到時區已經更改。

6、[[email protected]dg2 config]$ pwd
/u01/app/oracle/product/11.2.0/db_1/sysman/config
[[email protected]dg2 config]$ cat emd.properties
**# PLEASE PUT THEM INTO PROPERTY SECTION (READ ONLY OR MODIFIABLE PROPS
################################**
altNmo=/u01/app/oracle/product/11.2.0/db_1/sysman/config/bin/recv
agentTZRegion=Asia/Shanghai
即時區的資訊與配置檔案中的一致
dg1如dg2一樣
所有的時區保持一致,則重啟agent
[[email protected] bin]$ ./emctl start agent
就不會報錯了