首页 > 代码库 > 对oracle10grac配置em

对oracle10grac配置em

配置em

对oracle10grac配置em

 

 

 

A--:oracle 删除EM

 

首先查看em的状态

$ emctl status dbconsole

如果是正在运行,则先停止其运行,这是个好习惯

$ emctl stop dbconsole

然后,执行命令

$ emca -deconfig dbcontrol db -repos drop

 

删除时,很可能sysman用户没有删除,还存在一些role和public synonym

需要下面的SQL语句

drop user sysman cascade;

 drop user MGMT_VIEW cascade;

 drop role MGMT_USER;

 drop public synonym MGMT_TARGET_BLACKOUTS;

 drop public synonym SETEMVIEWUSERCONTEXT;

 

 

执行完就删除EM了

可以通过下面的视图产看前面要删除的对象

dba_synonyms,dba_roles,dba_users

 技术分享

然后重新配置,使用

$ emca -config dbcontrol db -repos create

 

 

B--:配置Oracle 10G EM

 

第一种方法,用dbca配置em,也是最简单的方法。

在命令提示符下输入dbca,出现"Database Configuration Assistant 欢迎使用"界面,点下一步,选择配置数据库,在点下一部,选择要配制em的数据库,然后在点下一步,把"使用Enterprise Manager配置数据库"选项打上钩,因为是配制单实例的,所以选择"使用Database Control管理数据",下面两个选项启用电子邮件通知和启用每日备份根据自己情况选择,在点一下部,把"Enterprise anager 资料档案库"也选择起来,否则不能使用em,在点下一步,然后提示需要设置DBSNMP和SYSMAN两个用户设置口令,根据自己情况来设置是否口令设置成一样,还是分开设置。

再点一下步,再点完成,就出现配制数据库提示信息框,等配制完成就退出dbca,完成数据库em配制。

 

优点:使用这种方法简单,方便,也不容易配置错误,不需要记注复杂命令,一般配制都能成功。

缺点:在不能使用dbca环境当中就不能使用了,在Linux下工手创建数据库是不能用dbca配制,dbca也不能删除em

资料库存和取消Database Control配制。

 

 

第二种方法,用emca配置em

emca是一个命令提示符,使用格式和方法在命令提示符下输入emca,屏幕上会出现emca使用帮助。

 

命令帮助如下:

emca [操作] [模式] [数据库类型] [标记] [参数]

 

常用以下两个命令:

emca -config dbcontrol db -repos create 创建em资料库并同时配制Database Control

emca -deconfig dbcontrol db -repos drop 删除Database Control并同时删除em资料库

 

[操作] 对应到-config和-deconfig 意思是配制意思。注意"-"不能少

[模式] 对应到dbcontrol,意思是Database Control

[数据库类型] 对应到 db ,意思是数据库,对数据库 (包括使用 ASM 的数据库) 执行配置操作

[标记] 这里没有。

[参数] 对应到-repos create和-repos drop,意思创建em资料库和删除当前em资料库

 

如果我们没有配制过Database Control也没有em资料库,我们输入如下命令

emca -config dbcontrol db -repos create

 

 

 

如果原来em资料库已经创建好,可以配制Database Control

emca -config dbcontrol db

 

如果需要删除Database Control配制,但不删除em资料库

emca -deconfig dbcontrol db

 

如果需要全部删除,输入如下命令:(注!dbca是没有删除em资料库和取消Database Control配制)

emca -deconfig dbcontrol db -repos drop

 

删除一个EM资料库,但如果Database Control配制好,已经不能使用,而且需要DBConsole服务停止才能使用。

emca -repos drop

 

创建一个EM资料库,如果Database Control配制好,但发现em资料库不存在,可以用如下命令创建。

emca -repos create

 

重建一个EM资料库

emca -repos recreate

 

如果我们数据库没有配制过任何信息,就用一条语句就把配制好

emca -config dbcontrol db -repos create

需要全部删除em资料库用

emca -deconfig dbcontrol db -repos drop

但我们也可以一步步配制,或在em出问题,我们就需要用到分开命令来处理了。

 

命令总结:

emca -config dbcontrol db -repos create 创建em资料库,并配制Database Control

emca -deconfig dbcontrol db -repos drop 取消配制Database Control,并删除em资料库

emca -repos create 创建一个EM资料库

emca -repos recreate 重建一个EM资料库

emca -repos drop 删除一个EM资料库

emca -config dbcontrol db 配置数据库的 Database Control

emca -deconfig dbcontrol db 删除数据库的 Database Control配置

emctl start dbconsole 先设置ORACLE_SID环境变量后,启动EM console服务

emctl stop dbconsole 先设置ORACLE_SID环境变量后,停止EM console服务

emctl status dbconsole 先设置ORACLE_SID环境变量后,查看EM console服务的状态

 

优点:能在dbca不能完成em配制场合完成配制,也能删除em。

缺点:复杂,命令参数不选择正确,经常会报错。

由于在命令下面经常会发生错误,发生错误要根据错误提示和日志去分析错误原因,然后在根据错误原因去解决错误的方法,才能把问题解决掉。

 

注:如果登录出现乱码,问题在于安装时DK/jre 字符集的自动选择,在$ORALCE_HOME/jdk/jre/lib 目录下有多种字符集,

 

      选择一种合适的字符集替换缺省文件

 

      cp font.properties.zh_CN.Redhat font.properties

 

      替换后需要清理一下Cache,重启EM即可。Cache路径通常位于     

 

      $ORACLE_HOME/oc4j/j2ee/oc4j_applications/applications/em/em/cabo/images/cache/zhs 清除所有的gif即可    

 

注:手工配置EM的时候,注意检查dba_users 中sysman,dbsnmp用户是否可用

 

       否则进入EM时,无登录选项和功能选项

 

 

 

C--:10g r2 em问题

 

配置database control(em)如下:

$ emca -config dbcontrol db

 

STARTED EMCA at Sep 6, 2016 12:23:53 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: MICSPROD

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 ................ /u01/app/oracle/product/10.2.0/db_1

 

Database hostname ................ micsgmm01

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

Database SID ................ MICSPROD

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

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

 

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

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

Sep 6, 2016 12:24:30 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/MICSPROD/emca_2016-09-06_12-23-53-PM.log.

Sep 6, 2016 12:24:33 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

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

Sep 6, 2016 12:27:14 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Database Control secured successfully.

Sep 6, 2016 12:27:14 PM oracle.sysman.emcp.util.DBControlUtil startOMS

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

Sep 6, 2016 12:31:52 PM oracle.sysman.emcp.util.PlatformInterface executeCommand

WARNING: Error executing /u01/app/oracle/product/10.2.0/db_1/bin/emctl start dbconsole

Sep 6, 2016 12:31:52 PM oracle.sysman.emcp.EMConfig perform

SEVERE: Error starting Database Control

Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/MICSPROD/emca_2016-09-06_12-23-53-PM.log for more details.

Could not complete the configuration. Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/MICSPROD/emca_2016-09-06_12-23-53-PM.log for more details.

 

 

Database Control启动失败。根据提示查看日志

 

# tail -f /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/MICSPROD/emca_2016-09-06_12-23-53-PM.log

 

 

Sep 6, 2016 12:27:14 PM oracle.sysman.emcp.util.PlatformInterface executeCommand

CONFIG: Starting execution: /u01/app/oracle/product/10.2.0/db_1/bin/emctl start dbconsole

Sep 6, 2016 12:31:52 PM oracle.sysman.emcp.util.PlatformInterface executeCommand

CONFIG: Exit value of 1

Sep 6, 2016 12:31:52 PM oracle.sysman.emcp.util.PlatformInterface executeCommand

CONFIG: 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://micsgmm01:1158/em/console/aboutApplication

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

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

Logs are generated in directory /u01/app/oracle/product/10.2.0/db_1/micsgmm01_MICSPROD/sysman/log

 

Sep 6, 2016 12:31:52 PM oracle.sysman.emcp.util.PlatformInterface executeCommand

WARNING: Error executing /u01/app/oracle/product/10.2.0/db_1/bin/emctl start dbconsole

Sep 6, 2016 12:31:52 PM oracle.sysman.emcp.EMConfig perform

SEVERE: Error starting Database Control

Refer to the log file at /u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/MICSPROD/emca_2016-09-06_12-23-53-PM.log for more details.

Sep 6, 2016 12:31:52 PM oracle.sysman.emcp.EMConfig perform

CONFIG: Stack Trace:

oracle.sysman.emcp.exception.EMConfigException: Error starting Database Control

        at oracle.sysman.emcp.EMDBPostConfig.performConfiguration(EMDBPostConfig.java:646)

        at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:224)

        at oracle.sysman.emcp.EMDBPostConfig.invoke(EMDBPostConfig.java:193)

        at oracle.sysman.emcp.EMConfig.perform(EMConfig.java:184)

        at oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:486)

        at oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:1142)

        at oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:470)

        at oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:419)

 

 

网上查资料,是oracle的bug。

Oracle对此的解释是:

 

