Proxy backup examples
The Oracle Intelligent Policy automatically creates the RMAN proxy script. In some instances, you need to create a custom script specific to your environment.
The following examples show how to use multiple channels in RMAN scripts with proxy backups.
Table: Proxy backup examples
Backup example | Sample script |
|---|---|
This RMAN sample script initiates a whole database backup, which includes the control file. RMAN starts one proxy copy backup session by sending a list of all data files to the NetBackup for Oracle agent on channel t1. | run {
allocate channel t1 type 'SBT_TAPE';
send 'NB_ORA_PC_STREAMS=3';
backup proxy
format 'bk_%U_%t'
(database);
release channel t1;
}The agent splits the files into three streams and initiates a file-based backup for each stream. After the proxy backup is done, RMAN starts a non-proxy conventional backup of the control file on channel t1. |
This RMAN sample script initiates a whole database backup, which includes the control file. RMAN starts one proxy copy backup session by sending a list of all data files to the NetBackup for Oracle agent on channel t1. The agent splits the files into three streams and initiates a file-based backup for each stream. At the same time, RMAN starts a non-proxy conventional backup of the control file on channel t2. | run {
allocate channel t1 type 'SBT_TAPE';
allocate channel t2 type 'SBT_TAPE';
send 'NB_ORA_PC_STREAMS=3';
backup proxy
format 'bk_%U_%t'
(database);
release channel t1;
release channel t2;
}If the RMAN recovery catalog is not used, the version of the control file being backed up does not contain information about the current backup. To include the information about the current backup, back up the control file as the last step in the backup operation. This step is not necessary if the recovery catalog is used. Run {
allocate channel t1 type 'SBT_TAPE';
backup
format 'cntrl_%s_%p_%t'
current controlfile;
release channel t1;
} |
In this sample script, RMAN initiates two proxy copy backups sequentially on channel t1. It starts a proxy backup of tablespace tbs1 data files. After the backup is done, it starts another proxy backup of tablespace tbs2 data files. | run {
allocate channel t1 type 'SBT_TAPE';
backup proxy
format 'bk_%U_%t'
(tablespace tbs1);
backup proxy
format 'bk_%U_%t'
(tablespace tbs2);
release channel t1;
}This configuration can cause problems if the sequential backups create snapshots on the same or a separate volume that share a snapshot resource specification. In such a situation, issue a single backup command such as the following which specifies both tablespaces rather than two separate backup commands: run {
allocate channel t1 type 'SBT_TAPE';
backup proxy
format 'bk_%U_%t'
(tablespace tbs1, tbs2);
release channel t1;
} |
In this example, RMAN distributes proxy copy backups over two channels. It creates two proxy copy backup sessions sending tbs1 data files on channel t1 and tbs2 data files on channel t2. Such a method is useful if you want to specify different NetBackup configurations for each channel. In this example, each send command specifies a different policy that is sent to the proxy backups. Each of the proxy backups uses this policy. | run {
allocate channel t1 type 'SBT_TAPE';
send 'NB_ORA_POLICY=policy1';
allocate channel t2 type 'SBT_TAPE';
send 'NB_ORA_POLICY=policy2';
backup proxy
format 'bk_%U_%t'
(tablespace tbs1 channel t1);
(tablespace tbs2 channel t2);
release channel t1;
release channel t2;
} |