How to use a wrapper script with cold backups in Oracle
I'm new to DBA work and I have an Oracle 8.1.7 database on a Windows 2000 server. I have to make a cold backup through bat files. I have scheduled the jobs in the Windows scheduler, and that part works fine. My question now is, how can I automatically check if the backup has run successfully?
I now check the scheduler log each day but this is not really something I want to be doing manually each day. Something like an email would be easier. How is this normally done?
Today's Oracle DBA typically uses RMAN for backup and recovery. But cold backups from your own scripts are still perfectly acceptable. What I typically do in your scenario is to create a wrapper script for my cold backup script. All the wrapper script does is to call the cold backup script and dump its output to a text file. The last thing the wrapper script does is email the text file's contents to me. So assume the cold backup script is called "cold_backup.bat". The wrapper script can look like the following:
C:script_dircold_backup.bat > C:script_dircold_backup.txt
Mail_routine C:script_dircold_backup.txt email@example.com
The wrapper script is pretty simple. The only thing that is that you need a mail routine to forward the file to you. On Unix/Linux, you could use mailx or something like that. For Windows, I use a utility called Blat for mailing these types of text files to my email account.
Once you have the wrapper script set up, schedule the wrapper script for execution, not the cold backup script.
This was first published in December 2008