In Enterprise Manager Database Control with Oracle Database 10.2.0.4 and 10.2.0.5, the root certificate used to secure communications via the Secure Socket Layer (SSL) protocol will expire on 31-Dec-2010 00:00:00. The certificate expiration will cause errors if you attempt to configure Database Control on or after 31-Dec-2010. Existing Database Control configurations are not affected by this issue.

 

If you plan to configure Database Control with either of these Oracle Database releases, Oracle strongly recommends that you apply Patch 8350262 to your Oracle Home installations before you configure Database Control. Configuration of Database Control is typically done when you create or upgrade Oracle Database, or if you run Enterprise Manager Configuration Assistant (EMCA) in standalone mode.

 

可以查看:Enterprise Manager Database Control Configuration - Recovering From Errors Due to CA Expiry on Oracle Database 10.2.0.4 or 10.2.0.5 [Video] [ID 1222603.1]

 

此问题是由于enterprise manager database control组件的跟CA证书授权过期造成的,其证书到期日为2010年12月31日,2011年安装此版本数据库都会出现这个问题,官方的解决方案是打Patch8350262。

 

解决方法:

 

如果是在创建实例前就已经打了这个patch的话,那之后就不会报错了。如果是在创建实例之后才打的这个patch,那么需要执行以下:

 

对于单实例:

1.使用Opatch安装Patch 8350262

2.设置ORACLE_HOME and ORACLE_SID 环境变量,执行 <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

 

对于RAC:

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

2.在所有节点执行:设置ORACLE_HOME and ORACLE_SID 环境变量,执行 <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

 

可以将计算机时间调至2009年,则可以通过校验,也能成功安装数据库控制台。

 

 

 

 

 

 

D--:10g r2修复em bug

 

下载补丁:p8350262_10204_Generic.zip

 

该补丁无需停止数据库进程与监听进程,只需确保没有oracle home下的与java相关的进程即可。
打补丁之前,可以先把opatch的路径加入PATH环境变量

 

(注:以下操作在oracle用户下)

 

将补丁上传到/u02/

 

-rw-r--r-- 1 oracle oinstall    40488 Sep 6 13:53  p8350262_10204_Generic.zip

 

0--删除em的配置

emca -deconfigdbcontrol db -repos drop

 

 

1--检查opatch版本是否为10.2.0.4, 执行:

/u01/app/oracle/product/10.2.0/db_1/OPatch/opatchversion

 

 

2--unzip p8350262_10204_Generic.zip 进入解压后的patch目录

cd /u02/8350262/

 

打补丁8350262

/u01/app/oracle/product/10.2.0/db_1/OPatch/opatchapply

 

查看补丁

/u01/app/oracle/product/10.2.0/db_1/OPatch/opatchlsinventory

 

 

3—配置em

emca -configdbcontrol db -repos create

 

 

[oracle@micsgmm01 ~]$ emca -configdbcontrol db -repos create

 

STARTED EMCA at Sep 6, 2016 2:46:52 PM

EM Configuration Assistant, Version10.2.0.1.0 Production

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

 

Enter the following information:

Database SID: MICSPROD

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 fornotifications (optional):

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

 

You have specified the following settings

 

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

 

Database hostname ................ micsgmm01

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

Database SID ................ MICSPROD

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

Outgoing Mail (SMTP) server fornotifications ...............

 

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

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

Sep 6, 2016 2:47:15 PMoracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at/u01/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/MICSPROD/emca_2016-09-06_02-46-52-PM.log.

Sep 6, 2016 2:47:18 PMoracle.sysman.emcp.EMReposConfig createRepository

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

Sep 6, 2016 2:48:41 PMoracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully created

Sep 6, 2016 2:48:43 PMoracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Securing Database Control (this maytake a while) ...

Sep 6, 2016 2:51:13 PMoracle.sysman.emcp.util.DBControlUtil secureDBConsole

INFO: Database Control securedsuccessfully.

Sep 6, 2016 2:51:13 PMoracle.sysman.emcp.util.DBControlUtil startOMS

INFO: Starting Database Control (this maytake a while) ...

Sep 6, 2016 2:52:48 PMoracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: Database Control started successfully

Sep 6, 2016 2:52:48 PMoracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO:>>>>>>>>>>> The Database Control URL ishttps://micsgmm01:1158/em <<<<<<<<<<<

Enterprise Manager configuration completedsuccessfully

FINISHED EMCA at Sep 6, 2016 2:52:48 PM

 

 

 

如果没有删除em配置,就打补丁,则不能启动Database Control,还需要Re-secure Database Control。

Re-secure Database Control之前,可以使用patch8350262目录下的脚本killDBConsole强制停止Database Control相关的进程。

