When I issued following command to import the data using
impdp user/password directory=dump_dir dumpfile=mydump.dmp remap_schema=source_schema:target_schema
I started getting following error
ora-31655: no data or metadata objects selected for job
ora-39154: objects from foreign schemas have been removed
Normally this would happen, if the source schema parameter
in remap_schama is wrong. But in this case I was pretty much sure, that the
parameter was correct. So I checked the user DDL, to make sure that it is
created with correct privileges
set long 9999 set pages 100 SELECT DBMS_METADATA.GET_DDL('USER','MYUSER') || ';' from dual UNION ALL SELECT DBMS_METADATA.GET_GRANTED_DDL('ROLE_GRANT','MYUSER') || ';' from dual UNION ALL SELECT DBMS_METADATA.GET_GRANTED_DDL('SYSTEM_GRANT','MYUSER') || ';' from dual;
Found the problem to be missing grant. Granted imp_full_database grant and impdp
worked fine after that.
SQL> grant imp_full_database to myuser; Grant succeeded.
Later found that database was flashbacked and correct grants were not added back