The "Vimal Mohan" Blog

Oracle, Unix basics & tricks for all those interested in discovering…

Archive for June, 2011

Datapump Import ORA-31627 & ORA-31655 in 11gR2

Posted by Vimal Mohan on June 27, 2011

Problem Description:
Datapump Import with name_expr in Oracle 11gR2 (11.2.0.2.0) is failing.
Same code was working fine in Oracle 10gR2 (10.2.0.4).
Stopped working following a database upgrade from 10gR2 to 11gR2.

Code:
Oracle Import Procedure is using Datapump API DBMS_DATAPUMP and thus the name_expr to list the tables for import.
DBMS_DATAPUMP.METADATA_FILTER(handle => v_dp_handle, name => ‘name_EXPR’, value => v_tab_exp);
where v_tab_exp is an IN clause of list of tables.

Error:
ORA-31627: API call succeeded but more information is available
ORA-31655: no data or metadata objects selected for job

Cause:
This is intended behavior and occurs due to the fix for bug:6831823 which went in to 11.2 and 10.2.0.5. The ORA-31655 error is now signaled following the fix for bug:6831823, as that bug which existed in previous versions meant that if a privileged user performed a table import from a full export dump, and the specified table name existed in multiple schemas, then all the tables would be imported where as only the table for the importing user should have been imported.

Solution:
Perform import with name_expr itself, but make sure you call and assign SCHEMA_EXPR before this, to let datapump know the source schema which owns the object in the dump file.
DBMS_DATAPUMP.METADATA_FILTER(handle => v_dp_handle, name => ‘SCHEMA_EXPR’, value => v_src_sch_exp);
where v_src_sch_exp is an IN clause of list of source schema name(s).
DBMS_DATAPUMP.METADATA_FILTER(handle => v_dp_handle, name => ‘name_EXPR’, value => v_tab_exp);
where v_tab_exp is an IN clause of list of tables.

Posted in Oracle | Leave a Comment »