Oracle-RMAN backup (III)

Source: Internet
Author: User

Oracle-RMAN backup (iii) I. concepts related to Incremental Backup 1. the preceding section describes the complete backup of RMAN. The full backup is the block used for the backup, but not the block that has not been used. The Incremental Backup only backs up the block that has been changed since the last backup. 2. even if the default RMAN operation is to scan the entire data file during Incremental backup to determine which blocks have been changed, it still saves time, because in all cases, the bottleneck lies in the write operations on the disk, rather than reading files. If you enable block change tracking again, you do not need to scan the entire file, and the backup time is greatly reduced. 3. User-managed backups cannot be incremental backups, but RMAN can. 4. incremental backup is divided into cumulative incremental backup and differential incremental backup. Cumulative Incremental backup is all changed blocks since the last full backup. Differential Incremental backup is the block that has been changed since the last Incremental backup. Ii. Incremental Backup Level 1. Incremental Backup depends on the starting point that contains all blocks: This is called incremental level 0 backup. Then, differential incremental Level 1 backup will extract all changed blocks since the last level 1 backup. If there is no backup between Level 1, extract the blocks that have been changed since the last level 0 backup. The accumulated Incremental Backup will extract all the blocks that have been changed since the last level 0 backup, regardless of whether there is any level 1 backup during this period. 2. the incremental level 0 backup has the same effect as the full backup, but the incremental level 0 backup can be used as the starting point of the Incremental backup, but the full backup cannot. 3. In earlier versions of RMAN, the incremental level can be 0 to 4. Different incremental backups contain only modified blocks from level n (1 ~ 4) or lower. Cumulative incremental backups contain only modified blocks from level n (0 ~ 3) or lower. that is to say, differential Incremental Backup backs up the blocks of all changes between two identical levels (that is, the interval between the two) or does not have the same backup level as the current level, and finds the lower level, backup the change blocks between the two. Incremental backup is used to back up all the changed blocks at the current level to a lower level than the current level or to back up the changed blocks at a lower level than the current level. III. implementation of Incremental Backup 1. perform Incremental backup on the file/u01/oradata/wilson/paul01.dbf. Its file number is 6. The command is as follows: RMAN> run {2> allocate channel d1 type disk; 3> backup incremental level 0 datafile 6 format = '/u01/backup/l0 _ % U'; 4 >} this is an incremental backup of level 0, and the effect is the same as that of a full backup, the block used for backup, but it can be used as the basis for Incremental backup, but the full backup is not. 2. perform incremental 1-level backup on the file. The command is as follows: RMAN> run {2> allocate channel d1 device type disk; 3> backup incremental level 1 datafile 6 format = '/u01/backup/l1 _ % U';} it backs up from the previous level 1 backup (level 0 for first run) all blocks changed since. 3. accumulate Incremental backup of files RMAN> run {2> allocate channel d1 type disk; 3> backup incremental level 1 cumulative datafile 6 format = '/u01/backup/l1c _ % U'; 4 >} it backs up all the blocks changed since the level 0 backup. 4. If there is no running level 0 backup, the first level 1 differential backup or accumulated backup will actually execute level 0 backup. 5. if the backup time is long, you can use view v $ session_longops to view the time and record operations that exceed 6 s. SQL> select sid, sofar, totalwork from v $ session_longops; sid sofar totalwork ---------- 40 1 1 40 2 2 where sofar is the time of running so far, and totalwork is the total time required to run. 4. change block tracking 1. the default RMAN operation is to scan the entire data file during Incremental backup to determine which blocks have been changed. The advantage of this operation is that RMAN is allowed to check the block corruption, but this takes a long time, therefore, enabling change blocks is even more common. When RMAN reads the change tracking file during Incremental backup, it can determine the block to be backed up, which greatly reduces the time. 2. The default location of the change tracking file is the DB_CREATE_FILE_DEST directory (if defined). You can also specify the name and location of the tracking file. 3. enable block change tracking and specify the file name and location. The command is as follows: SQL> alter database enable block change tracking using file '/u01/change_tracing.dbf'; Database altered. when block change tracking is disabled, the change tracking file is automatically deleted. The command is as follows: SQL> alter database disable block change tracking; Database altered. 5. tags give the backup level a logical name for easy management. Add a label to the backup level. RMAN> run {2> allocate channel d1 device type disk; 3> backup incremental level 1 datafile 11 tag = 'sun ';} directly search for RMAN> list backup tag = 'sun'; 6. related view 1. view v $ session SQL> select sid, username, client_info from v $ session; sid username CLIENT_INFO ---------- --------------------------------------------------------- 36 37 SYS 38 SYS rman channel = ORA_DISK_1 40 SYS you can see the started server process. Once rman is connected, 2 is started by default Server processes, such as polling and defalut. During backup, the third session is required: channel. 2. set command to command, command RMAN> run {2> allocate channel d1 type disk; 3> set command id to 'sunshine '; 4> backup datafile 6 format = '/u01/backup/p _ % U';} specify the set command id to 'sunshine '; you can find related processes in the v $ session, SQL> select sid, username, client_info from v $ session; sid username CLIENT_INFO ---------- ------------------------------ ----------------------------------- 29 SYS 38 SYS 39 SYS id = sunshine 3. view v $ pr Ocess can check which SID works on which channel in v $ session. It can check process information such as SPID through association with v $ process. The command is as follows: SQL> select sid, spid, client_info from v $ process p, v $ session s 2 where p. addr = s. paddr 3 and client_info like '% id = sun %'; sid spid CLIENT_INFO ---------- ------------------------ ----------------------------- 39 5081 id = sunshine end, when RMAN is interrupted abnormally, it will not be recorded in the control file or database, but there will be files on the disk and it will be deleted.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.