语法:
emca -config dbcontrol db [-repos (create | recreate)] [-cluster] [-silent] [-backup] [parameters]: configure Database Control for a database

1. 清除em相关配置
--删除db配置
emca -deconfig dbcontrol db
--清除repository
emca -repos drop
2. 配置em
--创建db control
emca -config dbcontrol db -repos recreate

3.启动em
emctl start dbconsole

em控制台地址:

需要添加hosts文件 C:\Windows\System32\drivers\etc\hosts

https://hostname:1158/em/console

https://192.168.17.35:1158/em/console

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

SQL> alter user DBSNMP identified by oracle account unlock;

User altered.

SQL> select username ,account_status from dba_users order by user_id ;

USERNAME ACCOUNT_STATUS
------------------------------ --------------------------------
SYS OPEN
SYSTEM OPEN
OUTLN EXPIRED & LOCKED
DIP EXPIRED & LOCKED
ORACLE_OCM EXPIRED & LOCKED
DBSNMP OPEN
APPQOSSYS EXPIRED & LOCKED
TEST OPEN
GGS OPEN
SCOTT OPEN
SYSMAN OPEN
MGMT_VIEW OPEN

12 rows selected.

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

[oracle@prod ~]$ emca -config dbcontrol db -repos recreate

STARTED EMCA at Sep 20, 2018 7:39:13 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: prod
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/db_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN 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/db_1

Local hostname ................ prod
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1
Listener port number ................ 1521
Database SID ................ prod
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
----------------------------------------------------------------------
WARNING : While repository is dropped the database will be put in quiesce mode.
----------------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: y
Sep 20, 2018 7:41:04 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/prod/emca_2018_09_20_19_39_13.log.
Sep 20, 2018 7:41:05 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Sep 20, 2018 7:41:06 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Sep 20, 2018 7:41:06 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Sep 20, 2018 7:46:14 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Sep 20, 2018 7:46:21 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Sep 20, 2018 7:47:10 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Sep 20, 2018 7:47:14 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Sep 20, 2018 7:47:18 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/11.2.0/db_1/bin/emctl config emkey -repos
Sep 20, 2018 7:47:18 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
WARNING: Configuring EM-Key failed.
Sep 20, 2018 7:47:18 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
WARNING: Error securing Database control.
Sep 20, 2018 7:47:18 PM oracle.sysman.emcp.EMDBPostConfig setWarnMsg
INFO: Error securing Database Control. Database Control has been brought-up in non-secure mode. To secure the Database Control execute the following command(s):

1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole
3) /u01/app/oracle/product/11.2.0/db_1/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user >
4) /u01/app/oracle/product/11.2.0/db_1/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user >
5) /u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole

To secure Em Key, run /u01/app/oracle/product/11.2.0/db_1/bin/emctl config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
Sep 20, 2018 7:47:18 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...

Sep 20, 2018 7:48:59 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Sep 20, 2018 7:48:59 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is http://prod:1158/em <<<<<<<<<<<

Error securing Database Control. Database Control has been brought-up in non-secure mode. To secure the Database Control execute the following command(s):

1) Set the environment variable ORACLE_UNQNAME to Database unique name
2) /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole
3) /u01/app/oracle/product/11.2.0/db_1/bin/emctl config emkey -repos -sysman_pwd < Password for SYSMAN user >
4) /u01/app/oracle/product/11.2.0/db_1/bin/emctl secure dbconsole -sysman_pwd < Password for SYSMAN user >
5) /u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole

To secure Em Key, run /u01/app/oracle/product/11.2.0/db_1/bin/emctl config emkey -remove_from_repos -sysman_pwd < Password for SYSMAN user >
[oracle@prod ~]$
[oracle@prod ~]$ exit
logout
s[root@prod ~]# su - oracle
[oracle@prod ~]$ /u01/app/oracle/product/11.2.0/db_1/bin/emctl stop dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
http://prod:1158/em/console/aboutApplication
Stopping Oracle Enterprise Manager 11g Database Control ...

all attemps to stop oc4j failed... now trying to kill 9
--- Failed to shutdown DBConsole Gracefully ---
... Stopped.
[oracle@prod ~]$ /u01/app/oracle/product/11.2.0/db_1/bin/emctl config emkey -repos -sysman_pwd oracle
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.

The Em Key has been configured successfully.
[oracle@prod ~]$ /u01/app/oracle/product/11.2.0/db_1/bin/emctl secure dbconsole -sysman_pwd oracle
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
http://prod:1158/em/console/aboutApplication
DBCONSOLE already stopped... Done.
Agent is already stopped... Done.
Securing dbconsole... Started.
Please enter repository schema password:

Securing dbconsole... Sucessful.
[oracle@prod ~]$
[oracle@prod ~]$ /u01/app/oracle/product/11.2.0/db_1/bin/emctl start dbconsole
Oracle Enterprise Manager 11g Database Control Release 11.2.0.4.0
Copyright (c) 1996, 2013 Oracle Corporation. All rights reserved.
https://prod:1158/em/console/aboutApplication
Starting Oracle Enterprise Manager 11g Database Control .... started.
------------------------------------------------------------------
Logs are generated in directory /u01/app/oracle/product/11.2.0/db_1/prod_prod/sysman/log

