Look in:

Web oracle-core-dba.blogspot.com

Tuesday, June 12, 2007

Script to Schedule a Full Database Export backup

Script to Schedule a Export backup daily three times at 6:00AM,2:30PM,10:30PM.

SCRIPT:

schtasks /create /sc hourly /mo 8 /sd 06/07/2007 /ST 22:30:00 /tn MyDailyBackup /tr C:\sree_backup\SREE_BACKUP.bat /RU sree\kasukurthi.sridhar /RP sreetest@9


Where

/sc = Schedule Creation
/mo = Modification time
/sd = schedule date
/st = schedule time
/tn = transaction name
/tr = transaction to run( Batch file along with path )
/ru = remote user (if not specified it will takke local user name)
/ru = remote password ( if not specified it will prompt at the run time )



To delete above task issue below command at OS prompt

SCHTASKS /Delete /TN "MyDailyBackup" /f

Batch file contents:

@echo off
move old_sree.dmp "C:\sree_backup\move_old\"
move old_sree.log "C:\sree_backup\move_old\"
rename sree.dmp old_sree.dmp
rename sree.log old_sree.log
exp userid=edr/sree@edr file=c:\sree_backup\sree.dmp log=c:\sree_backup\sree.log full=y buffer=2000000

No comments: