Databases Reference
In-Depth Information
70. database
71. include current controlfile;
72. release channel c1;
73. release channel c2;
74. release channel c3;
75. release channel c4;
76. release channel c5;
77. release channel c6;
78. release channel c7;
79. release channel c8;
80. allocate channel d2 type disk format
81. '${LOC_PREFIX}8/CTLBKP_${ORACLE_SID}_${TIMESTAMP}.CTL';
82. backup current controlfile;
83. release channel d2;
84. }
85. exit
86. EOF
87. RC=$?
88. cat $TMPLOG >> $LOG
89. rm $LOCKFILE
90. echo 'date' "Script lock file removed" >> $LOG
91. if [ $RC -ne "0" ]; then
92. mailx -s "RMAN $BACKUP_TYPE $ORACLE_SID $BACKUP_MEDIA Failed" \
93. $DBAEMAIL,$DBAPAGER < $LOG
94. else
95. cp $LOG ${LOC_PREFIX}1
96. mailx -s "RMAN $BACKUP_TYPE $ORACLE_SID $BACKUP_MEDIA Successful" \
97. $DBAEMAIL < $LOG
98. fi
99. scp $LOG \
100. ${LOG_USER}@${LOG_SERVER}:${LOG_DIR}/${ORACLE_SID}/.
101. rm $TMPLOG
102. fi
The “How It Works” section describes the mechanics of the script.
You don't need to type this solution script. if you want to use it or adapt it to your own use, you'll find the script
in the zip file of script examples that you can download for this topic from the apress website.
Note
How It Works
We made this script as generic as possible. All the parameters are configurable. Keeping in that spirit, pretty much
everything in the script is parameter-driven. You can use the same script on any database on any Unix server. You
merely need to modify the parameters appropriately.
One issue we must clarify before you start the database backup to tape based on this script is the location of the
backup files. You can store the backup pieces on one mount point, such as /oraback. All the backup files go there.
However, sometimes it may not be advisable to store everything on a single mount point. Some tape backup systems
work more efficiently if the files are spread over multiple file systems (or mount points), since they allow for parallel
backup from all those mount points. If the files are on the same file system, the files are backed up to tape serially.
 
 
Search WWH ::




Custom Search