How to replace and overwrite all existing objects in Oracle with impdp for full database import

datapumpexpdpimpdporacleoracle-12c

I want to replace all the existing objects in my database, not just tables, into my current database.

I ran expdp with the parameter full=yes as the system user, who I granted datapump_imp_full_database while logged in as sysdba, from the instance I am importing from. I ran impdp on the target database with the parameter table_exists_action=replace, but (understandably) only existing tables were replaced, but procedures, functions, views were not.

Is there an equivalent of table_exists_action for all objects? If not, how can I achieve this?

Both databases are Oracle 12c on Windows 10.

Best Answer

I don't think there is a "Replace" option for non-table objects like procedures, packages etc.

The best option would be to drop the schema entirely before the datapump import. This way, datapump will re-create the schema and all of the contained objects.