【EM】重新建立EM Database Control

mikeliuy發表於2013-05-30
前幾天使用RMAN的convert,做了一次資料庫整體遷移。遷移完成後發現Database Control不能使用了,在網上查了查需要重新建立(如果想修改DBSNMP的密碼,也是要重新建立的)。
下面是我記錄的重新建立過程。
1、清除資料庫中,與EM有關的物件

SQL> select * from dba_roles where role like 'MGMT%'; 

ROLE                           PASSWORD
------------------------------ --------
MGMT_USER                      NO

 

SQL> select username,default_tablespace from dba_users where account_status='OPEN'; 

USERNAME                       DEFAULT_TABLESPACE
------------------------------ ------------------------------
SYSTEM                         SYSTEM
SYS                            SYSTEM
SYSMAN                         SYSAUX
DBSNMP                         SYSAUX
MGMT_VIEW                      SYSTEM 

5 rows selected.

 

SQL> drop role MGMT_USER; 

Role dropped.

 

SQL> drop user MGMT_VIEW cascade; 

User dropped.

 

SQL> drop user SYSMAN cascade; 

User dropped

 

SQL> drop PUBLIC SYNONYM MGMT_TARGET_BLACKOUTS; 

Synonym dropped.

 

SQL> drop public synonym SETEMVIEWUSERCONTEXT; 

Synonym dropped.

2、使用emca進行重建
[oracle@db-dest ~]$ emca -config dbcontrol db -repos recreate
可以最後沒有執行成功,在/u01/app/oracle/products/10.2.0.1/db_1/cfgtoollogs/emca/ORCL目錄下檢視日誌,發現如下異常:
CONFIG: ORA-25153: Temporary Tablespace is Empty

進入資料庫檢視,果然臨時表空間沒有臨時檔案。

SQL> select tablespace_name,status from dba_tablespaces; 

TABLESPACE_NAME                STATUS
------------------------------ ---------
SYSTEM                         ONLINE
UNDOTBS1                       ONLINE
SYSAUX                         ONLINE
TEMP                           ONLINE
USERS                          ONLINE 

7 rows selected.

 

SQL> select tablespace_name,file_name from dba_temp_files; 

no rows selected
10g版本在整體遷移資料庫後,需要彌補的東西不少啊。執行下面的命令,將臨時檔案加入臨時表空間。

SQL> alter tablespace temp add tempfile '/u01/app/oracle/oradata/ORCL/tempfile01.dbf' size 50M autoextend on; 

Tablespace altered.

 

SQL> select tablespace_name,file_name from dba_temp_files; 

TABLESPACE_NAME FILE_NAME
------------------------------ ------------------------------
TEMP /u01/app/oracle/oradata/ORCL/tempfile01.dbf

好了 ,現在可以重新建立了。注意,還是要執行清除操作。


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

 

STARTED EMCA at Apr 28, 2013 5:21:58 PM

EM Configuration Assistant, Version 10.2.0.1.0 Production

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

 

Enter the following information:

Database SID: ORCL

Listener port number: 1521

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/products/10.2.0.1/db_1

 

Database hostname ................ db-dest.ocmu.org

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

Database SID ................ ORCL

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

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

 

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

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

Apr 28, 2013 5:22:15 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /u01/app/oracle/products/10.2.0.1/db_1/cfgtoollogs/emca/ORCL/emca_2013-04-28_05-21-58-PM.log.

Apr 28, 2013 5:22:18 PM oracle.sysman.emcp.EMReposConfig createRepository

INFO: Creating the EM repository (this may take a while) ...

Apr 28, 2013 5:29:03 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully created

Apr 28, 2013 5:29:23 PM oracle.sysman.emcp.util.DBControlUtil startOMS

INFO: Starting Database Control (this may take a while) ...

Apr 28, 2013 5:31:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: Database Control started successfully

Apr 28, 2013 5:31:13 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration

INFO: >>>>>>>>>>> The Database Control URL is <<<<<<<<<<<

Enterprise Manager configuration completed successfully

FINISHED EMCA at Apr 28, 2013 5:31:14 PM


紅色部分是需要設定的,還有sys,dbsnmp,sysman的密碼,看到藍色部分,說明重新建立成功了。

這時,可以進行訪問了。

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26812308/viewspace-762396/,如需轉載,請註明出處,否則將追究法律責任。

相關文章