Thursday, 18 November 2010

how to create a database directory on current SO directory

I needed to create a one-click import with datapump script on Windows operating system, and for this I needed to create a database directory mapped on the current directory where the dumps are.
So I wrote an sql file:
 create_directory.sql

CREATE OR REPLACE DIRECTORY DATAPUMP AS '&&1'
/
exit
/


And import_one_click.bat file looks like this:

sqlplus / as sysdba @create_directory.sql %CD%

impdp '/ as sysdba' directory=DATAPUMP  dumpfile=export_andrei.dmp logfile=import_andrei.log schemas='ANDREI'

No comments:

Post a Comment