COS offers unlimited storage and can automatically transition objects to ARCHIVE or DEEP ARCHIVE for cost reduction, making it ideal for data backup and archive.
More and more customers are backing up data in the cloud. To facilitate this, Oracle’s backup module has integrated with COS so that users can back up and restore databases at a lower cost.
The Oracle Secure Backup (OSB) Cloud Module is part of the OSB product family. It enables you to directly back up Oracle databases to COS. The OSB Cloud Module has integrated with RMAN. Therefore, you can customize an RMAN script to directly back up Oracle databases to COS efficiently.
Oracle 9i or later versions support the OSB Cloud Module. For more information, please see Oracle Documentation.
osbws_installer.zip
and run the following command with the actual SecretId
, SecretKey
, region, and endpoint of COS to install OSB:java -jar osbws_install.jar -AWSID <SecretId> -AWSKey <SecretKey> -walletDir $ORACLE_HOME/osbws_wallet -libDir $ORACLE_HOME/lib -location <Region> -awsEndPoint <endpoint>
// Replace the location with the actual directory of the package.
Example:java -jar osbws_install.jar -AWSID AKIDxxxx -AWSKey XXXX -walletDir $ORACLE_HOME/osbws_wallet -libDir $ORACLE_HOME/lib -location ap-guangzhou -awsEndPoint cos.ap-guangzhou.myqcloud.com
Note:Oracle 12 and later versions have the OSB cloud module by default. If the installation does not work, you can download the latest OSB module and install it by yourself or use a proxy.
rman target /
lib/libcos.so
and cosorcl.ora
are about the database names and should be modified as needed.run {
allocate channel ch1 type
sbt parms='SBT_LIBRARY=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libcos.so,
SBT_PARMS=(OSB_WS_PFILE=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/cosorcl.ora)';
backup channel=ch1 database format='ora_%d_%I_%T_%s_%t_%c_%p.dbf' plus archivelog;
backup channel=ch1 current controlfile format='%d_%I_%T_%s_%t_%c_%p.conf';
backup channel=ch1 spfile format='ora_%d_%I_%T_%s_%t_%c_%p.spf' ;
release channel ch1;
}
shutdown immediate;
startup nomount;
list backup
to list all backups and select the desired one, whose handle and tag should be recorded.restore
command to connect to the backup.ORACLE_1880733115_20190507_5_1007656283_1_1.conf
, which is obtained from list backup
. lib/libcos.so
and cosorcl.ora
are about the database names. They should be modified as needed and be the same as those used in the backup process.run {
allocate channel ch1 type
sbt parms='SBT_LIBRARY=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libcos.so,
SBT_PARMS=(OSB_WS_PFILE=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/cosorcl.ora)';
restore controlfile from 'ORACLE_1880733115_20190507_5_1007656283_1_1.conf';
release channel ch1;
}
restore
command below and change the database status to mount
with alter database mount
:run {
allocate channel ch1 type
sbt parms='SBT_LIBRARY=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libcos.so,
SBT_PARMS=(OSB_WS_PFILE=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/cosorcl.ora)';
restore database from tag='TAG20190507T163102';
recover database from tag='TAG20190507T163102';
release channel ch1;
}
list backup
. Ensure that the value is the same as that obtained from the control file of the database to restore, that is, the handle of the backup should be ORACLE_1880733115_20190507_5_1007656283_1_1.conf.lib/libcos.so
and cosorcl.ora
are about the database names and should be modified as needed.Note:By default, RMAN does not have concurrence. To use concurrence, you need to set it manually.
Log in to RMAN and modify the concurrence configuration. The following sets the number of concurrences to 15:
run {
configure channel device type sbt parms='SBT_LIBRARY=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libcos.so ENV=(OSB_WS_PFILE=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/cosorcl.ora)';
configure default device type to SBT;
configure device type SBT parallelism 15;
}
For more information, please see Oracle Documentation.
Was this page helpful?