Skip to content

Instantly share code, notes, and snippets.

@tmarwen
Forked from bulain/ora_impdp_expdp.bat
Last active August 29, 2015 14:15
Show Gist options
  • Save tmarwen/fab2dd0fb642be6e1e75 to your computer and use it in GitHub Desktop.
Save tmarwen/fab2dd0fb642be6e1e75 to your computer and use it in GitHub Desktop.
# create directory
create directory dmpdir as 'c:/temp';
select directory_name,directory_path from dba_directories;
# expdp owner
create user scott identified by tiger;
grant connect, resource to scott;
...
grant read, write on directory dmpdir to scott;
expdp scott/tiger@xe directory=dmpdir dumpfile=scott.dmp logfile=expdp.log
# impdp owner
create user new_scott identified by tiger;
grant connect, resource to new_scott;
grant read, write on directory dmpdir to new_scott;
impdp new_scott/tiger@xe directory=dmpdir dumpfile=scott.dmp remap_schema=scott:new_scott logfile=impdp.log
# other example
expdp system/system@xe directory=dmpdir dumpfile=schemas.dmp logfile=expdp.log schemas=schema1,schema2
impdp system/system@xe directory=dmpdir dumpfile=schemas.dmp logfile=impdp.log table_exists_action=replace schemas=schema1,schema2
impdp system/system@xe directory=dmpdir dumpfile=schemas.dmp logfile=impdp.log table_exists_action=replace schemas=schema1,schema2 remap_tablespace=ts1:new_ts1 remap_schema=schema1:new_schema1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment