ZDLRA, RA_CLIENT_CONFIG_FILE channel parameter

When we are enrolling a database at ZDLRA we need to configure the RMAN channel parameters to point to our definitions like RA_WALLET and CREDENTIAL_ALIAS. The same is done for backup and restore channels. But this can be done in a different way using RA_CLIENT_CONFIG_FILE for ra_library.

If we check the ZDLRA documentation there is no default way to set the rman channel. Usually, we inform RA_WALLET and CREDENTIAL_ALIAS, like this:

RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT '%d_%U' PARMS  "SBT_LIBRARY=/u01/app/oracle/product/19.3.0.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/ra_wallet credential_alias=zdlras1-scan:1521/zdlras1:VPCBRONZE')";

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT   '%d_%U' PARMS  "SBT_LIBRARY=/u01/app/oracle/product/19.3.0.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/ra_wallet credential_alias=zdlras1-scan:1521/zdlras1:VPCBRONZE')";
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>

And during the backup we can allocate channel like this:

RMAN> RUN{
2> ALLOCATE CHANNEL RA1 DEVICE TYPE 'SBT_TAPE' PARMS "SBT_LIBRARY=/u01/app/oracle/product/19.3.0.0/dbhome_1/lib/libra.so, ENV=(RA_WALLET='location=file:/u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/ra_wallet CREDENTIAL_ALIAS=zdlras1-scan:1521/zdlras1:VPCBRONZE')";
3> BACKUP INCREMENTAL LEVEL 1 FORMAT '%U' DATAFILE 1;
4> }

released channel: ORA_SBT_TAPE_1
allocated channel: RA1
channel RA1: SID=34 device type=SBT_TAPE
channel RA1: RA Library (ZDLRAS1) SID=B42BC4DB2C7D4FA7E053010310ACEC61

Starting backup at 15/11/2020 21:27:01
channel RA1: starting incremental level 1 datafile backup set
channel RA1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL19C/system01.dbf
channel RA1: starting piece 1 at 15/11/2020 21:27:01
channel RA1: finished piece 1 at 15/11/2020 21:27:04
piece handle=f8vfk4t5_1_1 tag=TAG20201115T212701 comment=API Version 2.0,MMS Version 12.2.0.2
channel RA1: backup set complete, elapsed time: 00:00:03
Finished backup at 15/11/2020 21:27:04

Starting Control File and SPFILE Autobackup at 15/11/2020 21:27:04
piece handle=c-1487680695-20201115-16 comment=API Version 2.0,MMS Version 12.2.0.2
Finished Control File and SPFILE Autobackup at 15/11/2020 21:27:09
released channel: RA1

RMAN>

But we can use the undocumented RA_CLIENT_CONFIG_FILE and specify one file that contains all the parameters that we want. This can be interesting to use when we have a lot of databases and need to update something (like the wallet location) and don’t want to enter each database to do that. Another option is to create one file for each type of database that we are using (maybe you share the same host with UAT and TST databases). As wrote before is not documented, so, use with caution. The principle is the same that we use to create the replication server, but with fewer parameters. 

So, we create one file (with Oracle user), and inside of that we define the RA_WALLET and CREDENTIAL_ALIAS (the parameter names can be in uppercase as well) in the same way that we do for rman channel definition:

[oracle@orcloel7 ~]$ cd /u01/app/oracle/admin/ORCL19C/
[oracle@orcloel7 ORCL19C]$
[oracle@orcloel7 ORCL19C]$ vi ra_client_config
[oracle@orcloel7 ORCL19C]$
[oracle@orcloel7 ORCL19C]$
[oracle@orcloel7 ORCL19C]$ cat ra_client_config
ra_wallet='location=file:/u01/app/oracle/product/19.3.0.0/dbhome_1/dbs/ra_wallet credential_alias=zdlras1-scan:1521/zdlras1:VPCBRONZE'
[oracle@orcloel7 ORCL19C]$
[oracle@orcloel7 ORCL19C]$
[oracle@orcloel7 ORCL19C]$

Simple like that. And now we can define the channel like this:

RMAN> RUN{
2> ALLOCATE CHANNEL RA1 DEVICE TYPE SBT PARMS "SBT_LIBRARY=/u01/app/oracle/product/19.3.0.0/dbhome_1/lib/libra.so, ENV=(RA_CLIENT_CONFIG_FILE=/u01/app/oracle/admin/ORCL19C/ra_client_config)";
3> BACKUP INCREMENTAL LEVEL 1 FORMAT '%U' DATAFILE 1;
4> }

allocated channel: RA1
channel RA1: SID=34 device type=SBT_TAPE
channel RA1: RA Library (ZDLRAS1) SID=B42BC4DB2C7F4FA7E053010310ACEC61

Starting backup at 15/11/2020 21:29:39
channel RA1: starting incremental level 1 datafile backup set
channel RA1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL19C/system01.dbf
channel RA1: starting piece 1 at 15/11/2020 21:29:39
channel RA1: finished piece 1 at 15/11/2020 21:29:40
piece handle=favfk523_1_1 tag=TAG20201115T212939 comment=API Version 2.0,MMS Version 12.2.0.2
channel RA1: backup set complete, elapsed time: 00:00:01
Finished backup at 15/11/2020 21:29:40

Starting Control File and SPFILE Autobackup at 15/11/2020 21:29:40
piece handle=c-1487680695-20201115-17 comment=API Version 2.0,MMS Version 12.2.0.2
Finished Control File and SPFILE Autobackup at 15/11/2020 21:29:48
released channel: RA1

RMAN>

As you can see above, I defined as ENV as ENV=(RA_CLIENT_CONFIG_FILE=/u01/app/oracle/admin/ORCL19C/ra_client_config) and passed the file as parameter, full path.  So, in the future, if it is needed to change some parameters (like the credential name) we just need to change one file and all channels will automatically use the new configuration.

If you read the sbt_parms for creating the replication server is required to use the RA_HOST inside of the file, but this is valid just for replication. If we try to use this for rman, we got an error. So, is not needed:

RMAN> run{
2> allocate channel RA1 DEVICE TYPE 'SBT_TAPE' PARMS "SBT_LIBRARY=/u01/app/oracle/product/19.3.0.0/dbhome_1/lib/libra.so, ENV=(RA_CLIENT_CONFIG_FILE=/u01/app/oracle/admin/ORCL19C/ra_client_config)";
3> BACKUP INCREMENTAL LEVEL 1 FORMAT '%U' DATAFILE 1;
4> }

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on RA1 channel at 11/15/2020 22:15:58
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27023: skgfqsbi: media manager protocol error
ORA-19511: non RMAN, but media manager or vendor specific failure, error text:
   KBHS-01005: syntax error was encountered while parsing RA Library parameter file /u01/app/oracle/admin/ORCL19C/ra_client_config
KBHS-01003: LRM-00101: unknown parameter name 'ra_host'

RMAN>

Another detail that is important to mention is the fact that we can’t use the simple quotes ” for RA_CLIENT_CONFIG_FILE value definition. We got an error if we use:

RMAN> run{
2> allocate channel RA1 DEVICE TYPE 'SBT_TAPE' PARMS  "SBT_LIBRARY=/u01/app/oracle/product/19.3.0.0/dbhome_1/lib/libra.so, ENV=(RA_CLIENT_CONFIG_FILE='/u01/app/oracle/admin/ORCL19C/ra_client_config')";
3> BACKUP INCREMENTAL LEVEL 1 FORMAT '%U' DATAFILE 1;
4> }

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of allocate command on RA1 channel at 11/15/2020 22:07:16
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27023: skgfqsbi: media manager protocol error
ORA-19511: non RMAN, but media manager or vendor specific failure, error text:
   KBHS-01002: unable to open RA Library parameter file '/u01/app/oracle/admin/ORCL19C/ra_client_config'

RMAN>

So, RA_CLIENT_CONFIG_FILE can be interesting in some cases. Since it is undocumented, test and check if is valid for you. The version of my ra_libary is 12.2.0.2, so, check your library version if is (at least) this or newer. I tested only with this version but I believe that work with others as well.

 

Disclaimer: “The postings on this site are my own and don’t necessarily represent my actual employer positions, strategies or opinions. The information here was edited to be useful for general purpose, specific data and identifications were removed to allow reach the generic audience and to be useful for the community. Post protected by copyright.”

Leave a Reply

Your email address will not be published.