DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Export file naming

  1. #1
    Join Date
    Feb 2001
    Posts
    27
    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?

  2. #2
    Join Date
    Apr 2001
    Posts
    21
    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 dimartin@chubb.com.


  3. #3
    Join Date
    Sep 2001
    Posts
    163
    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)
    goto :EOF
    :ParseDate
    for /f "tokens=1-4 delims=/.- " %%a in ('date /t') do (
    set Dow=%%a
    set %1=%%b
    set %2=%%c
    set YYYY=%%d)


    REM This will execute the export statement.

    exp system/manager full=y
    file=fullexport%yyyy%%mm%%DD%%.dmp log=fullexport.log

    It will create the file -> fullexport20010907.dmp (assume today is Sept. 7th, 2001)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width