emctl stop dbconsole
先设置操作系统的TZ参数:
export TZ=Asia/Shanghai
重设EM agent的时区
emctl resettz agent
执行返回如下:
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
Updating /app/oracle/ora11g/order2db01_order2db/sysman/config/emd.properties...
Successfully updated /app/oracle/ora11g/order2db01_order2db/sysman/config/emd.properties.
Login as the em repository user and run the script:
exec mgmt_target.set_agent_tzrgn('order2db01:3938','Asia/Shanghai')
and commit the changes
This can be done for example by logging into sqlplus and doing
SQL> exec mgmt_target.set_agent_tzrgn('order2db01:3938','Asia/Shanghai')
SQL> commit
需要进入数据库设置SYSMAN下的内容,手动执行以下内容。
sqlplus "/as sysdba"
alter session set current_schema = SYSMAN;
exec mgmt_target.set_agent_tzrgn('order2db01:3938','Asia/Shanghai');
exec mgmt_target.set_agent_tzrgn('order2db02:3938','Asia/Shanghai');
启动dbconsole
emctl start dbconsole
启动之后执行以下命令,看看是否没有报错:
emctl upload agent
正确的返回:
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload completed successfully
错误的返回
Oracle Enterprise Manager 11g Database Control Release 11.2.0.3.0
Copyright (c) 1996, 2011 Oracle Corporation. All rights reserved.
---------------------------------------------------------------
EMD upload error: Failed to upload file A0000001.xml: Fatal Error.
Response received: 500|ORA-20603: Updating timezone region of a target is not supported. Use mgmt_target.set_agent_tzrgn() API to modify the timezone region.(target name = order2db01:3938)(target type = oracle_emd)(new tzrgn = Asia/Shanghai)(old tzrgn = Africa/Casablanca)
ORA-06512: at "SYSMAN.CHECK_DUPLICATE_TARGETS", line 92
ORA-04088: error during execution of trigger 'SYSMAN.CHECK_DUPLICATE_TARGETS'