其他分享
首页 > 其他分享> > 11g里创建OEM时的一个坑“emca -config dbcontrol db -repos recreate”

11g里创建OEM时的一个坑“emca -config dbcontrol db -repos recreate”

作者:互联网

11g里创建OEM时的一个坑

 

关于11g的OEM的更多内容: http://blog.itpub.net/26736162/viewspace-2029565/

关于Oracle里的组件说明: http://blog.itpub.net/26736162/viewspace-1562441/

 

一般来说,新建一个库后都有SYSMAN用户,但是当没有SYSMAN用户时,创建EM时可以使用“emca -config dbcontrol db -repos recreate”来创建,注意这里的repos是有s的,SYSMAN用户不能手工创建:

1

2

3

4

5

6

7

8

9

10

-- 删除EM

drop user sysman cascade;

drop user mgmt_view cascade;

drop role mgmt_user;

--重建EM

emca -config dbcontrol db -repos recreate

--emca -config dbcontrol db -repo recreate 该命令虽然可以运行,但是该命令是错误的,当SYSMAN不存在时会报很多错误

select username,account_status from dba_users where username in ('SYSMAN','MGMT_VIEW');

alter user dbsnmp identified by lhr account unlock;

lsnrctl status

 

如果使用 错误命令 “emca -config dbcontrol db -repo recreate”来创建EM,那么当SYSMAN不存在时会报如下的错误:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

[oracle@rhel6lhr ~]$ emca -config dbcontrol db -repo recreate

STARTED EMCA at Jul 19, 2019 9:47:38 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: ora11g

Listener port number: 1521

Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_1 ]: 

Password for SYS user:  

Password for DBSNMP user: oracle

Password for SYSMAN user: oracle

Jul 19, 2019 9:47:53 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly

WARNING: ORA-01017: invalid username/password; logon denied

Jul 19, 2019 9:47:53 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly

WARNING: ORA-01017: invalid username/password; logon denied

Invalid username/password.

Password for SYSMAN user:  

Password for SYSMAN user: Jul 19, 2019 9:48:28 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly

WARNING: ORA-01017: invalid username/password; logon denied

Jul 19, 2019 9:48:29 PM oracle.sysman.emcp.util.GeneralUtil initSQLEngineLoacly

WARNING: ORA-01017: invalid username/password; logon denied

Invalid username/password.

Password for SYSMAN user: oracle

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 ................ rhel6lhr

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

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

Database SID ................ ora11g

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

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

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

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

Jul 19, 2019 9:48:36 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/ora11g/emca_2019_07_19_21_47_37.log.

Jul 19, 2019 9:48:36 PM oracle.sysman.emcp.DatabaseChecks performReposChecks

WARNING: ORA-00942: table or view does not exist

Jul 19, 2019 9:48:36 PM oracle.sysman.emcp.DatabaseChecks performReposChecks

SEVERE: The existing database you have specified has Grid Control repository. This operation is not supported.

   

[oracle@rhel6lhr ~]$ emca -config dbcontrol db -repo recreate

STARTED EMCA at Jul 19, 2019 9:48:54 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: ora11g

Listener port number: 1521

Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/dbhome_1 ]: 

Password for SYS user: oracle

Password for DBSNMP user: oracle

Password for SYSMAN user: oracle

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 ................ rhel6lhr

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

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

Database SID ................ ora11g

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

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

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

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

Jul 19, 2019 9:49:12 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/ora11g/emca_2019_07_19_21_48_54.log.

Jul 19, 2019 9:49:12 PM oracle.sysman.emcp.DatabaseChecks performReposChecks

WARNING: ORA-00942: table or view does not exist

Jul 19, 2019 9:49:12 PM oracle.sysman.emcp.DatabaseChecks performReposChecks

SEVERE: The existing database you have specified has Grid Control repository. This operation is not supported.

 

这些错误很莫名其妙的,所以,正确的做法是用命令“emca -config dbcontrol db -repos recreate”, repos是有s的 

 

关于EM的一些其它内容:

Oracle Enterprise Manager

Description: 

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

This component will appear in dba_registry when you have configured a db console in your database. This is available from Oracle rdbms 10gR1 onwards. Please note that for this component you need to have Oracle Enterprise Manager installed at binaries level.

 

Schema: 

--------- 

DBSNMP, SYSMAN, MGMT_VIEW (11gR1 and 11gR2 only) 

 

How to Install and De-Install: 

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

Note.278100.1  How To Drop, Create And Recreate DB Control In A 10g Database 

(This note is applicable to 11gR1 and 11gR2)

 

Please note that reconfiguring the dbconsole will remove the existing settings in dbconsole. So after dropping and recreating the em repository you need to redo all the em related setting.

 

 

 



About Me

........................................................................................................................

● 本文作者:小麦苗,部分内容整理自网络,若有侵权请联系小麦苗删除

● 本文在itpub、博客园、CSDN和个人微 信公众号( xiaomaimiaolhr )上有同步更新

● 本文itpub地址: http://blog.itpub.net/26736162

● 本文博客园地址: http://www.cnblogs.com/lhrbest

● 本文CSDN地址: https://blog.csdn.net/lihuarongaini

● 本文pdf版、个人简介及小麦苗云盘地址: http://blog.itpub.net/26736162/viewspace-1624453/

● 数据库笔试面试题库及解答: http://blog.itpub.net/26736162/viewspace-2134706/

● DBA宝典今日头条号地址: http://www.toutiao.com/c/user/6401772890/#mid=1564638659405826

........................................................................................................................

● QQ群号: 230161599 (满) 、618766405

● 微 信群:可加我微 信,我拉大家进群,非诚勿扰

● 联系我请加QQ好友 ( 646634621 ) ,注明添加缘由

● 于 2019-07-01 06:00 ~ 2019-07-31 24:00 在西安完成

● 最新修改时间:2019-07-01 06:00 ~ 2019-07-31 24:00

● 文章内容来源于小麦苗的学习笔记,部分整理自网络,若有侵权或不当之处还请谅解

● 版权所有,欢迎分享本文,转载请保留出处

........................................................................................................................

● 小麦苗的微店 : https://weidian.com/s/793741433?wfr=c&ifr=shopdetail

● 小麦苗出版的数据库类丛书 : http://blog.itpub.net/26736162/viewspace-2142121/

● 小麦苗OCP、OCM、高可用网络班 : http://blog.itpub.net/26736162/viewspace-2148098/

● 小麦苗腾讯课堂主页 : https://lhr.ke.qq.com/

........................................................................................................................

使用 微 信客户端 扫描下面的二维码来关注小麦苗的微 信公众号( xiaomaimiaolhr )及QQ群(DBA宝典)、添加小麦苗微 信, 学习最实用的数据库技术。

........................................................................................................................

欢迎与我联系

 

 

标签:11g,19,emca,recreate,2019,user,oracle,SYSMAN
来源: https://blog.csdn.net/lihuarongaini/article/details/97964475