Friday, September 18, 2020

RMAN Cross Check Command Against the MML Layer

So, we have had a couple of cases open recently where we had RMAN backup set piece files present on the remote MML layer storage, but there was no record of those files in the control file or the Recovery Catalog. This leads to a slight issue with recovering databases. You need a way to catalog files on the remote media back into the Recovery Catalog or the database control file.

If the backup set piece files are on disk, this is easy with the RMAN catalog command. However, if you read through the documentation (until 19c), it's unclear on how to catalog backup piece files if you are using the MML layer. Fortunately, there is an undocumented way to catalog MML backup set piece files using the catalog command!. 

In Oracle Databsae 19c Oracle started to document the availability of the device type parameter in the RMAN catalog command. This parameter, followed by the backuppiece parameter, would allow you to catalog specific backup set pieces that existed in the MML layer. The only catch is that you have to first know the backup set piece name, which you will need to either get from backup logs, or you will have to go directly to the MML catalog and find the name of the backup set piece you want. 

While this parameter is documented in 19c, it appears to be available in an undocumented manner since Oracle Database version 10.1.  

For example, let's say that you needed to catalog some missing MML files. You might do something like the following:

configure channel device type 'SBT_TAPE'
params 'SBT_LIBRARY=/app/oracle/backup/lib/libobk.so,
env=(OB_MEDIA_FAMILY=RMAN-DEFAULT)';

catalog device type 'SBT_TAPE' backuppiece='0ggp1_1_1';

Obviously, you will need to put in the correct env parameter settings for the MML layer you are working on. For example, Netbackup would expect you set the nb_ora_class parameter in the configure channel command.