- emctl start dbconsole
- emctl stop dbconsole
- emca -config dbcontrol db -repos create -host {hostname} -SID {Oracle SID} -PORT 1521
1- Logon SQLPLUS as user SYS or SYSTEM
2- EXEC sysman.emd_maintenance.remove_em_dbms_jobs;
3- EXEC sysman.setEMUserContext('',5);
4- REVOKE dba FROM sysman;
5-
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;
6- DROP USER mgmt_view CASCADE;
7- DROP ROLE mgmt_user;
8- DROP USER sysman CASCADE;
9- Then login shell and execute following:
emca -deconfig dbcontrol db -repos drop
Shell commands to create and drop em repository
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=TCP) (HOST={hostname}) (PORT=1521))) (CONNECT_DATA=(SERVICE_NAME={ORACLE SID}))) -repos_user SYSMAN -action drop -verbose -output_file $ORACLE_HOME/cfgtoollogs/emca/{ORACLE_SID}/emca_repos_drop_2006-01-18_03-02-57-PM.log
$ORACLE_HOME/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=TCP) (HOST={hostname}) (PORT=1521))) (CONNECT_DATA=(SERVICE_NAME={ORACLE SID}))) -repos_user SYSMAN -action create -verbose -output_file $ORACLE_HOME/cfgtoollogs/emca/{ORACLE_SID}/emca_repos_drop_2006-01-18_03-02-57-PM.log
No comments:
Post a Comment