在linux下啓動oracle oem和遇到的錯誤解決(時區問題和oem無法關閉)

啓動oem命令: emctl start dbconsole

關閉oem命令: emctl stop dbconsole

查看oem狀態命令 :   emctl status dbconsole


出現的問題1:報時區不對,具體描述如下:

emctl start dbconsole

TZ set to US/Pacific
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication

Timezone mismatch: The agentTZRegion value (GMT) in
 /u01/app/oracle/oracle/product/10.2.0/db_4/localhost.localdomain_orcl/sysman/config/emd.properties
does not match the current environment TZ setting(US/Pacific).
The dbconsole cannot run with this mismatch.

If GMT is the correct timezone, set your timezone environment variable to GMT and repeat the 'emctl start dbconsole' operation.

If GMT is not the correct timezone, make sure that the timezone in your environment is correct, and then run the following command in your local Oracle Home: 'emctl resetTZ agent'

The output of this command will include detailed instructions to follow, to correct the mismatch.


解決方法1:

切換到root下
修改
vi
/u01/app/oracle/oracle/product/10.2.0/db_4/localhost.localdomain_orcl/sysman/config/emd.properties

在最後一行添加 agentTZRegion=Asia/Shanghai


修改 /etc/sysconfig/clock 文件

添加 ZONE="Asia/Shanghai"




 
方法2:

[oracle@localhost bin]$ export TZ=RPC
[oracle@localhost bin]$ emctl config agent getTZ
[oracle@localhost bin]$ emctl config agent updateTZ
[oracle@localhost bin]$ emctl start agent
[oracle@localhost bin]$ emctl start dbconsole

代碼如下所示:

[oracle@localhost bin]$  export TZ=RPC
[oracle@localhost bin]$  emctl config agent getTZ
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
GMT
[oracle@localhost bin]$ emctl config agent updateTZ
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
[oracle@localhost bin]$ emctl start agent
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
Starting agent .... started.
[oracle@localhost bin]$ emctl start dbconsole
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication
Agent Version     : 10.1.0.4.1
OMS Version       : Unknown
Protocol Version  : 10.1.0.2.0
Agent Home        : /u01/app/oracle/oracle/product/10.2.0/db_4/localhost.localdomain_orcl
Agent binaries    : /u01/app/oracle/oracle/product/10.2.0/db_4
Agent Process ID  : 26061
Parent Process ID : 26054
Agent URL         : http://localhost.localdomain:3938/emd/main
Started at        : 2012-10-28 10:48:57
Started by user   : oracle
Last Reload       : 2012-10-28 10:48:57
Last successful upload                       : (none)
Last attempted upload                        : (none)
Total Megabytes of XML files uploaded so far :     0.00
Number of XML files pending upload           :        3
Size of XML files pending upload(MB)         :     0.01
Available disk space on upload filesystem    :    39.80%
Agent is already started. Will restart the agent
Stopping agent .... stopped.
Starting Oracle Enterprise Manager 10g Database Control ...................... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/oracle/product/10.2.0/db_4/localhost.localdomain_orcl/sysman/log
[oracle@localhost bin]$


到這裏,已經可以再瀏覽器裏看到oem界面了,可是關閉的時候卻又錯了

[oracle@localhost ~]$ emctl stop dbconsole
TZ set to US/Pacific
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
--- Failed to shutdown DBConsole Gracefully ---
 failed.

解決辦法:殺掉oc4j 和dbconsole進程,然後就可以了

[oracle@localhost ~]$ ps -ef|grep oc4j
oracle     535 31048  0 04:05 pts/3    00:00:00 grep oc4j
[oracle@localhost ~]$ ps -ef|grep dbconsole
oracle     609 31048  0 04:06 pts/3    00:00:00 grep dbconsole

[oracle@localhost ~]$ emctl stop dbconsole
TZ set to US/Pacific
Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0  
Copyright (c) 1996, 2005 Oracle Corporation.  All rights reserved.
http://localhost.localdomain:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 10g Database Control ...
 ...  Stopped.

ok  問題都解決了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章