The Problem
Received below error while restoring COLD backup of source database using RMAN at target server.
RMAN> run{
2> restore database;
3> }
Starting restore at 07-SEP-16
RMAN-06908: WARNING: operation will not run in parallel on the allocated channels
RMAN-06909: WARNING: parallelism require Enterprise Edition
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=391 device type=DISK
released channel: ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/07/2016 23:17:38
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27211: Failed to load Media Management Library
Additional information: 2
The Solution
The reason of this failure is that on source database server has SBT_TAPE device type configured in RMAN( and we are using control file of source DB hence all SBT_TAPE decive configuration exists at target DB) while on target server there was no Tape Drive attached to it.
RMAN> show all; RMAN configuration parameters for database with db_unique_name ERPLN are: CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS; CONFIGURE BACKUP OPTIMIZATION OFF; # default CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
1. On target server, just clear the device type from SBT_TAPE to default device type which is disk using below command or you can explicitly allocate channels of device type inside RUN{} RMAN block to override its permanent configuration. In this case, I have cleared SBT_TAPE device type setting to default.
RMAN> CONFIGURE DEFAULT DEVICE TYPE CLEAR;
2. old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE'; RMAN configuration parameters are successfully reset to default value
3. Now try restoring the database again.
RMAN> run{ 2> restore database; 3> } Starting restore at 07-SEP-16 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=391 device type=DISK channel ORA_DISK_1: restoring datafile 00001 input datafile copy RECID=244 STAMP=921971779 file name=/orabackup/PROD/ORADB/system01.dbf destination for restore of datafile 00001: /oracle/oradata/PROD/system01.dbf channel ORA_DISK_1: copied datafile copy of datafile 00001 output file name=/oracle/oradata/PROD/system01.dbf RECID=0 STAMP=0 channel ORA_DISK_1: restoring datafile 00002 input datafile copy RECID=246 STAMP=921971780 file name=/orabackup/PROD/ORADB/undotbs01.dbf destination for restore of datafile 00002: /oracle/oradata/PROD/undotbs01.dbf channel ORA_DISK_1: copied datafile copy of datafile 00002 output file name=/oracle/oradata/PROD/undotbs01.dbf RECID=0 STAMP=0 channel ORA_DISK_1: restoring datafile 00003 input datafile copy RECID=243 STAMP=921971779 file name=/orabackup/PROD/ORADB/sysaux01.dbf destination for restore of datafile 00003: /oracle/oradata/PROD/sysaux01.dbf channel ORA_DISK_1: copied datafile copy of datafile 00003 output file name=/oracle/oradata/PROD/sysaux01.dbf RECID=0 STAMP=0 channel ORA_DISK_1: restoring datafile 00004 input datafile copy RECID=247 STAMP=921971780 file name=/orabackup/PROD/ORADB/users01.dbf destination for restore of datafile 00004: /oracle/oradata/PROD/users01.dbf channel ORA_DISK_1: copied datafile copy of datafile 00004 output file name=/oracle/oradata/PROD/users01.dbf RECID=0 STAMP=0 channel ORA_DISK_1: restoring datafile 00005 input datafile copy RECID=237 STAMP=921971779 file name=/orabackup/PROD/ORADB/erplntoolsdat01.dbf destination for restore of datafile 00005: /oracle/oradata/PROD/erplntoolsdat01.dbf
RMAN channel allocation failing when using Cohesity tape device
You might get similar error while taking backup using Cohesity tape device as shown below:
RMAN> connect catalog * 2> connect target * 3> run { 4> allocate channel t1 type 'sbt_tape' parms 5> 'SBT_LIBRARY=/lib/libcohesity.so, SBT_PARMS=(mount_path=..........)'; 6> allocate channel t2 type 'sbt_tape' parms 7> 'SBT_LIBRARY= /lib/libcohesity.so, SBT_PARMS=(mount_path=..........)'; 8> set command id to 'BAC_38470076'; 9> backup filesperset=1 format 'db_%d_%U' (archivelog all not backed up); 10> } 11> exit; connected to recovery catalog database connected to target database: STRTOR4P (DBID=2948786404) RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03009: failure of allocate command on t1 channel at 10/18/2021 23:42:28 ORA-19554: error allocating device, device type: SBT_TAPE, device name: ORA-00447: fatal error in background process
The trace directory in which the sbtio.log file is created is missing on the server. RMAN is able to allocate the channel after manually created directory structure in which the sbtio.log file is created.
1. Manually created the trace directory like below:
$ mkdir -p $ORACLE_BASE/diag/rdbms/$ORACLE_SID/[INSTANCE_NAME]/trace
2. Test the channel allocation:
run { allocate channel t1 type 'sbt_tape' parms 'SBT_LIBRARY=//lib/libcohesity.so, SBT_PARMS=(mount_path=xxxxxx, vips=xxxxx, gflag-name=sbt_use_grpc,gflag-value=true)'; release channel t1; }