oracle 10g rac em重建實施步驟

paulyibinyi發表於2010-05-11

1.1.1  

bin/emca -deconfig dbcontrol db -cluster

 

[oracle@p595a2:/oracle/app/oracle]$emca -deconfig dbcontrol db -cluster

 

STARTED EMCA at May 10, 2010 5:02:53 PM

EM Configuration Assistant, Version 10.2.0.1.0 Production

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

 

Enter the following information:

Database unique name: fsyyk

 

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

May 10, 2010 5:02:58 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/fsyyk/emca_2010-05-10_05-02-53-PM.log.

May 10, 2010 5:03:00 PM oracle.sysman.emcp.util.DBControlUtil stopOMS

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

Enterprise Manager configuration completed successfully

FINISHED EMCA at May 10, 2010 5:03:44 PM  

        注意如果是雙機,則需要加-cluster選項。

1.1.2  

         Remove the following directories from your filesystem:
/
/oc4j/j2ee/OC4J_DBConsole__

         一般在執行2.1.1指令碼時會自動刪除上面目錄,如果沒刪除掉,請手工刪除

1.1.3   RepManager命令(兩個節點)

 

 In both 10g R1 and R2 run: 
/sysman/admin/emdrep/bin/RepManager -action drop
 
[oracle@p595a2:/oracle/app/oracle/product/10.2.0/db_1]$sysman/admin/emdrep/bin/RepManager p595a2 1521 fsyyk1 -action drop
Enter SYS user's password : 
Enter repository user name : dbsnmp
Enter repository user password : 
Getting temporary tablespace from database...
Found temporary tablespace: TEMP
Checking SYS Credentials ... OK.
Dropping the repository..
Quiescing DB ...

[oracle@p595a2:/oracle/app/oracle/product/10.2.0/db_1]$sysman/admin

/emdrep/bin/RepManager p595b2 1521 fsyyk2 -action drop

 

1.1.4  

Step 1: Drop AQ related objects in the SYSMAN schema
Logon SQLPLUS as user SYSMAN
SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'MGMT_NOTIFY_QTABLE',force =>TRUE);

Step 2: Drop the DB Control Repository Objects
Logon SQLPLUS as user SYS or SYSTEM, and drop the sysman account and management objects:
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP RESTRICT;
SQL> EXEC sysman.emd_maintenance.remove_em_dbms_jobs;
SQL> EXEC sysman.setEMUserContext('',5);
SQL> REVOKE dba FROM sysman;
SQL> DECLARE
CURSOR c1 IS
SELECT owner, synonym_name name
FROM dba_synonyms
WHERE table_owner = 'SYSMAN';
BEGIN
FOR r1 IN c1 LOOP
IF r1.owner = 'PUBLIC' THEN
EXECUTE IMMEDIATE 'DROP PUBLIC SYNONYM '||r1.name;
ELSE
EXECUTE IMMEDIATE 'DROP SYNONYM '||r1.owner||'.'||r1.name;
END IF;
END LOOP;
END;
/
SQL> DROP USER mgmt_view CASCADE;
SQL> DROP ROLE mgmt_user;
SQL> DROP USER sysman CASCADE;
SQL> ALTER SYSTEM DISABLE RESTRICTED SESSION;
注意這裡資料庫要停機。

/bin/emca -deconfig dbcontrol db -repos drop -cluster

[oracle@p595a2:/oracle/app/oracle/product/10.2.0/db_1]$emca -deconfig dbcontrol db -repos drop -cluster

 

STARTED EMCA at May 10, 2010 5:37:32 PM

EM Configuration Assistant, Version 10.2.0.1.0 Production

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

 

Enter the following information:

Database unique name: fsyyk

Listener port number: 1521

Password for SYS user: 

Password for SYSMAN user: 

Password for SYSMAN user: 

Password for SYSMAN user: 

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

May 10, 2010 5:37:54 PM oracle.sysman.emcp.EMConfig perform

INFO: This operation is being logged at /oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/emca/fsyyk/emca_2010-05-10_05-37-32-PM.log.

May 10, 2010 5:37:55 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration

WARNING: EM is not configured for this database. No EM-specific actions can be performed.

May 10, 2010 5:37:55 PM oracle.sysman.emcp.EMReposConfig dropRepository

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

May 10, 2010 5:37:56 PM oracle.sysman.emcp.EMReposConfig invoke

INFO: Repository successfully dropped

Enterprise Manager configuration completed successfully

 

注意加cluster選項和輸入sys,sysman等使用者密碼

圖形介面重建EM

   dbca,選擇叢集,選擇配置資料庫選項,選擇要配置的資料庫,

   刪除em,這時Enterprise Manager資料檔案庫是可選狀態的,輸入dbsnmp

   sysman使用者密碼,點finish,即可建立Em

   在建立過程中可以監控

/oracle/app/oracle/product/10.2.0/db_1/cfgtoollogs/dbca/fsyyk

下的emConfig.log

  如果出現以下資訊,則表示建立成功

****************  Current Configuration  ****************

 INSTANCE            NODE           DBCONTROL_UPLOAD_HOST

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

fsyyk1            p595a2            p595a2

fsyyk2            p595b2            p595a2

May 10, 2010 5:48:24 PM oracle.sysman.emcp.EMConfig restoreOuiLoc

      IE瀏覽器登入EM正常。

 

也可以用指令碼來重建em

參考metalink文件ID 278100.1 見附件

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

相關文章