How To Remove Oracle Enterprise Manager In 11.2 Manually

This is only one, there are several. Execute the following comands;

 connect / as sysdba
spool remove.log
EXEC DBMS_AQADM.DROP_QUEUE_TABLE(QUEUE_TABLE=>'SYSMAN.MGMT_NOTIFY_QTABLE',FORCE =>TRUE);
SHUTDOWN IMMEDIATE;
STARTUP RESTRICT;
EXEC SYSMAN.EMD_MAINTENANCE.REMOVE_EM_DBMS_JOBS;
EXEC SYSMAN.SETEMUSERCONTEXT('',5);
REVOKE DBA FROM SYSMAN;

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;
/

DROP USER mgmt_view CASCADE;
DROP ROLE mgmt_user;
DROP USER sysman CASCADE;
ALTER SYSTEM DISABLE RESTRICTED SESSION;
spool off
exit

HTH – Antonio NAVARRO

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s