Export database as DMP file, set file name according to current export time
@ECHO Offecho back up data from SCOTT users ... SET Dbusername=Scottset Dbpassword=1234SET DBName=Orclset date_string=%date%SET time_string=%time%IF"%date_string:~3,1%"==" "(SET date_string=%date:~4,Ten%) ELSE (SET date_string=%date:~0,Ten%) IF"%time_string:~0,1%"==" "(SET time_string=0%time_string:~1,1%-%time_string:~3,2%-%time_string:~6,2%) ELSE (SET time_string=%time_string:~0,2%-%time_string:~3,2%-%time_string:~6,2%) SET Dmpfilename=%dbusername%_%date_string%_%time_string%. Dmpset Rarfilename=%dbusername%_%date_string%_%time_string%. Rarexp%dbusername%/%dbpassword%@%dbname% file=d:\backup\scott%Date:~0,4%_%Date:~5,2%_%Date:~8,2%. Dmprar A%rarfilename%%dmpfilename%-M5-Dfecho%timestring%ECHO========================================ECHO has exported the DMP file:"%dmpfilename%"REM PAUSE
Saving the file as a. bat file allows you to double-click to export.
Oracle Export Database DMP file