Managing File Copies   «Prev  Next»

Lesson 4Allocating a Channel
ObjectiveIdentify the use of channels with Backup Operations.

Allocating Channel in Oracle

Recovery Manager uses a concept called a channel to perform backup operations. Whenever you begin a backup or recovery operation, you must first allocate a channel for the operation.

What is a Channel and when to allocate

A channel is a connection between the target database and Recovery Manager. A channel specifies both a name for the channel and the type of destination for data moved over the channel. To allocate a channel, you would use the command:
ALLOCATE CHANNEL channel_id TYPE type;

where channel_id is a unique identifier and type is either DISK, to denote a disk file, or a specific type of third-party backup device, such as a tape drive.
You have to issue the allocate channel command after you begin a backup, recovery, restore, or copy job with the run command. The complete syntax for backing up a database to a single disk file is:
run {
 allocate channel c1 type disk;
 backup database;
 }

Recovery Manager (RMAN) utilizes the concept of Channels

Recovery Manager (RMAN) still utilizes the concept of channels for backup operations in Oracle 12c. Channels serve as essential pathways for data transfer during backups and restores. Here's a breakdown of how they function:
Key Concepts:
  1. Channel Allocation: Before initiating backup or restore tasks, you must allocate channels using the `ALLOCATE CHANNEL` command. Each channel establishes a dedicated connection between RMAN and the target or auxiliary database instance.
  2. Server Processes: Each allocated channel prompts RMAN to spawn a server process within the database instance. These server processes execute the actual backup or restore operations.
  3. Parallelism and Performance: Allocating multiple channels enables RMAN to distribute backup and restore workloads across multiple server processes, potentially enhancing performance.
  4. Resource Management: Channel control options allow you to:
    1. Adjust the degree of parallelism by specifying the `FILESPERSET` parameter during backup.
    2. Set limits on I/O bandwidth consumption (`SET LIMIT CHANNEL ... READRATE`).
    3. Restrict the size of backup pieces (`SET LIMIT CHANNEL ... KBYTES`).
    4. Control the number of concurrently open files (`SET LIMIT CHANNEL ... MAXOPENFILES`).
    5. Send vendor-specific commands to media managers (`SEND`).

Common Channel Types:
  • DISK: Writes backups to disk.
  • TAPE: Streams backups to tape devices.
  • SBT: Interacts with media management software for advanced backup and recovery features.
Example: To allocate two disk channels and perform a full database backup with parallelism:
ALLOCATE CHANNEL ch1 DEVICE TYPE DISK;
ALLOCATE CHANNEL ch2 DEVICE TYPE DISK;
BACKUP DATABASE;

While RMAN has evolved over time, channels remain a fundamental mechanism for managing I/O resources and optimizing backup and recovery operations in Oracle 12c. Understanding and effectively utilizing channels is crucial for efficient database backup and recovery management.

Allocating Multiple Channels

You can allocate more than one channel before beginning any backup or recovery operation. When you allocate multiple channels, Recovery Manager will perform the following operations in parallel. For instance, if you are copying five files and want to do the copying in parallel, you would first allocate five channels and then issue a single copy command with the five files listed, as shown in the following series of images.

Create the first channel with this command
1)
ALLOCATE CHANNEL
c1 TYPE DISK;

Create the first channel with this command

2) Create the second channel with a similar command
2)
ALLOCATE CHANNEL 
c2 TYPE DISK;
Create the second channel with a similar command

3)Create the third channel with this command
3) Create the third channel with this command
ALLOCATE CHANNEL 
c3 TYPE DISK;

4) Issue a COPY command for three data files
4) Issue a COPY command for three data files
COPY DATAFILE FILE2 
TO 'LOC1' 
DATAFILE FILE2 TO 'LOC2',
DATAFILE FILE3 TO 'LOC3'

5) Each Datafile is copied through a separate channel
5) Each datafile is copied through a separate channel

Image Gallery Summary
  1. Create the first channel with this command
  2. Create the second channel with a similar command
  3. Create the third channel with this command
  4. Issue a COPY command for three data files
  5. Each datafile is copied through a separate channel


Using Multiple Channels in Oracle

You can allocate up to 255 channels; each channel can read up to 64 files in parallel. You can control the degree of parallelism within a job by the number of channels that you allocate. Allocating multiple channels simultaneously allows a single job to read or write multiple backup sets or disk copies in parallel, which each channel operating on a separate backup set or copy. When making backups to disk, the guideline is to allocate one channel for each output device . If RMAN is writing to a striped file system or an ASM disk group, however, then multiple channels can improve performance. When backing up to tape, the guideline is that the number of tape channels should equal the number of tape devices divided by the number of duplexed copies

automatic channel allocation: The ability of RMAN to perform backup and restore tasks without requiring the use of the ALLOCATE CHANNNEL command. You can use the CONFIGURE command to specify disk and tape channels. Then, you can issue commands such as BACKUP and RESTORE at the RMAN command prompt without manually allocating channels. RMAN uses whatever configured channels that it needs to execute the commands.

If you were to issue five separate copy commands in this same scenario, you would use only one channel.

ALLOCATE CHANNEL

Purpose Use the ALLOCATE CHANNEL command to manually allocate a channel, which is a connection between RMAN and a database instance. ALLOCATE CHANNEL must be issued within a REPAIR FAILURE block and applies only to the block in which it is issued.
Prerequisites: The target instance must be started.
Usage Notes: Manually allocated channels are distinct from automatically allocated channels specified with CONFIGURE. Automatic channels apply to any RMAN job in which you do not manually allocate channels. You can override automatic channel configurations by manually allocating channels within a RUN command, but you cannot use
  1. BACKUP DEVICE TYPE or
  2. RESTORE DEVICE TYPE
to use automatic channels after specifying manual channels with ALLOCATE CHANNEL.
In the next lesson, you will learn how to use tags with your backups.

SEMrush Software