RE: win batch file for exp daily

  • From: "Sweetser, Joe" <JSweetser@xxxxxxxx>
  • To: Joan Hsieh <joanhsieh08@xxxxxxxxx>
  • Date: Fri, 2 Mar 2018 18:51:51 +0000

Understood.  Is there an error when you run the script?  Or simply no output 
and no dump file.

-joe

From: Joan Hsieh <joanhsieh08@xxxxxxxxx>
Sent: Friday, March 2, 2018 11:46 AM
To: Sweetser, Joe <JSweetser@xxxxxxxx>
Cc: oracle-l@xxxxxxxxxxxxx
Subject: Re: win batch file for exp daily

Thanks Joe,

This job is set for our client, they are all running on windows. To my 
understanding, they want to set up in task schedulers. I need to  make the bat 
file run properly and to set it in task scheduler later?

TY

On Fri, Mar 2, 2018 at 1:39 PM, Sweetser, Joe 
<JSweetser@xxxxxxxx<mailto:JSweetser@xxxxxxxx>> wrote:
This doesn’t answer your question (sorry), but have you considered 
installing/using cygwin 
(https://www.cygwin.com/<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.cygwin.com%2F&data=02%7C01%7CJSweetser%40icat.com%7Cc21e9048819f43a3286d08d5806de494%7C5d3bf30e9adb4c17b2425c17523e6e5e%7C0%7C0%7C636556131831605202&sdata=gadDNc90aD8s9T%2FnZgk5xWKyKoRM2TXgCm8HeZRv0Tk%3D&reserved=0>).
  Very helpful for those transitioning to Windows from Linux/Unix.  Free.  
Functional.  I use it for an X server.  I think it “does cron”, too.

-joe


From: oracle-l-bounce@xxxxxxxxxxxxx<mailto:oracle-l-bounce@xxxxxxxxxxxxx
<oracle-l-bounce@xxxxxxxxxxxxx<mailto:oracle-l-bounce@xxxxxxxxxxxxx>> On Behalf 
Of Joan Hsieh
Sent: Friday, March 2, 2018 11:30 AM
To: oracle-l@xxxxxxxxxxxxx<mailto:oracle-l@xxxxxxxxxxxxx>
Subject: win batch file for exp daily

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

This e-mail transmission and any attachments that accompany it may contain 
information that is privileged, confidential or otherwise exempt from 
disclosure under applicable law and is intended solely for the use of the 
individual's to whom it was intended to be addressed. If you have received this 
e-mail by mistake, or you are not the intended recipient, any disclosure, 
dissemination, distribution, copying or other use or retention of this 
communication or its substance is prohibited. If you have received this 
communication in error, please immediately reply to the author via e-mail that 
you received this message by mistake and also permanently delete the original 
and all copies of this e-mail and any attachments from your computer. Please 
note that coverage cannot be bound or altered by sending an email. You must 
receive written confirmation from a representative of our firm to put coverage 
in force or make changes to an existing policy.

This e-mail transmission and any attachments that accompany it may contain 
information that is privileged, confidential or otherwise exempt from 
disclosure under applicable law and is intended solely for the use of the 
individual's to whom it was intended to be addressed. If you have received this 
e-mail by mistake, or you are not the intended recipient, any disclosure, 
dissemination, distribution, copying or other use or retention of this 
communication or its substance is prohibited. If you have received this 
communication in error, please immediately reply to the author via e-mail that 
you received this message by mistake and also permanently delete the original 
and all copies of this e-mail and any attachments from your computer. Please 
note that coverage cannot be bound or altered by sending an email. You must 
receive written confirmation from a representative of our firm to put coverage 
in force or make changes to an existing policy.

Other related posts: