How to clean up duplicate objects in SYS/SYSTEM I have a sql query like below to check duplicate objects in SYS/SYSTEM.

select OBJECT_NAME, OBJECT_TYPE from
DBA_OBJECTS where OBJECT_NAME||OBJECT_TYPE
in (select OBJECT_NAME||OBJECT_TYPE from
DBA_OBJECTS where OWNER='SYS') and
OWNER='SYSTEM' and OBJECT_NAME not in
('AQ$_SCHEDULES_PRIMARY', 'AQ$_SCHEDULES',
'DBMS_REPCAT_AUTH');


I have a list of large duplicated objects. My question / problem is : how to get rid of the objects? What is the best way to approach this?
It seems you have run one of cat*.sql scripts as SYSTEM instead of SYS. Not cool.

Alternatives:


Contact support.
...or determine what exactly has been done, and then having the SQL script(s) revert the actions one by one. There is nothing in Oracle to help you, you need to determine by your own means (some old notes? old screenlogs? clues in old .bash_history?).
...or schedule downtime, expdp everything what is relevant in the entire database, re-create, impdp (of course don't impdp SYSTEM schema).
...or if you are unable to proceed with either 1, 2, 3, don't perform DROPs by any heuristics/guesswork. Continue as you are. Nothing really wrong with your database - just some extra objects in SYSTEM (not in SYS, I hope). They could stand in a way of some future action, but they might not, nobody knows. Normally perform cold backup before upgrade. Chances are the upgrade will be successful. Schedule steps 1,2,3 for later.