1. Concurrency: Mainly used to improve the speed of backup, can be divided into manual concurrency or automatic concurrency
Manual concurrency: Assigning multiple channels and assigning files to a specific channel
Rman> Run {
2> Allocate channel CH1 device type disk;
3> Allocate channel CH2 device type disk;
4> Allocate channel CH3 device type disk;
5> Backup Incremental Level=0
6> format '/u01/app/oracle/rmanbak/df_%d_%u '
7> (datafile 1 channel ch1 tag= ' sys ')
8> (datafile 3 channel ch2 tag= ' aux ')
9> (datafile 2,4,5,6 channel CH3 ' other ');
10> SQL ' alter system archive log current ';
11> release channel CH1;
12> release channel CH2;
13> release channel CH3;
14>}
Automatic Concurrency: Use Configure to configure concurrency
Rman> Configure device type disk parallelism 3 backup type to backupset;
--The following backup will automatically enable channel execution concurrency
Rman> Backup Database format '/u01/app/oralce/rmanbak/p3_%u ';
2. Reuse Backup
Copy multiple copies of a backup set, the same backup set, Oracle can reuse a maximum of
Manual designation:
Rman> backup copies 2 datafile 4
2> format '/u01/app/oracle/rmanbak/d1/df_%u ',
3> '/u01/app/oracle/rmanbak/d2/df_%u ';
Auto-Specify: Configure the following parameters
Rman> Configure DataFile backup copies for device type disk to 2; --Specifies the number of copies of the backup data file
Rman> Configure Archivelog backup copies for device type disk to 2;--specify number of backups log file copies
3. Backup Backup Set
Bacup Backupset
4. Mirrored backup
When a mirrored backup checks for bad blocks in the data file, you can use Nochecksum to skip detection of bad blocks
You can also specify how many bad blocks the maxcorrupt determines, and Oracle stops the mirrored backup
rman> Backup as Copy
2> datafile 4 format '/u01/app/oracle/rmanbak/users.dbf ' tag= ' users '
--The following command is equivalent to the previous one
Rman> copy datafile 4 to '/u01/app/oracle/rmanbak/user01.dbf ';
rman> Backup as Copy
2> archivelog like ' O1_mf_1_118_6chl1byd_.arc '
3> format '/u01/app/oracle/rmanbak/arch_1015.bak ';
--The default backup is a mirrored copy after using the following configure command to set the backup type to copy
Rman> Configure device type disk parallelism 1 backup type to copy;
Rman> Backup DataFile 4--This command backs up the mirrored copy because of the above setting
2> format '/u01/app/oracle/rmanbak/users.dbf.bak ' tag=users;
--use parallelism to perform a mirrored copy
Rman> Configure device type disk parallelism 4;
rman> Backup as copy #3 files copied in parallel
2> (datafile 1 format '/u01/app/oracle/rmanbak/df1.bak ')
3> (datafile 2 format '/u01/app/oracle/rmanbak/df2.bak ')
4> (datafile 3 format '/u01/app/oracle/rmanbak/df3.bak ');
Specifies a clause db_file_name_convert to implement a mirrored path transfer when mirroring a backup, which is also an initialization parameter for primary DB to standby DB
The conversion of the data file
Db_file_name_convert = (' string1 ', ' string2 ', ' string3 ', ' String4 ' ...)
Replace String1,string4 with string2 replace String3
rman> Backup as Copy device type disk
2> db_file_name_convert (' Oradata/orcl ', ' BK/RMBK ')
3> tablespace users;
5. Compress backup Set
Rman> Configure channel Device type disk format '/u01/app/oracle/rmanbak/%d_%u.bak ';
--The following command uses the parameter as compressed to implement manual compression
Rman> Backup as compressed backupset database;
Rman> Backup as compressed backupset datafile 4,5,6;
--Following the use of the Configure command to configure the automatic compression backup set feature, subsequent backups will automatically use the compression feature
Rman> Configure device type disk parallelism 4 backup type to compressed backupset;
--because automatic compression is set, the following command compresses the system tablespace and control files, parameter files that are backed up
Rman> backup tablespace system tag=system;
6. Use tag tag
The tag tag can specify a meaningful name for the backup set or the image copy for subsequent use, with the following advantages
Provide descriptive information for backup sets or image replicas
Ability to use better location backup files in the list command
Ability to use in Restore and switch commands
The same tag is used in multiple backup sets or multiple image replicas
When the tag tag is not specified, the system produces the default tag tag, which is in the format: TAGYYYYMMDDTHHMMSS
Rman> Backup as compressed backupset datafile 1,2,3 tag= ' Monthly_full_bak ';
Rman> Backup as compressed backupset tablespace users tag= ' Weekly_full_bak ';
rman> list backupset Tag=monthly_full_bak;
7. Incremental backup
A differential incremental backup backs up all data blocks that have changed since the last incremental backup
A cumulative incremental backup backs up all the changed blocks since the last-level incremental backup
--Enable level incremental backups below
Rman> run{
2> Allocate channel CH1 type disk;
3> Backup Incremental Level 0 database
4> format '/u01/app/oracle/rmanbak/db_%d_%u '
5> Tag=db_inc_0;
6> release channel CH1;
7>}
Sql> select Sid,sofar,totalwork from V$session_longops; --Query backup situation
--Enable level differential incremental backups below
Rman> run{
2> Allocate channel CH1 type disk;
3> Backup Incremental Level 1 database
4> format '/u01/app/oracle/rmanbak/db1_%d_%u '
5> tag=db_inc_1;
6> release channel CH1;
7>}
--Enable cumulative incremental backups below
Rman> run{
2> Allocate channel CH1 type disk;
3> Backup Incremental Level 1 cumulative database
4> format '/u01/app/oracle/rmanbak/dbc_%d_%u '
5> tag=db_inc_c_1;
6> release channel CH1;
7>}
8. Enable block change tracking
Enabling block change tracking is to specify that a file is used to record which blocks in the data file have changed, and that it is only necessary to read the file to back up the Ramn for incremental backups
A changed block, which reduces backup time and I/O resources.
Use the following command to enable block change tracking
ALTER DATABASE ENABLE block change tracking USING FILE ' <dir> '
Sql> ALTER DATABASE enable block change tracking
2 using file '/U01/APP/ORACLE/ORADATA/ORCL/BLK_CH_TRC.TRC ';
Sql> Ho ls-lht/u01/app/oracle/oradata/orcl/blk_ch_trc.trc
-RW-R-----1 Oracle oinstall 12M Oct 19:41/U01/APP/ORACLE/ORADATA/ORCL/BLK_CH_TRC.TRC
Sql> select * from v$block_change_tracking;
STATUS FILENAME BYTES
---------- --------------------------------------------- ----------
ENABLED/U01/APP/ORACLE/ORADATA/ORCL/BLK_CH_TRC.TRC 11599872
Sql> ALTER DATABASE disable block change tracking; --disable after block change tracking file is automatically deleted
Sql> select * from v$block_change_tracking;
STATUS FILENAME BYTES
---------- --------------------------------------------- ----------
DISABLED
9. Backup Retention Policy
Retention policies are primarily reserved for backup copies of rules that are typically used to meet recovery or other needs (such as disk space or tape space size limits)
Backup retention policies are divided into redundancy and recovery windows, which are incompatible with each other, either using the former or using the latter
Backup redundancy
tacitly, it can be modified by rman> configure retention policy to redundancy 2;
When last, Rman generates a backup for each data file, archive log, and control file. You can use the obsolete command to view backups with more than a few backups
and use the delete obsolete to remove obsolete backups
Recovery window
The recovery window allows a point-in-time recovery to be restored to a point in the past, usually set to the number of days
Use the command rman> configure retetion policy to recovery windows of 7 days
This command ensures that sufficient data files and archived logs are available to perform an incomplete recovery that can return any point in the one-week period, and allow deletion over time
To an obsolete backup, that condition should be met: Sysdate-backup CHECKPOINT time >= 7
Backups that are required for greater than day but for recovery are still preserved
Clear Backup Retention Policy
Rman> Configure retention policy clear;
Pay attention to obsolete and expired
Obsolete: Refers to the retention policy to determine whether the backup is required at the time of recovery, such as if it is not required or has an updated backup to replace it, the backup set is placed as
Obsolete, an obsolete backup set or mirrored copy.
Expired: Refers to the backup set or mirror copy that is located according to the backup information recorded in the storage warehouse when the crosscheck is executed, and the corresponding backup set or mirror pair is not found
, these backup sets or mirrored replicas are placed as expired.
10. Use Backup ... Validate validation data file logical bad block, corrupted bad block will be logged to V$database_block_corruption view
BACKUP VALIDATE CHECK LOGICAL DATABASE archivelog all;