win batch file for exp daily

  • From: Joan Hsieh <joanhsieh08@xxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 2 Mar 2018 13:29:59 -0500

Hi List,

I'm new to the window's world, I need to set up a job to expdp database
daily like cron job on linux.

First, I created the bat file as below, it didn't run, if I run the
command, it runs. Can someone help me on this?

Thanks,

TY


rem Sample batch file to do daily export
@echo Export started at:
@echo
date /T
time /T
rem Here's a one-line NT command (but a LONG line!)
rem one that splits all the date parts out, putting
rem each one into it's own variable (weekday, day, month, year)
for /f ""tokens=1-4 delims=/ "" %%a in ('date /t') do (set weekday=%%a& set
day=%%b& set month=%%c& set year=%%d)

set logfile=%year%_%month%_%day%.log
set expfile=%year%_%month%_%d

set ORACLE_SID=oracle8
set ORACLE_HOME=E:\app\product\12.1.0\dbhome_1

E:\app\product\12.1.0\dbhome_1\bin\expdp.exe system/Senior12@oracle8
schemas=test directory=data_pump_dir dumpfile=testdump%T.dmp
logfile=testlog.log job_name=test

@echo Export completed at:
@echo
date /T
time /T

Other related posts: