After a period of observation found that two local and remote two dataguard run relatively stable, so decided to put the day-to-day backup on the Datagurad.
To share the pressure of the main library. The main library only makes full backups on a regular basis.
Backup scripts: rman_back.sh
Because the database is relatively small, do not do incremental backup, directly done a full backup.
#!/bin/bash
export Oracle_base=/u01/ora
export oracle_home= $ORACLE _base/product/11.2.3/db_1
Export ORACLE_SID=ORCLPRD
export path=/usr/sbin: $ORACLE _home/bin: $PATH
rman target/<<eof
run{
Backup Database
Skip inaccessible
plus archivelog
filesperset
}
Allocate channel for maintenance device type disk;
Crosscheck backupset;
Delete noprompt obsolete;
Exit;
Eof
Grant rman_back.sh to Oracle users for permission to execute
chmod 744 rman_back.sh
Add a backup script to the crontab
Crontab-e
* * sh /u01/ora/backup/rman_back.sh >>/u01/ora/backup/rman_back.log
To delete an archive script:
More rman_del_archivelog.sh
#!/bin/bash
export Oracle_base=/u01/ora
export oracle_home= $ORACLE _base/product/11.2.3/db_1
Export ORACLE_SID=ORCLPRD
export path=/usr/sbin: $ORACLE _home/bin: $PATH
rman target/ <<eof
Crosscheck Archivelog all;
Delete noprompt expired archivelog all;
Delete noprompt Archivelog until time ' sysdate-7 ';
Exit;
Eof
More del_archivelog.sh
#!/bin/bash
##### logfile=/u01/ora/arch01/del_archive.log
date= ' date +%y-%m-%d:%h:%m:%s '
echo--- -------Begin Delete archivelog $date----------"
sh /u01/ora/arch01/rman_del_archivelog.sh
echo"--- -------End Delete archivelog $date----------"
date
Add the Delete archive script to the crontab
Crontab-e
* * sh /u01/ora/arch01/del_archivelog.sh >>/u01/ora/arch01/del_archive.log