Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Script to create file .dmp and .log in .par file.

$
0
0

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


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>