100% found this document useful (1 vote)
2K views

Batch File in Windows For Oracle With Date and Time

This document contains a Windows batch script that sets variables for the current date and time, formats the time variables, and then runs an Oracle export to back up the full database to a file with a name that includes the date, time, and AM/PM designator. The export output and log file names will match this formatted name.

Uploaded by

arun
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
2K views

Batch File in Windows For Oracle With Date and Time

This document contains a Windows batch script that sets variables for the current date and time, formats the time variables, and then runs an Oracle export to back up the full database to a file with a name that includes the date, time, and AM/PM designator. The export output and log file names will match this formatted name.

Uploaded by

arun
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

set oracle_sid=orcl

setlocal
for /f "tokens=1-4 delims=/ " %%a in ('date /t') do set DATE=%%c-%%b-%%d
for /f "tokens=1-3 delims=: " %%a in ('time /t') do (
set hours=%%a
set minutes=%%b
set ampm=%%c
)
if {%ampm%}=={AM} if {%hours%}=={12} set hours=00
if {%ampm%}=={PM} (
for /f "delims=0 tokens=*" %%a in ("%hours%") do set hours=%%a
set /a hours+= 12
)

exp system/manager file=J:\full_backup_%date%_%hours%.%minutes%_%ampm%.dmp


log=J:\full_backup_%date%_%hours%.%minutes%_%ampm%.log full=y feedback=10000
buffer=2000000 statistics=none

exit

output:

full_backup_24-11-2008_20.30_PM.DMP -------The DMP output file format


full_backup_24-11-2008_20.30_PM.log ------- The LOG file output file format

You might also like