- Using Oracle Database Backup Cloud Service
- Backing Up to Oracle Database Backup Cloud Service
- Extracting Backup Metadata from OCI Object Storage
Extracting Backup Metadata from OCI Object Storage
Use this procedure to extract the backup metadata from OCI Object Storage and store the information in an XML file.
If your database backups are stored in OCI Object Storage, then you can use the
odbsrmt.py
tool to manually extract the backup metadata into an XML file. The odbsrmt.py
tool is available in the same directory where you have downloaded the SBT library while installing the backup module.
- On the database server, install the Oracle Database Cloud Backup Module for OCI Classic module if you are using the Swift APIs to access Object Storage. If you are using the OCI native APIs, then install the Oracle Database Cloud Backup Module for OCI module.
- Run the
odbsrmt.py
tool on the database server by providing the mandatory parameters and their values.- If you are using the Swift APIs to access an Object Storage bucket, then provide these mandatory parameters and values to generate a backup metadata XML file.
--mode=rman-listfile --ocitype=classic --credential=user name for your cloud backup module for OCI Classic account/password --host=REST endpoint for the OCI Classic account --container=Name of the storage container that contains the source database backups --forcename=Specify a name for the metadata XML file --dir=Directory to store the metadata XML file --dbid=The DBID of the source database --prefix=The common prefix used in the backup piece names
- If you are using the OCI native APIs to access an Object Storage bucket, then provide these mandatory parameters and values to generate the backup metadata XML file.
--mode=rman-listfile --ocitype=bmc --uocid=User OCID for the Oracle Cloud Infrastructure account --tocid=Tenancy OCID for the Oracle Cloud Infrastructure account --pubfingerprint=public key used to authenticate OCI API requests --pvtkeyfile=private key used to authenticate OCI API requests --host=REST endpoint for the OCI account --container=Name of the bucket that contains the source database backups --forcename=Specify a name for the metadata XML file --dir=Directory to store the metadata XML file --dbid=The DBID of the source database --prefix=The common prefix used in the backup piece names
- The
rman-listfile
mode generates the backup metadata in an XML file that can be read by RMAN to perform aDUPLCIATE
operation of the source database. You can run theDUPLICATE
command along with theBACKUP LOCATION FROM FILE backup_list_file
clause to specify the XML file required for duplication. See Backup and Recovery Reference for more information. - The
odbsrmt.py
tool searches a bucket or container for backup piece names that start with the specifiedprefix
.
This example shows how theodbsrmt.py
tool creates a backup metadata fileduplicate.xml
for a database backup stored in the Object Storage containerPRODBACKUPS
$ $ORACLE_HOME/bin/python /home/oracle/OPC/lib/odbsrmt.py --mode=rman-listfile --host= https://myDomain.storage.oraclecloud.com/v1/myService-myDomain/ --ocitype=classic --credential='myAccount@myCompany.com'/'account-password' --container=PRODBACKUPS --forcename=duplicate.xml --dir=/home/oracle/OPC --dbid=2500571935 --prefix=CloudBkp odbsrmt.pl: ALL report output will be written to [/home/oracle/OPC/duplicate.xml] odbsrmt.pm: gathering information from container PRODBACKUPS... odbsrmt.pm: object count = 10 in container PRODBACKUPS odbsrmt.pm: scanned all entries in PRODBACKUPS odbsrmt.pl: ALL report output has been written to [/home/oracle/OPC/duplicate.xml] odbsrmt.pl: Reporting completed
This example shows how theodbsrmt.py
tool creates a backup metadata fileduplicate.xml
for a database backup stored in the Object Storage bucketOCIBACKUPS
python ./ocilib/odbsrmt.py --mode=rman-listfile --host=https://objectstorage.us-ashburn-1.oraclecloud.com --ocitype=bmc --uocid=ocid1.user.oc1..aaaaaaaasd754pijuwheaq67t7tninefkn7z7aibtusj7jqac5lpm7wm37va --tocid=ocid1.tenancy.oc1..aaaaaaaavjhvwf4c7q2ozzyduh7njrft58i6ts3ryjk7v83w7q4wdr2ka --pubfingerprint=e5:10:06:b1:fb:24:ef:db:46:21:16:20:46:jk:th:35 --pvtkeyfile=./oci_api_key.pem --container=OCIBACKUPS --dbid=2275063903 --forcename=duplicate.xml --dir=/home/oracle
This example shows the sample contents of an XML file that contains the backup metadata.<MetaData> <File> <Filename>6GJ28IEKFL_07CEC18D372F4D29E06379624664E053</Filename> <SetStamp>1150345378</SetStamp> <IsSpfile>NO</IsSpfile> <IsControlFile>NO</IsControlFile> <PieceNo>1</PieceNo> <Dbname>SALESDB</Dbname> <Dbid>3483424530</Dbid> </File> <File> <Filename>6GJ28IEKFL_07CEC18D374B4D29E06379624664E053</Filename> <SetStamp>1150345398</SetStamp> <IsSpfile>NO</IsSpfile> <IsControlFile>NO</IsControlFile> <PieceNo>1</PieceNo> <Dbname>SALESDB</Dbname> <Dbid>3483424530</Dbid> </File> <File> <Filename>6GJ28IEKFL_07CEC1A625064D36E0637962466444CD</Filename> <SetStamp>1150345378</SetStamp> <IsSpfile>NO</IsSpfile> <IsControlFile>NO</IsControlFile> <PieceNo>1</PieceNo> <Dbname>SALESDB</Dbname> <Dbid>3483424530</Dbid> </File> <File> <Filename>6GJ28IEKFL_07CEC1A6254D4D36E0637962466444CD</Filename> <SetStamp>1150345451</SetStamp> <IsSpfile>NO</IsSpfile> <IsControlFile>NO</IsControlFile> <PieceNo>1</PieceNo> <Dbname>SALESDB</Dbname> <Dbid>3483424530</Dbid> </File> </MetaData>
- If you are using the Swift APIs to access an Object Storage bucket, then provide these mandatory parameters and values to generate a backup metadata XML file.