【Oracle Install】Oracle 11g安装OEM

目录一、安装环境二、方式一:DBCA安装EM三、方式二:手动安装EM1. 将sysman以及dbsnmp两个用户解锁和设置密码2. 创建EM资料档案库3. 配置数据库的Database Control4. 查看EM console服务的状态5. 登录OEM四、删除OEM1. 删除OEM相关的角色和视图(可选)2. 删除OEM3. 再重建OEM五、OEM常用命令

一、安装环境

名称 说明
OS版本 Red Hat Enterprise Linux Server release 7.9 (Maipo)
Oracle版本 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production
Oracle OEM安装包 不需要另外的安装包

二、方式一:DBCA安装EM

三、方式二:手动安装EM

1. 将sysman以及dbsnmp两个用户解锁和设置密码

alter user sysman account unlock identified by 123;
alter user dbsnmp account unlock identified by 123;

2. 创建EM资料档案库

已有EM资料档案库的话,需删除当前的EM资料档案库

emctl status dbconsole
emca -repos create
[oracle@laura-uat01 ~]$ emca -repos create

STARTED EMCA at Jul 19, 2022 1:52:31 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: LAURA01
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

Do you wish to continue? [yes(Y)/no(N)]: Y
Jul 19, 2022 1:52:55 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/LAURA01/emca_2022_07_19_13_52_30.log.
Jul 19, 2022 1:52:55 PM oracle.sysman.emcp.DatabaseChecks performReposChecks
SEVERE: Dbcontrol Repository already exists.  Fix the error(s) and run EM Configuration Assistant again in standalone mode.

建立EM资料档案库的时候报错,资料档案库已存在

3. 配置数据库的Database Control

emca -config dbcontrol db
[oracle@laura-uat01 ~]$ emca -config dbcontrol db

STARTED EMCA at Jul 19, 2022 1:53:42 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: LAURA01
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_1 ]: 
Password for SYS user:  
Password for DBSNMP user:  
Password for SYSMAN user:  
Email address for notifications (optional): Laura_li@smecs.com
Outgoing Mail (SMTP) server for notifications (optional): 
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1

Local hostname ................ laura-uat01
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1
Listener port number ................ 1521
Database SID ................ LAURA01
Email address for notifications ............... Laura_li@smecs.com
Outgoing Mail (SMTP) server for notifications ............... 

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jul 19, 2022 1:54:59 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/LAURA01/emca_2022_07_19_13_53_41.log.
Jul 19, 2022 1:55:08 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jul 19, 2022 1:55:49 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jul 19, 2022 1:55:50 PM oracle.sysman.emcp.ParamsManager getLocalListener
WARNING: Error retrieving listener for laura-uat01
Jul 19, 2022 1:55:52 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jul 19, 2022 1:55:59 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jul 19, 2022 1:55:59 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jul 19, 2022 1:56:22 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jul 19, 2022 1:56:22 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://laura-uat01:1158/em <<<<<<<<<<<
Jul 19, 2022 1:56:24 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING: 
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/dbhome_1/laura-uat01_LAURA01/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost. 

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jul 19, 2022 1:56:24 PM

4. 查看EM console服务的状态

emctl status dbconsole
[oracle@laura-uat01 ~]$ emctl status dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0 
Copyright (c) 1996, 2013 Oracle Corporation.  All rights reserved.
https://laura-uat01:1158/em/console/aboutApplication
Oracle Enterprise Manager 11g is running. 
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/dbhome_1/laura-uat01_LAURA01/sysman/log

5. 登录OEM

选择IE浏览器,地址为:https://192.168.1.10:1158/em,登录数据库账号和密码
ip为服务器ip
【Oracle Install】Oracle 11g安装OEM

四、删除OEM

1. 删除OEM相关的角色和视图(可选)

可不操作,步骤2命令已经包含

drop role mgmt_user;
drop user mgmt_view cascade;
drop user sysman cascade;
drop public synonym mgmt_target_blackouts;
drop public synonym setemviewusercontext;

2. 删除OEM

emca -deconfig dbcontrol db -repos drop
[oracle@laura-uat01 ~]$ emca -deconfig dbcontrol db -repos drop

STARTED EMCA at Jul 19, 2022 3:51:12 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: LAURA01
Listener port number: 1521
Password for SYS user:  
Password for SYSMAN user:  

----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jul 19, 2022 3:51:25 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/LAURA01/emca_2022_07_19_15_51_12.log.
Jul 19, 2022 3:51:25 PM oracle.sysman.emcp.util.DBControlUtil stopOMS
INFO: Stopping Database Control (this may take a while) ...
Jul 19, 2022 3:51:46 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jul 19, 2022 3:53:15 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jul 19, 2022 3:53:17 PM

3. 再重建OEM

emca -config dbcontrol db -repos create
[oracle@laura-uat01 ~]$ emca -config dbcontrol db -repos create

STARTED EMCA at Jul 19, 2022 3:57:30 PM
EM Configuration Assistant, Version 11.2.0.3.0 Production
Copyright (c) 2003, 2011, Oracle.  All rights reserved.

Enter the following information:
Database SID: LAURA01
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_1 ]: 
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/11.2.0/dbhome_1

Local hostname ................ laura-uat01
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/dbhome_1
Listener port number ................ 1521
Database SID ................ LAURA01
Email address for notifications ............... 
Outgoing Mail (SMTP) server for notifications ............... 

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Jul 19, 2022 3:57:48 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/LAURA01/emca_2022_07_19_15_57_30.log.
Jul 19, 2022 3:57:49 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jul 19, 2022 4:00:45 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Jul 19, 2022 4:00:46 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Jul 19, 2022 4:01:24 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Jul 19, 2022 4:01:24 PM oracle.sysman.emcp.ParamsManager getLocalListener
WARNING: Error retrieving listener for laura-uat01
Jul 19, 2022 4:01:25 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Jul 19, 2022 4:01:29 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Jul 19, 2022 4:01:29 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Jul 19, 2022 4:01:39 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Jul 19, 2022 4:01:39 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://laura-uat01:1158/em <<<<<<<<<<<
Jul 19, 2022 4:01:41 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING: 
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/dbhome_1/laura-uat01_LAURA01/sysman/config/emkey.ora. Ensure this file is backed up as the encrypted data will become unusable if this file is lost. 

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jul 19, 2022 4:01:41 PM

五、OEM常用命令

#OEM启动/关闭/查看状态
emctl start|stop|status dbconsole
© 版权声明

相关文章

暂无评论

您必须登录才能参与评论!
立即登录
暂无评论...