解决2011年及之后Oracle 10G EM无法启动问题

来源:互联网 发布:genbank数据库查询方式 编辑:程序博客网 时间:2024/05/08 17:04
 

 

1       解决2011年及之后EM无法启动问题

         最近在搭一个linux虚拟机环境学习oracle,在进行手工建库后创建EM时报错了,EM无法启动。在今年的一个项目的RAC环境中好像也是EM无法启动,但实际可以登录进行访问,但一直没想到是什么原因。记得去年也是用同样的方法创建的数据库,EM好像就可以正常使用。于是上网查了一下,发现居然是oracle的一个BUG,遇到了OEM bug 8350262,需要打补丁进行解决。

         原因为The Root Certificate Authority (CA) expired on 31-DEC-2010 00:00:0 root授权信息过期导致。

参考:http://blog.csdn.net/tianlesoftware/article/details/6568690

           http://blog.csdn.net/makaveli/article/details/6135514

 

解决该问题步骤

    如果是在创建实例之前就把该patch给打上了,那么在创建OEM的时候不会受影响。

   

    如果是已经报错了,解决步骤如下:

 

For Single Instance:

1. 使用Opatch 安装Patch 8350262

2. force stop the Database Control (dbconsole) process using the killDBConsole script bundled with the patch. Note that the dbconsole process cannot be stopped using the emctl stop dbconsole command, as EMCTL is unable to connect to the process.

    (1)Set the ORACLE_HOME and ORACLE_SID environment variables.

    (2)Execute <PATCH_HOME>/killDBConsole.

    --windows 平台省略这一步

3.  Re-secure Database Control with the following command:
    <ORACLE_HOME>/bin/emctl secure dbconsole -reset

4.  Re-start Database Control with the following command:
    <ORACLE_HOME>/bin/emctl start dbconsole

 

 

For RAC Instance:

1. 使用Opatch 安装Patch 8350262, 在一个节点安装就ok了。

2.  force stop the Database Control (dbconsole) process by executing the killDBConsole script bundled with the patch on each node in the cluster

    在所有节点执行

    (1)Set the ORACLE_HOME and ORACLE_SID environment variables.

    (2)Execute <PATCH_HOME>/killDBConsole.

    --windows 平台省略这一步

3. Re-secure Database Control on the first cluster node with the following command:
    <ORACLE_HOME>/bin/emctl secure dbconsole -reset

4. Re-secure Database Control on the remaining cluster nodes with the following command. Note that the -reset switch is not included with this command:
    <ORACLE_HOME>/bin/emctl secure dbconsole

5.  Re-start Database Control by executing the following command on each node in the cluster:
    <ORACLE_HOME>/bin/emctl start dbconsole

 

1.1     下载补丁并打补丁

[root@OracleDb ~]# mkdir /opatch

用FTP工具将补丁上传到/opatch目录

 

[root@OracleDb ~]# ls -l /opatch

total 40

-rw-r----- 1 root root 40488 Nov 15 09:09 p8350262_10204_Generic.zip

[root@OracleDb ~]#  chown -R oracle:oinstall /opatch

[root@OracleDb ~]# cd /opatch

[root@OracleDb opatch]# unzip p8350262_10204_Generic.zip

Archive:  p8350262_10204_Generic.zip

   creating: 8350262/

  inflating: 8350262/killDBConsole  

   creating: 8350262/files/

   creating: 8350262/files/sysman/

   creating: 8350262/files/sysman/jlib/

   creating: 8350262/files/sysman/jlib/emCORE.jar/

   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/

   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/

   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/

   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/

   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/

  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class 

   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/

  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class 

  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class 

   creating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/

  inflating: 8350262/files/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class 

   creating: 8350262/files/sysman/jlib/emd_java.jar/

   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/

   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/

   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/

   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/

   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/

  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class 

   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/

  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class 

  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class 

   creating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/

  inflating: 8350262/files/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class 

  inflating: 8350262/killDBConsole.pl 

  inflating: 8350262/README.txt      

   creating: 8350262/etc/

   creating: 8350262/etc/xml/

  inflating: 8350262/etc/xml/ShiphomeDirectoryStructure.xml 

  inflating: 8350262/etc/xml/GenericActions.xml 

   creating: 8350262/etc/config/

  inflating: 8350262/etc/config/inventory 

  inflating: 8350262/etc/config/actions 

 

[root@OracleDb opatch]# ls

