In the net, there are many backup/recovery scripts available. However, none of the script checks following conditions.
1) ALTER TABLESPACE xyz BEGIN BACKUP
2) SQL> !cp somewhere.dbf /tmp/somewhere.dbf.bak
For Case 1, if we can't ALTER TABLESPACE xyz BEGIN BACKUP, the backup file is useless.
For Case 2, if the /tmp did not have enough capacity, the scripts will still proceed eventhough the cp is not successful.
Any way to detect above error conditions in scripts?
guess you should include the following at the beginning of your scripts ... if I have correctly understood your pb ;)
WHENEVER OSERROR exit;
WHENEVER SQLERROR exit;
The best way for automated backup scripts is to check the available space in the target directory. If the space is not available, send a mail to DBA and do not start "ALTER TABLESPACE XXXX BEGIN BACKUP" at all.
Click Here to Expand Forum to Full Width