RMAN backup can only be performed in Oracle archive mode.
Check whether the database is in archive Mode
Archive log list
Change the database archive Mode
Shutdown immediate
Startup mount
Alter database archivelog;
Alter database open;
View the RMAN backup Environment
Rman target/
Show all;
Enable automatic backup of Control Files
Configure controlfile autobackup on;
Show controlfile autobackup;
Full database backup
Backup database;
View backup information
List backup;
List backup summary;
Write backup script
Zero-level full-database backup script
Vi BackupFull. sh
# Date 2014/4/6
Export ORACLE_SID = orcl
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export PATH = $ PATH: $ ORACLE_HOME/bin:
Rman target/<EOF_RMAN
Run {
Allocate channel c1 type disk;
Backup incremental level 0 tag 'db0' format 'u01/app/oracle/Backup/db0 _ % d _ % T _ % s' database
Include current controlfile;
Delete nopromp obsolete;
Release channel c1;
}
# End
Level 1 Incremental Backup
Vi Incr1.sh
# Date 2014/4/6
Export ORACLE_SID = orcl
Export ORACLE_BASE =/u01/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export PATH = $ PATH: $ ORACLE_HOME/bin:
Rman target/<EOF_RMAN
Run {
Allocate channel c1 type disk;
Backup incremental level 1 tag 'db1' format 'u01/app/oracle/Backup/db0 _ % d _ % T _ % s' database
Include current controlfile;
Delete nopromp obsolete;
Release channel c1;
}
# End
Chmod 755 BackupFull. sh
Chmod 755 Incr1.sh
Automatic Backup Script Execution
Crontab-e
0 1 ** 0/u01/app/oracle/Backup/BackupFull. sh
>/U01/app/oracle/Backup/BackupFull. log
0 1 ** 3/u01/app/oracle/Backup/BackupFull. sh
>/U01/app/oracle/Backup/BackupFull. log
30 1 ** 1-2/u01/app/oracle/Backup/Incr1.sh
>/U01/app/oracle/Backup/Incr1.log
30 1 ** 4-6/u01/app/oracle/Backup/Incr1.sh
>/U01/app/oracle/Backup/Incr1.log
Ps: perform full-database backup at on Sunday and Wednesday, and perform Incremental backup at level 1 at on the remaining days.
View crontab
Crontab-l
Recommended reading:
RMAN: Configure an archive log deletion policy
Basic Oracle tutorial-copying a database through RMAN
Reference for RMAN backup policy formulation
RMAN backup learning notes
Oracle Database Backup encryption RMAN Encryption