8350262  p8350262_10204_Generic.zip

 

[oracle@OracleDb ~]$ cd /opatch

[oracle@OracleDb opatch]$ ls

8350262  p8350262_10204_Generic.zip

[oracle@OracleDb opatch]$ cd 8350262

[oracle@OracleDb 8350262]$ ls

etc  files  killDBConsole  killDBConsole.pl  README.txt

 

         打补丁

[oracle@OracleDb 8350262]$ $ORACLE_HOME/OPatch/opatch apply

Invoking OPatch 10.2.0.4.2

 

Oracle Interim Patch Installer version 10.2.0.4.2

Copyright (c) 2007, Oracle Corporation.  All rights reserved.

 

 

Oracle Home       : /oracle/product/10.2.0/db_1

Central Inventory : /oracle/oraInventory

   from           : /etc/oraInst.loc

OPatch version    : 10.2.0.4.2

OUI version       : 10.2.0.4.0

OUI location      : /oracle/product/10.2.0/db_1/oui

Log file location : /oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-11-15_09-46-37AM.log

 

ApplySession applying interim patch '8350262' to OH '/oracle/product/10.2.0/db_1'

 

Running prerequisite checks...

 

OPatch detected non-cluster Oracle Home from the inventory and will patch the local system only.

 

Backing up files and inventory (not for auto-rollback) for the Oracle Home

Backing up files affected by the patch '8350262' for restore. This might take a while...

Backing up files affected by the patch '8350262' for rollback. This might take a while...

 

Patching component oracle.sysman.agent.core, 10.2.0.4.0a...

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/RootCert.class"

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emCORE.jar" with "/sysman/jlib/emCORE.jar/oracle/sysman/eml/sec/util/SecConstants.class"

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/fsc/FSWalletUtil.class"

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/rep/RepWalletUtil.class"

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/RootCert.class"

Updating jar file "/oracle/product/10.2.0/db_1/sysman/jlib/emd_java.jar" with "/sysman/jlib/emd_java.jar/oracle/sysman/eml/sec/util/SecConstants.class"

ApplySession adding interim patch '8350262' to inventory

 

Verifying the update...

Inventory check OK: Patch ID 8350262 is registered in Oracle Home inventory with proper meta-data.

Files check OK: Files from Patch ID 8350262 are present in Oracle Home.

 

OPatch succeeded.

 

         检查补丁

[oracle@OracleDb 8350262]$ $ORACLE_HOME/OPatch/opatch lsinventory –detail –oh $ORACLE_HOME

Invoking OPatch 10.2.0.4.2

 

Oracle Interim Patch Installer version 10.2.0.4.2

Copyright (c) 2007, Oracle Corporation.  All rights reserved.

 

 

Oracle Home       : /oracle/product/10.2.0/db_1

Central Inventory : /oracle/oraInventory

   from           : /etc/oraInst.loc

OPatch version    : 10.2.0.4.2

OUI version       : 10.2.0.4.0

OUI location      : /oracle/product/10.2.0/db_1/oui

Log file location : /oracle/product/10.2.0/db_1/cfgtoollogs/opatch/opatch2011-11-15_15-04-57PM.log

 

Lsinventory Output file location : /oracle/product/10.2.0/db_1/cfgtoollogs/opatch/lsinv/lsinventory2011-11-15_15-04-57PM.txt

 

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

Installed Top-level Products (2):

 

Oracle Database 10g                                                  10.2.0.1.0

Oracle Database 10g Release 2 Patch Set 3                            10.2.0.4.0

There are 2 products installed in this Oracle Home.

 

 

Interim patches (1) :

 

Patch  8350262      : applied on Tue Nov 15 09:48:19 CST 2011

   Created on 14 Sep 2010, 04:59:44 hrs PST8PDT

   Bugs fixed:

     8350262

 

 

 

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

 

OPatch succeeded.

 

1.2     停止DBCONSOLE

         按照步骤做下去没有成功,不知道什么原因,没仔细去研究,想到了重建EM,结果重建EM成功了。

         以前有碰到过用emctl stop dbconsole无法停止EM的情况,刚好上面的补丁中带了一个杀EM进程的程序,所以直接使用

[root@OracleDb ~]# su - oracle

[oracle@OracleDb ~]$ cd /opatch

[oracle@OracleDb opatch]$ ls

8350262  p8350262_10204_Generic.zip

[oracle@OracleDb opatch]$ cd 8350262

[oracle@OracleDb 8350262]$ ls

