Monday, July 16, 2012

drop and re-create of dbconsole.

 drop and re-create of dbconsole. Here are the steps:

-----------------------------
To drop and recreate follow this note:

How To Drop, Create And Recreate DB Control In A 10g/11g Database (Doc ID 278100.1)

1) stop dbconsole

emctl stop dbcosnole

2) the drop

Step 1: Drop AQ related objects in the SYSMAN schema

Logon to SQLPLUS as the user SYS

SQL> exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force=>TRUE);


Note: For 11.2 datrabase, logon to SQLPLUS as the user SYS (not SYSMAN) and run:

exec DBMS_AQADM.DROP_QUEUE_TABLE(queue_table=>'SYSMAN.MGMT_NOTIFY_QTABLE',force =>TRUE);

Step 2: Drop the DB Control Repository Objects

Logon to SQLPLUS as the user SYS or SYSTEM, and drop the sysman account and management objects:

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;


3) Manually remove the files:

Section A, Option 2. Delete DB Control Configuration Files Manually (and for windows update the registry)

4) the create

Section B, Option 2. Create the DB Control Repository Objects and Configuration Files


Please note carefully that the drop and create put the database in Quiesce Mode. This note provides information about what that means.

From 11.2.0.1.0 release, the database is NOT put into quiesce mode anymore for repository drop and recreate operation. This means that emca drop and recreate commands can be executed for 11.2.0.1 database without impacting other sessions in the database.

1 comment: