I need to create a batch file that will run the export command and create the export file with the current date as part of the naming convention. (i.e. exp full=y file=exp09052001.dmp).
How could this be done in both a Unix and NT environment?
It can definitely be done in a Unix enviroment, but I'm not that familiar with NT so I can't be sure. If you would like the Unix syntax please email me at firstname.lastname@example.org.
Here is a piece of code I got from some site on the internet. (The top part only. The bottom part I added.) Don't ask me what site I got it from because I can't remember. I went to so many.
This can be executed from a batch file in Win NT.
echo. | date | FIND "(mm" > NUL
if errorlevel 1 (call :ParseDate DD MM) else (call :ParseDate MM DD)
for /f "tokens=1-4 delims=/.- " %%a in ('date /t') do (
REM This will execute the export statement.
exp system/manager full=y
It will create the file -> fullexport20010907.dmp (assume today is Sept. 7th, 2001)
Click Here to Expand Forum to Full Width