今天在使用impdp導入的時候(同一數據庫中轉換schema),遇到了
ORA-39083: Object type TYPE failed to create with error:
ORA-02304: invalid object identifier literal
具體報錯的sql是 CREATE TYPE "xx"."xxxxx" OID '1J35J43H1J5H2JK3HJ52H3J45' AS OBJECT
此type無法創建成功,原因是OID重復,OID就是object id。
查看impdp help=y 可以使用一個參數:transform
TRANSFORM
Metadata transform to apply to applicable objects.
Valid transform keywords: SEGMENT_ATTRIBUTES, STORAGE OID, and PCTSPACE.
OID - If the value is specified as n, the assignment of the exported OID during the
creation of object tables and types is inhibited. Instead, a new OID is assigned.
This can be useful for cloning schemas, but does not affect referenced objects. The
default value is y.
這個參數默認是Y,如果改成N,那么導入的時候會把各個對象重新賦予新的OID。
transform=oid:n
這樣,再用impdp導入的時候就不會出現
ORA-39083: Object type TYPE failed to create with error:
ORA-02304: invalid object identifier literal
注意:exp/imp不支持oid轉換,又是一個使用數據泵的優勢。