oracle创建em的更多相关文章

  1. 如何解决Oracle 11g EM网站报“此网站的安全证书存在问题”

    在IE中输入https://localhost:1158/em 接报错,打不开;提示:“证书错误,此网站安全证书有问题”,解决过程如下: 1.删除与重建dbconsole 2.配置必要的环境变量 1. ...

  2. Oracle创建表空间、用户管理、角色管理

    内容:Oracle创建表空间.用户管理.角色管理 1.用系统用户登录Oracle 默认的系统用户: sys/system.sysman.scott sys:权限最大,超级用户,可以完成所有任务, 默认 ...

  3. oralce 11.2.0.4手动创建EM

    安装完oracle,启动dbconsole,失败 [oracle@elearning admin]$ emctl start dbconsole OC4J Configuration issue. / ...

  4. Oracle 11g EM删除重建的方法

    虚拟机里的Oracle 11g好长时间没用了,突然打开之后发现EM无法访问了,EM可以重建,于是也不打算查找原因了,直接使大招 OS:Windows Server 2012 Oracle:11g R2 ...

  5. oracle创建新数据库

    oracle创建新数据库 look here http://www.cnblogs.com/phoenixzq/p/3510854.html windows start menu>Oracle& ...

  6. 利用Oracle创建表空间和用户

    本文仅用于学习交流,商业用途请支持正版!转载请注明:http://www.cnblogs.com/mxbs/p/6217152.html 第一步,创建表空间 以SYS/sys账户和SYSDBA身份登录 ...

  7. 利用Oracle创建数据库

    本文仅用于学习交流,商业用途请支持正版!转载请注明:http://www.cnblogs.com/mxbs/p/6217151.html 数据库的创建 打开"所有程序"-" ...

  8. Oracle创建数据库

    Oracle创建数据库有三种方式:一.使用DBCA(Database Configuration Assistant 数据库配置助手):二.使用 create database指令:三.在安装数据库软 ...

  9. oracle创建表之前判断表是否存在,如果存在则删除已有表

    Mysql 创建表之前判断表是否存在,如果存在则删除已有表 DROP TABLE IF EXISTS sys_area; CREATE TABLE sys_area ( id int NOT NULL ...

随机推荐

  1. 无法初始化 PowerShell 主机解决方案

    Question无法初始化 PowerShell 主机.如果您的 PowerShell 执行策略设置设为 AllSigned,请先打开程序包管理器控制台以初始化该主机. --------------- ...

  2. AngularJS+Ionic开发-2.项目结构介绍

    使用上篇博客<开发环境搭建>中的命令创建完成IonicHelloWorld项目,在VSCode中的左侧,显示该项目的结构信息,如下图所示: 1 .sourcesmaps文件夹 调试状态的j ...

  3. 聚簇索引(聚集索引) 不可作用于GUID类型字段

    聚簇索引(又名聚集索引) 不可作用于GUID类型字段,即:数据库中不要把GUID类型作为主键或设置为聚集索引. 聚集索引:索引的物理存储顺序与数据表中行数据物理存储顺序一致(索引存储物理有序). 非聚 ...

  4. flume中的拦截器

    Flume中的拦截器(interceptor),用户Source读取events发送到Sink的时候,在events header中加入一些有用的信息,或者对events的内容进行过滤,完成初步的数据 ...

  5. 【Dubbo&&Zookeeper】5、dubbo总结和学习资料汇总

    Dubbo学习资料 阿里巴巴分布式服务框架 Dubbo 团队成员梁飞专访 RPC介绍 什么是RPC? RPC(Remote Procedure Call)远程过程调用.见名知意 - 从远程主机调用一个 ...

  6. Nginx + 阿里云SSL + tomcat 实现https访问代理

    第一步:阿里云申请云盾证书服务 第二步:下载证书 第三步:修改Nginx配置 1. 证书文件214033834890360.pem,包含两段内容,请不要删除任何一段内容. 2. 如果是证书系统创建的C ...

  7. vue引入bootstrap——webpack

    想要在vue中引入bootstrap,引入的时候需要按照如下的步骤进行. 1.引入jquery 2.引入bootstrap   阅读本文前,应该能够搭建环境,使用vue-cli进行项目的创建,可以参考 ...

  8. Android Studio_更新Gradle

    一.Gradle更新问题 Android Studio每次更新版本都会更新Gradle这个插件,而且有时候提示更新,却一直更新不了,那是因为中国伟大的长城问题.就是下图,我刚刚更新了,提示更新grad ...

  9. springboot中使用mybatis显示执行sql

    springboot 中使用mybatis显示执行sql的配置,在properties中添加如下 logging.你的包名=debug 2018-11-27 16:35:43.044 [DubboSe ...

  10. 【JS单元测试】Qunit 和 jsCoverage使用方法

          近日在网上浏览过很多有关js单元测试相关的文档,工具,但是,针对Qunit 和 jsCoverage使用方法,缺少详细说明,对于初入前端的人来说,很难明白其中的意思,特此整理这篇文章,希望 ...