1. Change Database downtime to archive Mode
SQL> archive log list
SQL> shutdown immediate
SQL> startup mount
SQL> alter database archivelog;
SQL> alter database open;
2. Point the database archive to ASM
SQL> alter system set db_recovery_file_dest_size = 200G;
SQL> alter system set db_recovery_file_dest = '+ data ';
3. Set Database Backup Redundancy to 2, and set the backup file to a directory in/home.
RMAN> configure controlfile autobackup on; # Set the automatic backup control file
RMAN> configure retention policy to redundancy 2;
RMAN> configure channel device type disk format'/home/oracle/backup/% U', '+ data ';
Set a copy of the backup on both local and storage:
RMAN> configure datafile backup copies for device type disk to 2;
RMAN> configure archivelog backup copies for device type disk to 2;
4. Create a full backup every day, archive backups every day, or do not perform any operations. Only redundant archives and backups are deleted during full backup.
Use crontab to schedule scripts to implement regular backup of databases and delete archives.
# Crontab-l
0 0 ** 6 su-oracle backup. sh // full backup database at every week
#
# Su-oracle
$ Cat/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/backup. sh
Rman target/recover file =/home/oracle/backup. rman log =/home/oracle/backup _ 'date + % Y % m % d % H % M % s'. log
$ Cat/home/oracle/backup. rman
Backup device type disk database plus archivelog delete all input;
Allocate channel for maintenance type disk;
Delete noprompt obsolete device type disk;
# Crontab-l
0 0 *** su-oracle backuparch. sh // backup and archive at every day
0 0 *** su-oracle dellog. sh // logs are processed at every day and only seven days of logs are saved.
#
# Su-oracle
$ Cat/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/backuparch. sh
Rman target/partition file =/home/oracle/backuparch. rman log =/home/oracle/backuparch _ 'date + % Y % m % d % H % M % s'. log
$ Cat/home/oracle/backuparch. rman
Backup archivelog all delete input;
$ Cat/home/oracle/app/oracle/product/11.2.0/dbhome_1/bin/dellog. sh
Find/home/oracle/backup *. log-mtime + 7-exec rm {}\;
Author "personal record"