Aramillo
Aramillo

Reputation: 3216

How to export/import object and collection types using expdp - Oracle

I'm trying to export a schema using expdp command. All schema objects are imported, except object and collections types. Do i need to set specific parameter for this?

--Commands
--Export
expdp system/pass@localhost:1521/orcl directory=my_dir schemas = tony_hr
dumpfile=tony_hr.dmp logfile=tpny_hr.log
--Import
impdp system/pass@localhost:1521/orcl directory=my_dir dumpfile=hr_tony.dmp 
logfile=hr_tony_imp.log remap_schema=tony_hr:hr2

I simulated the error in a test schema named tony_hr. This is a picture of all of its objects:

enter image description here

The export is executed successful, but when i'm trying to import(using remap_schema to hr2) i get some errors. This is the part where import fails.

ORA-39083: Fallo de creación del tipo de objeto TYPE:"HR2"."O_SEAT" con el error:
ORA-02304: literal de identificador de objeto no válido
El sql que falla es:
CREATE EDITIONABLE TYPE "HR2"."O_SEAT"   OID '02C3315E969E44D6BC7D797EDD9F2D96' IS OBJECT
(
    seat_id VARCHAR2 (8 BYTE),
    seat_category_name VARCHAR2 (32 BYTE)
ORA-39083: Fallo de creación del tipo de objeto TYPE:"HR2"."M_SEATS" con el error:
ORA-02304: literal de identificador de objeto no válido
El sql que falla es:
CREATE EDITIONABLE TYPE "HR2"."M_SEATS"   OID '0A71AFB95CCE4CC78558B571199AF83F' IS TABLE OF o_seat;

Sorry, because error messages are in spanish. Please ask if you have any doubt.

Upvotes: 3

Views: 12716

Answers (1)

anudeepks
anudeepks

Reputation: 1132

Please use the following parameters in your impdp command, it should import your other collection type objects too,

REMAP_SCHEMA=Old_username:New_Username (in case of different schema names )
REMAP_TABLESPACE=Old_tablespace_name:New_tablespace_name ( in case of diff tablespace name)
TRANSFORM=SEGMENT_ATTRIBUTES:n
TRANSFORM=OID:n

Upvotes: 5

Related Questions