语法:
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. Mapreduce的api编程

    KEYIN:输入的KEY是maptask所读取到的一行文本的起始偏移量,longVALUEIN:输入的VALUE的类型,输入的VALUE是maptask所读取到的一行文本内容,StringKEYOUT ...

  2. openCV 调用摄像头

    OpenCV调用摄像头 环境 python:python3.6 摄像头:网络摄像头 Python库:openCV # -*- coding: utf-8 -*- # @author leone # @ ...

  3. Confluence设置MySQL数据库报错:必须使用'READ-COMMITTED'作为默认隔离级别。

    解决方案: mysql -u root -p123456 SET GLOBAL tx_isolation='READ-COMMITTED'; mysql数据库创建 1.设置mysql隔离级别 SET ...

  4. Maven的pom.xml文件详解【转载】

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/20 ...

  5. Ashampoo Driver Updater - 阿香婆驱动安装

    Ashampoo Driver Updater 让系统更完美 – 永远有最新的驱动,出错或旧的驱动是每个电脑系统的恶梦.时不时,驱动会丢失或不可避免的过时.Ashampoo Driver Update ...

  6. C语言字符串读入函数笔记

    gets(str)函数和scanf("%s",str)区别: 转自:https://zhidao.baidu.com/question/290403568.html 二者都是从终端 ...

  7. 洛谷P3899 [湖南集训]谈笑风生(线段树合并)

    题意 题目链接 Sol 线段树合并板子题,目前我看到两种写法,分别是这样的. 前一种每次需要新建一个节点,空间是\(O(4nlogn)\) 后者不需要新建,空间是\(O(nlogn)\)(面向数据算空 ...

  8. mysql 中表和数据库名称不要使用 '-' 命名

    mysql 中表和数据库名称不要使用 '-' 命名 若使用这个符号,比如 my-name 做为数据库表名称 那么在 sql 中必须如下: select * from `my-name`

  9. 新浪微博POI点签到数据及可视化的初步成果

    目前仅对山东省区域进行了抓取,权限不够高,抓取的速度非常慢,所以导致效率比较低... 数据抓取采用调用微博开放平台API的方法,数据存储采用mysql,格点数据分辨率为30″,山东省的MBR范围内(包 ...

  10. 二. Redis 安全性

    由于Redis速度相当快,当一台服务器比较好的时候,一个外部用户可以在一秒钟内进行150K(15万)次的密码尝试,因此意味着你需要设置一个非常非常强大的密码来防止暴力破解. 1.设置密码 (1). 通 ...