em启动/关闭报错解决

[oracle@localhost ~]$ emctl start dbconsole

TZ set to PRC

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 (US/Pacific) in

/home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid/sysman/config/emd.properties

does not match the current environment TZ setting(PRC).

The dbconsole cannot run with this mismatch.

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

If US/Pacific 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.

根据提示执行:

[oracle@localhost ~]$ emctl resetTZ agent

TZ set to PRC

Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.

Updating /home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid/sysman/config/emd.properties...

Time zone set to PRC.

To complete this process, you must either:

connect to the database served by this DBConsole as user 'sysman', and execute:

SQL> exec mgmt_target.set_agent_tzrgn('localhost.localdomain:3938','PRC')

-- or --

connect to the database served by this DBConsole as user 'sys', and execute:

SQL> alter session set current_schema = SYSMAN;

SQL> exec mgmt_target.set_agent_tzrgn('localhost.localdomain:3938','PRC')

用sysdba连接到oracle:

[oracle@localhost ~]$ sqlplus sys/lubinsu as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Sun Mar 31 16:43:05 2013

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to:

Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production

With the Partitioning, OLAP and Data Mining options

SQL> alter session set current_schema = SYSMAN;

Session altered.

SQL> exec mgmt_target.set_agent_tzrgn('localhost.localdomain:3938','PRC');

PL/SQL procedure successfully completed.

OK,再重启一次,成功:

[oracle@localhost ~]$ emctl start dbconsole

TZ set to PRC

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

Starting Oracle Enterprise Manager 10g Database Control ........................... started.

------------------------------------------------------------------

Logs are generated in directory /home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid/sysman/log

[oracle@localhost ~]$ cat /home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid/sysman/log

cat: /home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid/sysman/log: Is a directory


这里可以很直观地看到Oracle的性能分析,对数据库进行维护。

但是问题又来了,关闭dbconsole的时候接连报下面的错误:

[oracle@localhost log]$ emctl stop dbconsole

TZ set to PRC

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的进程,将他们都kill掉

[oracle@localhost log]$ ps -ef | grep oc4j

oracle 9799 9774 4 16:44 pts/1 00:01:15 /home/oracle/oracle/product/10.2.0/db_1/jdk/bin/java -server -Xmx256M -XX:MaxPermSize=96m -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=40 -DORACLE_HOME=/home/oracle/oracle/product/10.2.0/db_1 -Doracle.home=/home/oracle/oracle/product/10.2.0/db_1/oc4j -Doracle.oc4j.localhome=/home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid/sysman -DEMSTATE=/home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid -Doracle.j2ee.dont.use.memory.archive=true -Djava.protocol.handler.pkgs=HTTPClient -Doracle.security.jazn.config=/home/oracle/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_orclsid/config/jazn.xml -Djava.security.policy=/home/oracle/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_orclsid/config/java2.policy -Djava.security.properties=/home/oracle/oracle/product/10.2.0/db_1/oc4j/j2ee/home/config/jazn.security.props -DEMDROOT=/home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid -Dsysman.md5password=true -Drepapi.oracle.home=/home/oracle/oracle/product/10.2.0/db_1 -Ddisable.checkForUpdate=true -Djava.awt.headless=true -jar /home/oracle/oracle/product/10.2.0/db_1/oc4j/j2ee/home/oc4j.jar -config /home/oracle/oracle/product/10.2.0/db_1/oc4j/j2ee/OC4J_DBConsole_localhost.localdomain_orclsid/config/server.xml

oracle 17085 5048 0 17:10 pts/1 00:00:00 grep oc4j

[oracle@localhost log]$ ps -ef | grep dbconsole

oracle 9774 1 0 16:44 pts/1 00:00:00 /home/oracle/oracle/product/10.2.0/db_1/perl/bin/perl /home/oracle/oracle/product/10.2.0/db_1/bin/emwd.pl dbconsole /home/oracle/oracle/product/10.2.0/db_1/localhost.localdomain_orclsid/sysman/log/emdb.nohup

oracle 17105 5048 0 17:10 pts/1 00:00:00 grep dbconsole

[oracle@localhost log]$ kill -9 9774

[oracle@localhost log]$ ps -ef | grep dbconsole

oracle 17138 5048 0 17:10 pts/1 00:00:00 grep dbconsole

然后执行emctl stop agent和emctl stop dbconsole即可:

[oracle@localhost log]$ emctl stop agent

TZ set to PRC

Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0

Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.

Stopping agent ... stopped.

[oracle@localhost log]$ emctl stop dbconsole

TZ set to PRC

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值