且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

关于RMAN几个容易混淆的参数

更新时间:2021-07-11 20:20:28

1、maxpiecesize
2、maxsetsize
3、AS BACKUPSET
4、backupset
5、section size
6、backup piece

1、maxpiecesize
Specifies the maximum size of each backup piece created on this channel.定义一个通道中每个备份片的最大尺寸。Example 4-2 illustrates this technique. Specify the size in bytes, kilobytes (K), megabytes (M), or gigabytes (G). The default setting is in bytes and is rounded down into kilobytes. For example, if you set MAXPIECESIZE to 5000, RMAN sets the maximum piece size at 4 kilobytes, which is the lower kilobyte boundary of 5000 bytes.
Note: You cannot use BACKUP ... SECTION SIZE with MAXPIECESIZE.
Example 4-2 Setting the Maximum Size of a Backup Piece
This example manually allocates an SBT channel, which specifies an Oracle Secure Backup tape drive, and makes a whole database backup. The MAXPIECESIZE parameter specifies that no backup piece written to tape should exceed 800 MB.
RUN { ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS 'SBT_LIBRARY=/usr/local/oracle/backup/lib/libobk.so, ENV=(OB_DEVICE_1=stape1)' MAXPIECESIZE 800M; BACKUP DATABASE; }

2、MAXSETSIZE
Specifies a maximum size for a backup set (as shown in Example 2-17). 定义备份集的最大尺寸。RMAN limits all backup sets to this size.
It is possible for a backup set to span multiple tapes, so blocks from each data file are written to multiple tapes. If one tape of a multivolume backup set fails, then you lose the data on all the tapes rather than just one. Because a backup set always include a whole file rather than part of a file, you can use MAXSETSIZE to specify that each backup set should fit on one tape.
Specify size in bytes (default), kilobytes (K), megabytes (M), or gigabytes (G). For example, to limit a backup set to 3 MB, specify MAXSETSIZE 3M. The default size is in bytes, rounded down from kilobytes. For example, MAXSETSIZE 3000 is rounded down to 2 KB (2048 bytes). The minimum value must be greater than or equal to the database block size.
The default number of files in each backup set is determined by FILESPERSET, which defaults to 64. When you specify MAXSETSIZE, RMAN attempts to limit the size in bytes of the backup sets according to theMAXSETSIZE parameter. The limit on the number of files in a backup set apply even if the total size of the resulting backup set is less than MAXSETSIZE.
Note: This option results in an error message if used with BACKUP AS COPY. If you run BACKUP AS COPY on a channel that has MAXSETSIZE set, then MAXSETSIZE is silently ignored.

3、AS BACKUPSET
Creates backup sets on the specified device. This is the default backup type.
AS BACKUPSET is the only possibility when backing up to tape, and for creating level 1 incremental backups to any destination. Backup sets are RMAN-specific logical structures. The backup set is the smallest unit of a backup.
The FILESPERSET parameter of the BACKUP command determines the maximum number of files in each backup set. Archived redo log files and data files are never combined into a single backup set.
When using encrypted backups (see "Encryption of Backup Sets"), data files from tablespaces with different encryption settings are never written into the same backup set.
RMAN cannot back up files with different block sizes into the same backup set. RMAN can back up tablespaces with different block sizes, but puts each differently sized data file into its own backup set.
When unused block compression is applied, RMAN reads only the blocks that are currently allocated to a table. RMAN still checks each of the blocks to see whether the header has marked the block as unused. If a block has been unused, it is not written to the backup.
Unused block compression is turned on automatically when all of the following five conditions are true:
  1. The COMPATIBLE initialization parameter is set to 10.2 or higher.
