Skip Headers
Oracle® Database Backup and Recovery Reference
11g Release 2 (11.2)

Part Number E10643-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

ALLOCATE CHANNEL FOR MAINTENANCE

Purpose

Use the ALLOCATE CHANNEL FOR MAINTENANCE command to manually allocate a channel in preparation for issuing a CHANGE, DELETE, or CROSSCHECK command. You can use the RELEASE CHANNEL command to unallocate the channel.

Note:

If you CONFIGURE at least one channel for each device type in your configuration, then you do not need to use ALLOCATE CHANNEL FOR MAINTENANCE. It is recommended that you use configured channels instead of maintenance channels. You can use configured channels for all RMAN I/O to the specified device, not just the maintenance tasks supported by maintenance channels. The configured channels persist across RMAN sessions.

Prerequisites

Execute this command only at the RMAN prompt, not within a RUN block. The target instance must be started. You cannot allocate a maintenance channel to a shared session.

Usage Notes

As a rule, you should allocate one maintenance channel for each device. Manually allocated channels and automatic channels are never mixed. In general, you should allocate multiple maintenance channels for a single job only in these situations:

RMAN uses the following convention for naming of maintenance channels: ORA_MAINT_devicetype_n, where devicetype refers to DISK or sbt and n refers to the channel number. For example, RMAN uses these names for two manually allocated disk channels:

ORA_MAINT_DISK_1
ORA_MAINT_DISK_2

See Also:

Oracle Database Backup and Recovery User's Guide to learn how to crosscheck and delete on multiple channels

Syntax

allocateForMaint::=

Description of allocateformaint.gif follows
Description of the illustration allocateformaint.gif

(deviceSpecifier::=, allocOperandList::=)

Semantics

allocateForMaint

Syntax Element Description

DEVICE TYPE
deviceSpecifier
Specifies the type of storage for a backup. Query the V$BACKUP_DEVICE view for information about available device types and names.

See Also: deviceSpecifier

   allocOperandList Specifies control options for the allocated channel. Note that the channel parameters for sequential I/O devices are platform-specific.

See Also: allocOperandList


Examples

Example 2-10 Deleting Backup Sets

Assume that you want to recycle a set of tapes by deleting all RMAN backups. In this example, only a disk channel is configured by default. The example manually allocates an SBT channel, deletes all backups from tape, and then releases the channel.

RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt;
 
allocated channel: ORA_MAINT_SBT_TAPE_1
channel ORA_MAINT_SBT_TAPE_1: SID=135 device type=SBT_TAPE
channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup
 
RMAN> DELETE NOPROMPT BACKUP;
 
List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
9957    9954    1   1   AVAILABLE   SBT_TAPE    8oic41ad_1_1
9974    9972    1   1   AVAILABLE   SBT_TAPE    c-28014364-20070308-17
10024   10021   1   1   AVAILABLE   SBT_TAPE    8qic41c3_1_1
10045   10042   1   1   AVAILABLE   SBT_TAPE    c-28014364-20070308-18
10446   10443   1   1   AVAILABLE   SBT_TAPE    8uic47fg_1_1
10487   10482   1   1   AVAILABLE   SBT_TAPE    90ic47ih_1_1
10488   10483   1   1   AVAILABLE   SBT_TAPE    91ic47j1_1_1
10524   10514   1   1   AVAILABLE   SBT_TAPE    92ic47q4_1_1
10540   10538   1   1   AVAILABLE   SBT_TAPE    c-28014364-20070308-1a
deleted backup piece
backup piece handle=8oic41ad_1_1 RECID=198 STAMP=616695118
deleted backup piece
backup piece handle=c-28014364-20070308-17 RECID=199 STAMP=616695145
deleted backup piece
backup piece handle=8qic41c3_1_1 RECID=200 STAMP=616695171
deleted backup piece
backup piece handle=c-28014364-20070308-18 RECID=201 STAMP=616695188
deleted backup piece
backup piece handle=8uic47fg_1_1 RECID=204 STAMP=616701424
deleted backup piece
backup piece handle=90ic47ih_1_1 RECID=205 STAMP=616701521
deleted backup piece
backup piece handle=91ic47j1_1_1 RECID=206 STAMP=616701538
deleted backup piece
backup piece handle=92ic47q4_1_1 RECID=207 STAMP=616701764
deleted backup piece
backup piece handle=c-28014364-20070308-1a RECID=208 STAMP=616701783
Deleted 11 objects
 
RMAN> RELEASE CHANNEL;
 
released channel: ORA_MAINT_SBT_TAPE_1

Example 2-11 Crosschecking Backups on Multiple Devices

Assume that you want to crosscheck backups of archived redo log files on disk and tape. Assume also that you have the default device type configured to disk, and also have an SBT channel configured, but you want to use different channel settings for both disk and tape. In this case, you can manually allocate maintenance channels with the desired settings.

RMAN> SHOW DEFAULT DEVICE TYPE;
 
RMAN configuration parameters for database with db_unique_name PROD are:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
 
RMAN> SHOW CHANNEL;
 
RMAN configuration parameters for database with db_unique_name PROD are:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'SBT_LIBRARY=/usr/local/oracle/backup/lib/libobk.so, ENV=(OB_DEVICE_1=stape1)';
 
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE sbt PARMS 'SBT_LIBRARY=/usr/local/oracle/backup/lib/libobk.so, ENV=(OB_DEVICE_1=stape2)';
 
allocated channel: ORA_MAINT_SBT_TAPE_1
channel ORA_MAINT_SBT_TAPE_1: SID=135 device type=SBT_TAPE
channel ORA_MAINT_SBT_TAPE_1: Oracle Secure Backup
 
RMAN> ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK FORMAT "/disk2/%U";
 
allocated channel: ORA_MAINT_DISK_2
channel ORA_MAINT_DISK_2: SID=101 device type=DISK
 
Finished Control File and SPFILE Autobackup at 09-MAR-07
 
RMAN> CROSSCHECK BACKUP OF ARCHIVELOG ALL;
 
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/disk2/95ic69jc_1_1 RECID=210 STAMP=616769132
crosschecked backup piece: found to be 'EXPIRED'
backup piece handle=/disk2/96ic69jf_1_1 RECID=211 STAMP=616769135
Crosschecked 2 objects
 
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/disk2/96ic69jf_1_1 RECID=211 STAMP=616769135
Crosschecked 1 objects
 
 
RMAN> RELEASE CHANNEL;
 
released channel: ORA_MAINT_SBT_TAPE_1
released channel: ORA_MAINT_DISK_2

Example 2-12 Crosschecking in an Oracle Real Application Clusters (Oracle RAC) Configuration

All nodes in an Oracle RAC configuration should have the same access to all backups on all storage devices, but this is not a requirement. Assume that you want to crosscheck backups on two nodes of an Oracle RAC configuration, where each node has access to a subset of disk backups. It is assumed that all backups are accessible by at least one of the two nodes used in the crosscheck. Any backups not accessible from at least one of the nodes are marked EXPIRED after the crosscheck.

The following example illustrates channel connections to Oracle RAC instances inst1 and inst2. For both channel connections, RMAN uses the same user name and password that were entered for the target database connection.

ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK 
  CONNECT '@inst1';
ALLOCATE CHANNEL FOR MAINTENANCE DEVICE TYPE DISK 
  CONNECT '@inst2';
CROSSCHECK BACKUP;