Oracle Version : 10.1.0.2.0
OS system : Windows XP sp2
SQL> create or replace directory DATA as 'c:\data';
Directory created.
SQL> grant read,write on directory data to hr;
Grant succeeded.
SQL> spool c:\logical_bkp\orcl.sql
SQL> column today new_val dt
SQL> select to_char(sysdate,'ddmmyy') today from dual;
TODAY
------
070307
SQL> PROMPT host expdp system/oracle@orcl DIRECTORY=data DUMPFILE=orcl_&dt..dmp-
> LOGFILE=orcl_&dt..log SCHEMAS=hr
host expdp system/oracle@orcl DIRECTORY=data DUMPFILE=orcl_070307.dmp LOGFILE=or
cl_070307.log SCHEMAS=hr
SQL>PROMPT exit;
exit
SQL> spool off
SQL> host type c:\logical_bkp\orcl.bat
sqlplus -s system/oracle@orcl @c:\logical_bkp\orcl.sql
NOTE: Schedule ORCL.BAT file through SCHEDULE TASK utility of windows.
No comments:
Post a Comment