命令行界面下使用emca安装配置OracleDatabaseControl实战(二)

2014-11-24 14:18:32 · 作者: · 浏览: 1
RE: Error creating the repository Jul 10, 2014 4:21:53 PM oracle.sysman.emcp.EMReposConfig invoke INFO: Refer to the log file at /oracle/cfgtoollogs/emca/xgdb/emca_repos_create_.log for more details. Jul 10, 2014 4:21:53 PM oracle.sysman.emcp.EMConfig perform SEVERE: Error creating the repository Refer to the log file at /oracle/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_18_24.log for more details. Could not complete the configuration. Refer to the log file at /oracle/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_18_24.log for more details.
313 Jul 10, 2014 4:19:44 PM oracle.sysman.emcp.EMReposConfig createRepository
314 CONFIG: Spooling to /oracle/cfgtoollogs/emca/xgdb/emca_repos_create_2014_07_10_16_19_44.log
315 Jul 10, 2014 4:19:44 PM oracle.sysman.emcp.EMReposConfig createRepository
316 INFO: Creating the EM repository (this may take a while) ...
317 Jul 10, 2014 4:21:53 PM oracle.sysman.emcp.EMReposConfig createRepository
318 CONFIG: ORA-04063: package body "SYSMAN.MGMT_LOGIN_ASSISTANT" has errors
319 ORA-06508: PL/SQL: could not find program unit being called:
这里已经能看出大概的错误是SYSMAN.MGMT_LOGIN_ASSISTANT这个包编译有问题了,为了获取详细错误,继续查看提示的日志文件。
PL/SQL procedure successfully completed.

Commit complete.

BEGIN
*
ERROR at line 1:
ORA-04063: package body "SYSMAN.MGMT_LOGIN_ASSISTANT" has errors
ORA-06508: PL/SQL: could not find program unit being called:
"SYSMAN.MGMT_LOGIN_ASSISTANT"

执行 SQL> alter package mgmt_login_assistant compile body;

此时会报错,继续查看出错原因:

SQL> show errors;

显示 函数ENCRYPT invalid。

这说明magmt_login_assistant这个包依赖ENCRYPT函数,而ENCRYPT函数自身有问题。那么继续看看ENCRYPT函数究竟什么问题。

SQL> alter function encrypt compile;

Warning: Function altered with compilation errors.

SQL> show errors;
Errors for FUNCTION ENCRYPT:
9/5      PL/SQL: Statement ignored
10/22    PLS-00201: identifier 'SYS.UTL_I18N' must be declared 

找到了错误根源,解决就容易多了,以sys账户登录,然后赋予public角色执行SYS.UTL_I18N这个包的权限。

SQL>  grant execute on UTL_I18N to public;

Grant succeeded. 

SYSMAN.MGMT_LOGIN_ASSISTANT包 < SYSMAN.ENCRYPT函数 < SYS.UTL_I18N包。

然后退出sql,重新执行 emca -repos recreate。如果还是报错,请按照上面查找问题的思路解决问题,直到成功。

[oracle@db001 ~]$ emca -repos recreate;

STARTED EMCA at Jul 10, 2014 4:37:11 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

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

Do you wish to continue  [yes(Y)/no(N)]: y
Jul 10, 2014 4:37:24 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /oracle/cfgtoollogs/emca/xgdb/emca_2014_07_10_16_37_11.log.
Jul 10, 2014 4:37:25 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Jul 10, 2014 4:38:28 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Jul 10, 2014 4:38:29 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Jul 10, 2014 4:42:47 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Enterprise Manager configuration completed successfully
FINISHED EMCA at Jul 10, 2014 4:42:47 PM

3.2 配置文件布局

使用emca -config dbcontrol db命令来创建必要的配置文件。这个操作一般不会出错,注意填正确各个账户的密码就可以了。
[oracle@db001 ~]$ emca -config dbc