Login to the repository database as SYS user and execute the below:
1. Drop the repository users:
drop user SYSMAN cascade;
drop user SYSMAN_MDS cascade;
drop user MGMT_VIEW cascade;
drop user SYSMAN_RO cascade;
drop user SYSMAN_OPSS cascade;
drop user SYSMAN_APM cascade;
drop user SYSMAN_BIP;
drop user CLOUD_SWLIB_USER cascade;
drop user CLOUD_ENGINE_USER cascade;
drop role MGMT_USER;
2. Drop the synonyms:
SQL> spool synonyms.lst
SQL> select 'drop '|| decode(owner,'PUBLIC',owner||' synonym '||synonym_name, ' synonym '||owner||'.'||synonym_name) ||';' from dba_synonyms where table_owner in ('SYSMAN', 'SYSMAN_MDS', 'MGMT_VIEW', 'SYSMAN_BIPLATFORM', 'SYSMAN_APM', 'SYSMAN_OPSS', 'SYSMAN_RO') ;
SQL> Spool off
SQL> @synonyms.lst
Note: The above query spools the list of synonyms (including the public synonyms) into a file named synonyms.lst. Execute the synonyms.lst at the sql prompt to drop all the listed synonyms.
After running the spooled output, execute the below query again to confirm that none of the synonyms are left behind:
SQL> select owner,synonym_name from dba_synonyms where table_owner in ('SYSMAN', 'SYSMAN_MDS','MGMT_VIEW','SYSMAN_BIP','SYSMAN_APM','SYSMAN_OPSS','SYSMAN_RO') ;
Query should not return any rows.
3. Drop the tablespace objects:
SQL> spool tablespaces.lst
SQL> select 'drop tablespace '||tablespace_name||' including contents and datafiles;' from dba_tablespaces where tablespace_name like 'MGMT%';
SQL> Spool off
SQL> @tablespaces.lst
Note: The above query should return three tablespaces (MGMT_ECM_DEPOT_TS, MGMT_TABLESPACE and MGMT_AD4J_TS). Confirm that only these three tablespaces are returned. This query spools the list of the three tablespaces ( into a file named tablespaces.lst,. Execute the tablespaces.lst file at the sql prompt to drop all the tablespaces.
4. Drop the registry objects:
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME='Metadata Services';
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME='Authorization Policy Manager';
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME='Oracle Platform Security Services';
commit;
Retry the installation after dropping the repository objects.
|