Simulating Tape Backups Using oracle.disksbt Library
When RMAN backups to tape fail, it’s not always clear whether the issue lies within Oracle or the Media Management Library (MML) provided by the backup vendor.
One of the most effective ways to isolate the problem is to perform a fake tape backup using Oracle’s disk-based SBT library. This method can also be used when you want to test an Oracle script in your home environment,
This approach allows you to validate Oracle’s SBT interface without involving any third-party media manager (Netbackup , Commvault, Veeam,Dell etc.) effectively proving whether the problem lies inside or outside the Oracle layer.
Using sbttest tool for troubleshooting
When Oracle communicates with the MML (Media Management Library) , it loads the vendor’s shared library (usually named libobk.so on UNIX/Linux, orasbt.dll on Windows) which implements the SBT (System Backup to Tape) API defined by Oracle. By default, Oracle looks for this file in:
$ORACLE_HOME/lib/libobk.so
The interactions between RMAN and the media layer are logged in the sbtio.log file. This file is generated by the MML, not by Oracle itself.
sbttest tool can be used to perform a quick test of the media manager.
If sbttest returns 0, then the test ran without error, which means that the media manager is correctly installed and can accept a data stream and return the same data when requested. If sbttest returns a nonzero value, then either the media manager is not installed or it is not configured correctly.
This tool has been available for years, but I’ve only recently become aware of it. In this blog post, I’ll use it with Oracle Database 26ai, that is, Oracle Database 23.26.0.0 running as a Docker container on my Mac.
If you have not installed any media manager then it will not find a libobk.so under $ORACLE_HOME as provided below.
bash-4.4$ /opt/oracle/product/26ai/dbhomeFree/bin/sbttest some_file.f -trace sbtio.log
The sbt function pointers are loaded from oracle.static library.
libobk.so could not be loaded. Check that it is installed
In this post, i will demonstrate it with the Oracle Test Disk API. (oracle.disksbt library)
First you need to set BACKUP_DIR envirıonment variable, otherwise you will get the error provided below.
bash-4.4$ /opt/oracle/product/26ai/dbhomeFree/bin/sbttest some_file.f -trace sbtio.log
The sbt function pointers are loaded from oracle.static library.
libobk.so could not be loaded. Check that it is installed
bash-4.4$ /opt/oracle/product/26ai/dbhomeFree/bin/sbttest some_file.f -trace sbtio.log -libname oracle.disksbt
The sbt function pointers are loaded from oracle.disksbt library.
-- sbtinit succeeded
-- sbtinit (2nd time) succeeded
sbtinit: vendor description string=WARNING: Oracle Test Disk API
sbtinit: Media manager is version 8.1.3.0
sbtinit: Media manager supports SBT API version 2.0
sbtinit: allocated sbt context area of 5840 bytes
sbtinit: proxy copy is supported
MMAPI error from sbtinit2: 4110, sbtinit2: BACKUP_DIR variable is required
-- sbtinit2 failed
Here is a succesful run. It tests writing and reading by using Oracle test Disk API.
bash-4.4$ export ORACLE_PDB_SID=freepdb1
bash-4.4$ export BACKUP_DIR=/tmp
bash-4.4$ /opt/oracle/product/26ai/dbhomeFree/bin/sbttest some_file.f -trace sbtio.log -libname oracle.disksbt
The sbt function pointers are loaded from oracle.disksbt library.
-- sbtinit succeeded
-- sbtinit (2nd time) succeeded
sbtinit: vendor description string=WARNING: Oracle Test Disk API
sbtinit: Media manager is version 8.1.3.0
sbtinit: Media manager supports SBT API version 2.0
sbtinit: allocated sbt context area of 5840 bytes
sbtinit: proxy copy is supported
-- sbtinit2 succeeded
-- regular_backup_restore starts ................................
-- sbtbackup succeeded
write 100 blocks
-- sbtwrite2 succeeded
-- sbtclose2 succeeded
sbtinfo2: SBTBFINFO_NAME=some_file.f
sbtinfo2: SBTBFINFO_METHOD=stream
sbtinfo2: SBTBFINFO_CRETIME=Tue Oct 28 10:23:39 2025
sbtinfo2: SBTBFINFO_LABEL=/tmp
sbtinfo2: SBTBFINFO_LABEL=some_file.f
sbtinfo2: SBTBFINFO_SHARE=multiple users
sbtinfo2: SBTBFINFO_ORDER=random access
sbtinfo2: SBTBFINFO_COMMENT=Oracle disk API
-- sbtinfo2 succeeded
-- sbtrestore succeeded
file was created by this program:
seed=430437830, blk_size=16384, blk_count=100
read 100 buffers
-- sbtread2 succeeded
-- sbtclose2 succeeded
-- sbtremove2 succeeded
-- regular_backup_restore ends ................................
-- sbtcommand succeeded
create_osf_files: pctest01.osf succeeded
create_osf_files: pctest02.osf succeeded
create_osf_files: pctest03.osf succeeded
-- proxy_backup starts ................................
-- sbtpcquerybackup succeeded
sbtpcbackup:pctest01.osf (handle=-1) will be backed up to pctest01.bkf
sbtpcbackup:pctest02.osf (handle=-2) will be backed up to pctest02.bkf
sbtpcbackup:pctest03.osf (handle=-3) will be backed up to pctest03.bkf
-- sbtpcbackup succeeded
-- sbtpcvalidate succeeded
sbtpcstatus:handle=-1, status=SBTPCSTATUS_READY
sbtpcstatus:handle=-1, status=SBTPCSTATUS_END
sbtpcstatus:handle=-1, status=SBTPCSTATUS_DONE
sbtpcstatus:handle=-2, status=SBTPCSTATUS_READY
sbtpcstatus:handle=-2, status=SBTPCSTATUS_END
sbtpcstatus:handle=-2, status=SBTPCSTATUS_DONE
sbtpcstatus:handle=-3, status=SBTPCSTATUS_READY
sbtpcstatus:handle=-3, status=SBTPCSTATUS_END
sbtpcstatus:handle=-3, status=SBTPCSTATUS_DONE
-- sbtpcstatus succeeded
-- sbtpcend succeeded
-- proxy_backup ends ................................
-- proxy_restore starts ................................
-- sbtpcqueryrestore succeeded
sbtpcrestore: pctest01.bkf (handle=-1) will be restored to pctest01.rtf
sbtpcrestore: pctest02.bkf (handle=-2) will be restored to pctest02.rtf
sbtpcrestore: pctest03.bkf (handle=-3) will be restored to pctest03.rtf
-- sbtpcrestore succeeded
-- sbtpcvalidate succeeded
sbtpcstatus:handle=-1, status=SBTPCSTATUS_READY
sbtpcstatus:handle=-1, status=SBTPCSTATUS_END
sbtpcstatus:handle=-2, status=SBTPCSTATUS_READY
sbtpcstatus:handle=-2, status=SBTPCSTATUS_END
sbtpcstatus:handle=-3, status=SBTPCSTATUS_READY
sbtpcstatus:handle=-3, status=SBTPCSTATUS_END
-- sbtpcstatus succeeded
sbtremove2: pctest01.bkf was removed successfully
sbtremove2: pctest02.bkf was removed successfully
sbtremove2: pctest03.bkf was removed successfully
-- sbtpcend succeeded
krs_verify_rtf: pctest01.rtf verification succeeded
krs_verify_rtf: pctest02.rtf verification succeeded
krs_verify_rtf: pctest03.rtf verification succeeded
-- proxy_restore ends ................................
-- sbtend succeeded
*** The SBT API test was successful ***
Lets take it further and use with RMAN to a backup USERS tablespace.
bash-4.4$ /opt/oracle/product/26ai/dbhomeFree/bin/rman target /
RUN
{
ALLOCATE CHANNEL c1 TYPE 'SBT' PARMS 'SBT_LIBRARY=oracle.disksbt, ENV=(BACKUP_DIR=/tmp)';
BACKUP TABLESPACE USERS;
}
allocated channel: c1
channel c1: SID=58 device type=SBT_TAPE
channel c1: WARNING: Oracle Test Disk API
Starting backup at 28-OCT-25
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00015 name=/opt/oracle/oradata/FREE/FREEPDB1/users01.dbf
channel c1: starting piece 1 at 28-OCT-25
channel c1: finished piece 1 at 28-OCT-25
piece handle=04n67pin_4_1_1 tag=TAG20251028T103711 comment=API Version 2.0,MMS Version 8.1.3.0
channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 28-OCT-25
released channel: c1
bash-4.4$ ls -ls /tmp/04n67pin_4_1_1
8196 -rw-r--r-- 1 oracle oinstall 8388624 Oct 28 10:37 /tmp/04n67pin_4_1_1
You may also use this method to remove old TAPE backups from CATALOG via RMAN, when the Media Management Layer (MML Software not installed) is NOT available anymore.
Hope it helps.


Leave your comment