Ask the Expert

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?

    Requires Free Membership to View

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

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

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: