The logs backed up by RMAN are put in a file. The backup script in nocatalg was sent using Linux Sendmail. However, this affects the system startup time. It is still sent using python. After the backup, call the script. Send RMAN logs to the mailbox. Check the email in the morning to check whether the backup is successful. Otherwise, it would be a little tiring to connect one server.
Shell script for incremental RMAN backup under nocatalog
Http://blog.csdn.net/tianlesoftware/archive/2011/01/26/6164931.aspx
The RMAN backup script of nocatalog will generate a log file under the same directory as the backup script. The following Python script sends the log file to the mailbox.
The Python script is simple as follows:
$ Cat sendrmanlog. py
#! /Usr/bin/Python
# Coding = GBK
# Created by tianlesoftware
#2011/2/24
Import OS
Import sys
Import smtplib
From_user = 'tianlesoftware @ vip.qq.com'
Smtp_server = '192. 168.1.100'
Email_user = 'tianlesoft'
Email_passwd = 'pwd'
To_users = ['tianlesoftware @ vip.qq.com ', 'tianlesoftware @ vip.qq.com']
Def mysendmail (fromaddr, toaddrs, subject, body ):
Server = smtplib. SMTP (smtp_server)
Server. login (email_user, email_passwd)
For toaddr in toaddrs:
MSG = 'from: % S/nto: % S/nsubject: % s/n % S/N' % (fromaddr, toaddr, subject, body)
Server. Sendmail (fromaddr, toaddr, MSG)
Server. Quit ()
Def load (fname = '/u01/backup/scripts/rman_backup.sh.out '):
Fp = open (fname)
Log = FP. Read ()
FP. Close ()
Return log
Body = load ()
Print body
Subject = '1970. 168.88.209 RMAN backup Log'
Mysendmail (from_user, to_users, subject, body)
Add the script to crontab:
$ Crontab-l
00 9 ***/u01/backup/scripts/sendrmanlog. py>/u01/backup/scripts/sendrmanlog. log 2> & 1
------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
Online Resources: http://tianlesoftware.download.csdn.net
Video: http://blog.csdn.net/tianlesoftware/archive/2009/11/27/4886500.aspx
Dba1 group: 62697716 (full); dba2 group: 62697977 (full)
Dba3 group: 62697850 super DBA group: 63306533;
Chat group: 40132017
-- Add the group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, the application is rejected.