Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis of Oracle RMAN backup and Compression principle

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

The principle of RMAN backup:

When the RMAN client connects to the target database and executes the backup command, RMAN will open a corresponding number of channels to work, and each channel has a corresponding service process in the target database. RMAN will first call the DBMS_RCVMAN software package to read the control file, determine the location of the data file and other information. After obtaining this information, RMAN will call the DBMS_BACKUP_RESTORE software package to read and back up the data file. The reading process is that RMAN compiles the list of files to be backed up based on the backup algorithm rules. When RMAN performs a backup operation, it requests the shared memory segment of Oracle to create its own backup buffer. The service process corresponding to the channel will scan the data blocks in the data file and read the data blocks that need to be backed up into the input buffer. When the input buffer is full, it will be transferred to the output buffer. During the transfer process, the data blocks will be detected to see if there are any damaged data blocks. When the output buffer is filled, a backup slice is formed, and the service process corresponding to the channel will eventually write it to the specified backup location.

RMAN compression method:

There are three types of RMAN compression.

The first kind:

The compression method of version 10.1 RMAN is null compression (null compression). When scanning data blocks for backup, null compression can be performed. Blocks with empty blocks are filtered when they are transferred from the input buffer to the output buffer. This null compression method does not back up allocated blocks that have not been formatted.

The second kind:

In version 10.2 of RMAN, there is another unused block compression (unused block compression), which filters out blocks that do not contain data, that is, the block has been used (formatted), but does not contain data.

Unused Block Compression works only if the following conditions are met:

1. Initialization parameter COMPATIBLE=10.2 or newer version

two。 Data files are local management mode

3. Full backup or level 0 backup

4. The specified location of the backup is on disk

The third kind:

BINARY COMPRESSION is a binary compression that works only when the key child "AS COMPRESSED" is used. Rman can use binary compression algorithm for backup, this binary compression algorithm can greatly reduce the disk space needed for backup sets, usually the compression ratio will reach 2-4 times.

The commands to use this compression are as follows:

Rman > backup as compressed backupset database

1. Enabling compression consumes more CPU resources.

two。 Enabling compressed backups takes a little more time.

3. Save space.

4. When you use a compressed backup for recovery, the recovery time becomes longer, which can be understood to mean that an inflated process is needed.

This means that the recovery time of using backup sets is longer than that of using mirrored copies.

Summarize the process of RMAN filter blocks:

The service process corresponding to the channel scans all data blocks below the high water mark and then filters the input buffer to the output buffer.

The filtered blocks are allocated but not formatted blocks and blocks that have been used but are now empty (the contents of the block are dropped by delete).

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report