none
Script to create file .dmp and .log in .par file. RRS feed

  • Question

  • First File (Batch File Script). this one ok. and this batch file taking user name and password and running the .par file (Second file details following), to create the .dmp file for export., after export done. Robocopy command is running in First File and creating file automatic and transfering data in external drive this is also ok. 

    issue is, i want to write script when batch file run the .par second file. will generate file name automatic and start process the data to export in .dmp file. 

    First File (Batch File Script). this one ok

    exp username/p@ssword parfile=D:\ABCFolder\XYZ\IMSApp\ExpImp\exportmeuat.par (this script running another file (.par file)
    pause

    @echo off
    for /f "delims=" %%a in ('wmic OS Get localdatetime  ^| find "."') do set "dt=%%a"
    set "YY=%dt:~2,2%"
    set "YYYY=%dt:~0,4%"
    set "MM=%dt:~4,2%"
    set "DD=%dt:~6,2%"
    set "HH=%dt:~8,2%"
    set "Min=%dt:~10,2%"
    set "Sec=%dt:~12,2%"

    set datestamp=%YYYY%%MM%%DD%
    set timestamp=%HH%%Min%%Sec%
    set fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%

    Robocopy "D:\ABCFolder\XYZ\IMSApp\BackUpDatabase\uat" "\\DS\Backup\uat\uat_%datestamp%" /MIR (After finish the export, here file transferring as backup)

    -----------------------------------------------------------------------------------------------------------------------

    Second File (PAR File) script.

    file=D:\ABCFolder\XYZ\App\BackUpDatabase\uat\uat05022014exp.dmp (want to generate automatic file here)
    owner=username
    grants=N
    indexes=Y
    compress=Y
    rows=Y
    buffer=64000
    direct=Y
    statistics=none
    log=D:\ABCFolder\XYZ\App\BackUpDatabase\uat\uat05022014exp.log (and same file name as .dmp)

    ------------------

    Salman

    Wednesday, February 5, 2014 11:51 AM

Answers

All replies

  • i write the same script in par to generate new file with datestamp. but its not working giving error 

    @echo off
    for /f "delims=" %%a in ('wmic OS Get localdatetime  ^| find "."') do set "dt=%%a"
    set "YY=%dt:~2,2%"
    set "YYYY=%dt:~0,4%"
    set "MM=%dt:~4,2%"
    set "DD=%dt:~6,2%"
    set "HH=%dt:~8,2%"
    set "Min=%dt:~10,2%"
    set "Sec=%dt:~12,2%"

    set datestamp=%YYYY%%MM%%DD%
    set timestamp=%HH%%Min%%Sec%
    set fullstamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%

    Wednesday, February 5, 2014 12:06 PM
  • What is "write same script in par"?  "par" is proprietary DB language used by the database vendor and is not Microsoft batch script.

    It is very hard to understand exactly what you are asking.  Please try to clarify.

    Here is how to get the date for a file name:

    echo %date:~10,4%-%date:~4,2%-%date:~7,2%

    You can do the same thing with %time%.


    ¯\_(ツ)_/¯

    Wednesday, February 5, 2014 1:49 PM
  • filename_currentdate_exp.par

    i want to generate above file in .PAR file. 

    following is my script. how i can do that? currently, i am changing file name in .par manually.

    ile=D:\ABCFolder\XYZ\App\BackUpDatabase\uat\uat05022014exp.dmp (want to generate automatic file here)
    owner=username
    grants=N
    indexes=Y
    compress=Y
    rows=Y
    buffer=64000
    direct=Y
    statistics=none
    log=D:\ABCFolder\XYZ\App\BackUpDatabase\uat\uat05022014exp.log 

    Wednesday, February 5, 2014 2:46 PM
  • You need to post your question in the Oracle forum

    ¯\_(ツ)_/¯

    • Marked as answer by goodcraze1 Thursday, February 6, 2014 6:26 AM
    Wednesday, February 5, 2014 3:02 PM
  • Thanks,

    its done. 

    Thursday, February 6, 2014 6:26 AM