Note: If COMPATIBLE is set to 10.2, then only tablespaces created with 10.2 compatibility are optimized to exclude blocks that do not currently contain data. If COMPATIBLE is set to 11.0.0 or higher, however, then the first backup that produces backup sets after COMPATIBLE is set to 11.0.0 or higher updates the headers of all locally managed data files so that all locally managed data files can be optimized.
  1. There are currently no guaranteed restore points defined for the database.
  2. The data file is locally managed
  3. The data file is being backed up to a backup set as part of a full backup or a level 0 incremental backup
  4. The backup set is created on disk or Oracle Secure Backup is the media manager.
Note: When backing up to a media manager that is not Oracle Secure Backup, RMAN copies all the blocks regardless of whether they contain data or not.
Note: A corrupt unused block is not harmful. This is because when a block is corrupt and RMAN does not read it because of unused block compression, RMAN does not detect the corruption.
See Also: Oracle Backup and Recovery User's Guide for a discussion of null block compression and unused block compression.
Each backup set contains at least one backup piece, which is an RMAN-specific physical file containing the backed up data. You can also use the BACKUP command to generate a proxy copy, which is a backup in which the entire data transfer is conducted by a media manager.
RMAN only records complete backup sets in the RMAN repository. There are no partial backup sets. When a BACKUP command creates backup pieces but does not produce a complete backup set, the backup pieces are discarded.
Note: You cannot stripe a single backup set across multiple channels. You also cannot stripe a single input file across multiple backup sets.

4、BACKUPSET
Specifies a backup of backup sets. 指定一个备份集的备份。Use this parameter with the DEVICE TYPE sbt clause to offload backups on disk to tape (as shown in Example 2-21). You cannot back up from tape to tape or from tape to disk: only from disk to disk or disk to tape.
If you specify the DELETE INPUT option on the BACKUP BACKUPSET command, then RMAN deletes all copies of the backup set that exist on disk. For example, if you duplexed a backup to 4 locations, then RMAN deletes all 4 backup sets. The ALL option does not add any functionality.
RMAN performs backup set failover when backing up backup sets. RMAN searches for all available backup copies when the copy that it is trying to back up is corrupted or missing. This behavior is similar to RMAN's behavior when backing up archived redo log files that exist in multiple archiving destinations.
If backup optimization is enabled when you back up a backup set, and if the identical backup set has been backed up to the same device type, then RMAN skips the backup of this backup set.
Note: You can duplex backups of backup sets with BACKUP COPIES and SET BACKUP COPIES.
Note: When you use BACKUP BACKUPSET command with encrypted backup sets, the backup sets are backed up in their encrypted form. Because BACKUP BACKUPSET just copies an already-encrypted backup set to disk or tape, no decryption key is needed during a BACKUP BACKUPSET operation. The data is never decrypted during any part of the operation. The BACKUP BACKUPSET command can neither encrypt nor decrypt backup sets.
5、SECTION SIZE
Specifies the size of each backup section produced during a data file backup.指定数据文件备份中每一个备份的部分的尺寸。(这个参数也可以用于整个数据库备份)。
By setting this parameter, RMAN can create a multisection backup. In a multisection backup, RMAN creates a backup piece that contains one file section, which is a contiguous range of blocks in a file. All sections of a multisection backup are the same size. You can create a multisection backup for a data file, but not a data file copy.
File sections enable RMAN to create multiple steps for the backup of a single large data file. RMAN channels can process each step independently and in parallel, with each channel producing one section of a multisection backup set.
If you specify a section size that is larger than the size of the file, then RMAN does not use multisection backup for the file. If you specify a small section size that would produce more than 256 sections, then RMAN increases the section size to a value that results in exactly 256 sections.
Depending on where you specify this parameter in the RMAN syntax, you can specify different section sizes for different files in the same backup job.
Note: You cannot use SECTION SIZE with MAXPIECESIZE or with INCREMENTAL LEVEL 1.

6、backup piece
Each backup set contains at least one backup piece, which is an RMAN-specific physical file containing the backed up data. You can also use the BACKUP command to generate a proxy copy, which is a backup in which the entire data transfer is conducted by a media manager.