$ ./killDBConsole

 

完成之后进行Re-secure Database Control :

$ emctlsecure dbconsole -reset

根据提示输入管理员密码,然后会有两次确认请求,两次都是输入大写的Y

 

 

然后启动em

$ emctlstart dbconsole

 

 

最后启动正常,访问:https://ip:1158/em正常访问登陆,则bug修复成功,em配置完成;

 

 

 

附:PATCH解压后的README文件说明:

[oracle@micsgmm01 8350262]$ cat README.txt

=========================================================================

Interim Patch for Base Bug: 8350262

=========================================================================

 

Date: Sep 10, 2010

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

 Platform Patch for      : Generic

 Product Patched         : 10.2.0.4.0

 Product Version         : Enterprise Manager Database Control

 

Bugs Fixed by this patch:

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

8350262:CREATE DBCONSOLE CERT WITH 10YEARVALIDITY

 

Patch Preinstall Steps:

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

 

1. For non-recommended patches, you musthave the exact symptoms

  described in the service request (SR).

 

2. Verify the OUI Inventory.

 

OPatch needs access to a valid OUIinventory to apply patches.

Validate the OUI inventory with thefollowing command:

 

  %opatch lsinventory

 

If the command errors out, contact OracleSupport and work to validate

and verify the inventory setup beforeproceeding.

 

3. Please use the latest Version of OPatch.

 

Oracle recommends that all customers be onthe latest version of OPatch.

Please review the following metalink noteand follow the instructions

to update to the latest version if needed:

 

 https://metalink.oracle.com/metalink/plsql/ml2_documents.showNOT?p_id=224346.1

 

4. Confirm executables appear in yoursystem PATH.

 

The patching process will use the unzip andthe opatch executables.  After

sourcing the ORACLE_HOME environment,confirm both of these exist before

continuing:

 

  -"which opatch"

  -"which unzip"

 

If either of these executables do not showin the PATH, correct the problem

before proceeding.

 

5. Create a location for storing theunzipped patch.  This location

will be referred to later in the documentas <PATCH_TOP>.

 

6. Unzip the patch zip file into the<PATCH_TOP>.

 

 unzip -d <PATCH_TOP> p8350262_102040_Generic.zip

 

7. Shut down services running from theORACLE_HOME.

 

Before applying this patch, do a clean shutdown of all services

running from the ORACLE_HOME.

 

Patch Installation Steps:

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

 

1. Shutdown EM DB Console using thefollowing command.

 

      % $ORACLE_HOME/bin/emctl stop dbconsole

 

2. Set your current directory to thedirectory where the patch

   islocated:

    %cd <PATCH_TOP>/8350262

 

  Ensure that the directory containing the opatch script appears in

  your $PATH; then enter the following command:

    %opatch apply

 

3. Start EM DB Console using the followingcommand.

 

     % $ORACLE_HOME/bin/emctl start dbconsole

 

NOTE:

------

There may be cases when Starting dbconsolemay fail post 31-Dec-2010.

In this case, Please set ORACLE_HOME toyour Database Home & ORACLE_SID

and run the following from the patchfolder.

   %./killDBConsole

 

 

Patch Deinstallation Instructions:

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

1. Shutdown EM DB Console using thefollowing command.

 

      % $ORACLE_HOME/bin/emctl stop dbconsole

 

2. Set your current directory to thedirectory where the patch

   islocated:

    %cd <PATCH_TOP>/8350262

 

3. Ensure that the directory containing theopatch script appears in

   your$PATH; then run the following command:-

  %  opatch rollback -id 8350262

  

4. Start EM DB Console using the followingcommand.

 

     % $ORACLE_HOME/bin/emctl start dbconsole

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

相关参考:

oracle 删除EM

http://blog.csdn.net/yan19880901/article/details/8113066

 

Oracle 10g,11g中EM的安装配置过程

http://www.linuxidc.com/Linux/2015-04/115922.htm

 

oracle 10g rac配置em

http://www.2cto.com/database/201408/326736.html

 

10g RAC -10.2.0.4-dbca建库时配置OEM遇到BUG-p8350262

http://www.linuxidc.com/Linux/2014-02/97111.htm

 

Oracle10.2.0.4版本DatabaseControl 配置问题

http://www.360doc.com/content/12/0327/17/5287961_198336675.shtml

 

Oracle10g补丁Patch 8350262 下载地址(补丁是平台通用,分数据库版本)

1--:oracle官网注册能下载

2--:其他网站的资源

http://down.51cto.com/data/761747

http://download.csdn.net/detail/u011302321/6949981

 

对oracle10grac配置em