etc  files  killDBConsole  killDBConsole.pl  README.txt

[oracle@OracleDb 8350262]$ ./killDBConsole

ORACLE_HOME=/oracle/product/10.2.0/db_1

ORACLE_SID=afc

State directory = /oracle/product/10.2.0/db_1/OracleDb_afc

WatchDog PID  = 7831

DBconsole PID = 7856

EMAgent PID   = 8930

Killing WatchDog (pid=7831) ...

Successfully killed process 7831

Killing DBConsole (pid=7856) ...

Successfully killed process 7856

Killing EMAgent (pid=8930) ...

Successfully killed process 8930

1.3     删除数据库的 Database Control设置

[oracle@OracleDb 8350262]$ emca -deconfig dbcontrol db -repos drop

 

STARTED EMCA at Nov 15, 2011 1:54:31 PM

EM Configuration Assistant, Version 10.2.0.1.0 Production

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

 

Enter the following information:

Database SID: afc

Listener port number: 1521

Password for SYS user: 

Password for SYSMAN user: 

 

Do you wish to continue? [yes(Y)/no(N)]: y

Nov 15, 2011 1:54:45 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/afc/emca_2011-11-15_01-54-30-PM.log.

Nov 15, 2011 1:54:48 PM oracle.sysman.emcp.util.DBControlUtil stopOMS

INFO: Stopping Database Control (this may take a while) ...

Nov 15, 2011 1:55:16 PM oracle.sysman.emcp.EMReposConfig dropRepository

INFO: Dropping the EM repository (this may take a while) ...

Nov 15, 2011 1:58:01 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully dropped

Enterprise Manager configuration completed successfully

FINISHED EMCA at Nov 15, 2011 1:58:02 PM

1.4     删除早期DBCONSOLE创建的用户和对象

sql>drop role MGMT_USER;

sql>drop user MGMT_VIEW cascade;

sql>drop user sysman cascade;

sql>drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS;

sql>drop PUBLIC SYNONYM SETEMVIEWUSERCONTEXT;

1.5     重新创建DBCONSOLE

[oracle@OracleDb 8350262]$ emca -config dbcontrol db -repos create

 

STARTED EMCA at Nov 15, 2011 2:01:05 PM

EM Configuration Assistant, Version 10.2.0.1.0 Production

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

 

Enter the following information:

Database SID: afc

Listener port number: 1521

Password for SYS user: 

Password for DBSNMP user: 

Password for SYSMAN user: 

Email address for notifications (optional):

Outgoing Mail (SMTP) server for notifications (optional):

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

 

You have specified the following settings

 

Database ORACLE_HOME ................ /oracle/product/10.2.0/db_1

 

Database hostname ................ OracleDb

Listener port number ................ 1521

Database SID ................ afc

Email address for notifications ...............

Outgoing Mail (SMTP) server for notifications ...............

 

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

Do you wish to continue? [yes(Y)/no(N)]: y

Nov 15, 2011 2:02:21 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /oracle/product/10.2.0/db_1/cfgtoollogs/emca/afc/emca_2011-11-15_02-01-05-PM.log.

Nov 15, 2011 2:02:27 PM oracle.sysman.emcp.EMReposConfig createRepository

INFO: Creating the EM repository (this may take a while) ...

Nov 15, 2011 2:07:13 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully created

Nov 15, 2011 2:07:49 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Securing Database Control (this may take a while) ...

Nov 15, 2011 2:10:37 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Database Control secured successfully.

Nov 15, 2011 2:10:37 PM oracle.sysman.emcp.util.DBControlUtil startOMS

INFO: Starting Database Control (this may take a while) ...

Nov 15, 2011 2:12:52 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: Database Control started successfully

Nov 15, 2011 2:12:52 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: >>>>>>>>>>> The Database Control URL is https://OracleDb:1158/em <<<<<<<<<<<

Enterprise Manager configuration completed successfully

FINISHED EMCA at Nov 15, 2011 2:12:52 PM

[oracle@OracleDb 8350262]$ emctl status dbconsole

TZ set to PRC

Oracle Enterprise Manager 10g Database Control Release 10.2.0.4.0 

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

https://OracleDb:1158/em/console/aboutApplication

Oracle Enterprise Manager 10g is running.

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

Logs are generated in directory /oracle/product/10.2.0/db_1/OracleDb_afc/sysman/log

[oracle@OracleDb 8350262]$