rman disk tape channel不释放导致自动压缩

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.

SYMPTOMS

A backup to tape after allocating a maintenance channel is compressed although this is not the configuration.  

Consider the following in which a disk backup is configuration as compressed:

RMAN> show all;

RMAN configuration parameters for database with db_unique_name ORCL are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK BACKUP TYPE TO COMPRESSED BACKUPSET PARALLELISM 4;  <-------------
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/snapcf_.f'; # default


And a backup is taken to tape, using an SBT channel:
 

CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' clear;
configure backup optimization off;
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE disk; <-------这边是不是省略了命令?


run {
allocate channel ch1 device type sbt maxpiecesize=30G ;
send 'ENV=(CONNECT_TAG=GXEAS)';
backup incremental level 0  database  format 'BAK_%d_%s_%p_%t' tag '';
release channel ch1;
}
RELEASE CHANNEL;

CHANGES

CAUSE

The usage of mixing maintenance channel for disk and backup channel for tape is not correct.  I.e., with the allocate maintenance channel to disk, the tape backup is compressed although not specified in the configuration or the backup command. 
Without this disk maintenance channel allocation, the tape backup is not compressed.  

SOLUTION

After allocating maintenance channel for disk, the disk channel need to be released before allocating tape channel.

For example:
 

ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE disk;

-- CHANGE/ DELETE / CROSSCHECK operation

RELEASE CHANNEL; <------------------ The channel of disk maintenance need to be released first

run {
allocate channel ch1 device type sbt maxpiecesize=30G ;
send 'ENV=(CONNECT_TAG=....)';
backup incremental level 0  database  format 'ORDB_%d_%s_%p_%t' tag '2022_03_31_16_32_53';
release channel ch1;
}

If you cannot apply the patch, you can work around this issue by explicitly allocating the channel needed by the maintenance command.  

In the following example, the backup is to tape (SBT).  However, a disk channel is required to delete the archivelog files.  The error (RMAN-06091) 
can be avoided by explicitly allocating a disk maintenance channel.    I.e., maintenance needs a disk channel, the backup needs an SBT channel.  

For example:

run {
allocate channel ch1 type 'sbt_tape';
backup database
include current controlfile;
}
allocate channel for maintenance device type disk;    <<<=== explicitly allocate the maintenance channel
crosscheck archivelog all;
delete force noprompt archivelog all;

Even after applying the patch for bug 28432129, RMAN may continue to fail with the RMAN-6091 error.  The bug fix 28432129 only to allow deletion of archive log and image copies (not backupsets).
Therefore, some maintenance commands may continue to fail if an appropriate channels is not allocated.  RMAN can never deleted disk backups using SBT channels.

To avoid an error, we suggest the following changes to your RMAN scripts:

1) Allocate maintenance commands outside the RUN{} block and explicitly allocate required channels (DISK and/or TAPE) if RMAN needs to operate on backup files residing on both device types.  For example:

allocate channel for maintenance type 'SBT_TAPE';
allocate channel for maintenance type disk;
delete obsolete device type sbt;
delete obsolete device type disk;
delete archivelog all backed up 1 times to  

2) Have backup commands allocate whatever device type channels are needed to create the backup in the desired location.

In short, allocate the required device type needed by the maintenance command operations to work properly.

你可能感兴趣的:(oracle)