X

Step Up to Modern Cloud Development

Backing up your Database from Windows to the Oracle Cloud

About Oracle Database Backup Cloud Service

Oracle Database Backup
Service

(ODBS) is a new backup-as-a-service offering that enables customers to store
their backups securely in the Oracle cloud.

ODBS
provides a transparent, scalable, efficient, and elastic cloud storage platform
for Oracle database backups.

The
Client side Oracle Database Cloud Backup Module which is used with Recovery
Manager (RMAN) transparently handles the backup and restore operations.

Unlike
traditional tape-based offsite storage, Cloud backups are immediately
accessible whenever a restore is required.

ODBS
it is an object storage platform that provides elastic on-demand storage
capability.

Cloud
object management and data transfer complexities are completely transparent to
the DBAs and backup administrators as the backups and restores between the
cloud and the on-site databases are handled by the database backup module.

Oracle Database Backup
Cloud Module (ODCBM)

is the cloud backup module that is installed in the database server. During the
install process, a platform specific backup module is downloaded and installed.

The
RMAN environment of the client database is configured to use the cloud backup
module to perform backups to ODBS.

Using
familiar RMAN commands, backups and restores are transparently handled by the
backup module.

Encrypted
and compressed RMAN backup data are transmitted to ODBS using SSL.


Environment Preparation


On Windows each Oracle instance runs in a single monolithic oracle.exe process. There is no way to identify the name of the instance. In order to find all of the configured Oracle services, we will use the ‘sc’ command:

C:\>
sc query state= all | find "SERVICE_NAME" | find "Oracle"

SERVICE_NAME:
Oracle Object Service

SERVICE_NAME:
OracleASMService+ASM1

SERVICE_NAME:
OracleClusterVolumeService

SERVICE_NAME:
OracleCRService

SERVICE_NAME:
OracleCSService

SERVICE_NAME:
OracleDBConsoleorcl

SERVICE_NAME:
OracleEVMService

SERVICE_NAME:
OracleJobSchedulerORCL

SERVICE_NAME:
OracleOraAsm11g_homeTNSListener

SERVICE_NAME:
OracleProcessManager

SERVICE_NAME:
OracleServiceORCL

SERVICE_NAME:
OracleVssWriterORCL

To get the current
state use ‘sc query’:

C:\>
sc query OracleServiceORCL

SERVICE_NAME:
OracleServiceORCL

TYPE : 10 WIN32_OWN_PROCESS

STATE : 4 RUNNING

(STOPPABLE,
PAUSABLE, ACCEPTS_SHUTDOWN)

WIN32_EXIT_CODE : 0 (0x0)

SERVICE_EXIT_CODE : 0 (0x0)

CHECKPOINT : 0x0

WAIT_HINT : 0x0

To find the path of the
ORACLE_HOME use ‘sc qc’:

C:\>
sc qc OracleServiceORCL

SERVICE_NAME:
OracleServiceORCL

TYPE : 10 WIN32_OWN_PROCESS

START_TYPE : 3 DEMAND_START

ERROR_CONTROL : 1 NORMAL

BINARY_PATH_NAME : c:\oracle\product\11.2.0\database\bin\ORACLE.EXE
ORCL

LOAD_ORDER_GROUP :

TAG : 0

DISPLAY_NAME : OracleServiceORCL

DEPENDENCIES :

SERVICE_START_NAME : LocalSystem


Now you are ready to set your environment:

C:\>
set ORACLE_SID=ORCL

C:\>
set ORACLE_HOME=c:\oracle\product\11.2.0\database

C:\>
set PATH=%ORACLE_HOME%\bin;%PATH%

Start the listener
process by executing lsnrctl start

C:\>
lsnrctl start


Install the Oracle Database Cloud
Backup Module

Because the cloud backups need
to be encrypted at source, you need to setup the wallet.

Change directory to ORACLE_HOME and create two subdirectories:

opc_wallet à directory
in which Oracle Database Backup Service credentials are stored

opc_lib à
directory in which the SBT (system backup to tape) library used for backups and
restores is stored

Unzip the opc_installer.zip
that you already downloaded as a prerequisite in the ORACLE_HOME

Install the Oracle Database Cloud Backup Module with
the bellow command:

c:\oracle\product\11.2.0\database>java -jar
opc_install.jar -serviceName "Storage" -identityDomain
"rooracle67327" -opcId "username" -opcPass
"password" -libPlatform "windows64" -walletDir "c:\oracle\product\11.2.0\database\opc_wallet"
-libDir "c:\oracle\product\11.2.0\database\opc_lib"

In case you work behind a proxy
you should use the –proxyHost and –proxyPort parameters.

c:\oracle\product\11.2.0\database>java -jar
opc_install.jar -serviceName "Storage" -identityDomain
"rooracle67327" -opcId "username" -opcPass
"password" -libPlatform "windows64" -walletDir "c:\oracle\product\11.2.0\database\opc_wallet"
-libDir "c:\oracle\product\11.2.0\database\opc_lib" –proxyHost "www-proxy-host.com"
–proxyPort "80"

In case you want to save the
backup in a specific container on Oracle Storage Cloud Service you also need to
specify the –container parameter

c:\oracle\product\11.2.0\database>java -jar
opc_install.jar -serviceName "Storage" -identityDomain
"rooracle67327" -opcId "username" -opcPass
"password" -libPlatform "windows64" -walletDir "c:\oracle\product\11.2.0\database\opc_wallet"
-libDir "c:\oracle\product\11.2.0\database\opc_lib" –proxyHost "www-proxy-host.com"
–proxyPort "80" –container "customContainer"

Oracle
Database Cloud Backup Module Install Tool, build 2015-09-05

Oracle
Database Cloud Backup Module credentials are valid.

Oracle
Database Cloud Backup Module wallet created in directory
c:\oracle\product\11.2.0\database\opc_wallet.

Oracle
Database Cloud Backup Module initialization file
c:\oracle\product\11.2.0\database\database\opcORCL.ora
created.

Downloading
Oracle Database Cloud Backup Module Software Library from file
opc_windows64.zip.

Downloaded
19782340 bytes in 144 seconds. Transfer rate was 137377 bytes/second.

Download
complete

Example:

-serviceName: Storage

-identityDomain: rooracle67327

-opcId: (put your username)

-opcPass: abc123 (put your password)

-walletDir: c:\oracle\product\11.2.0\database\opc_wallet

-libDir: c:\oracle\product\11.2.0\database\opc_lib

In
order to identify the serviceName and
the identityDomain, log in to
My Account using your Oracle
credentials (for more details open the email having the subject “Welcome to Oracle
Cloud. Your trial is ready.”, “My Account Administration” section).

Once
logged in, browse to your Storage instance and expand the Service Details in
order to identify the highlighted information.

Modified
folders during install of Oracle Database Cloud Backup Module Software Library
are:


In
database folder, the following have been modified:


The
configuration file opcORCL12.ora (in this lab named as opcORCL.ora) contains the following details:

OPC_HOST=https://rooracle67327.storage.oraclecloud.com/v1/Storage-rooracle67327

OPC_WALLET='LOCATION=file:c:\oracle\product\11.2.0\database\opc_wallet
CREDENTIAL_ALIAS=storage_opc'

In
opc_lib folder you have the following dll. This will be used to configure RMAN
to Back Up to the Cloud. The dll will give details on the location of the SBT
library.


In
opc_wallet the following file:


Configure RMAN and Backup Database/Tablespace

Connect
to the Recovery Manager by executing rman and connect to the target as
sys user. When prompted provide
the password as oracle.

c:\oracle\product\11.2.0\database>rman target /

Recovery
Manager: Release 12.1.0.1.0 - Production on Wed Oct 21 08:40:58 2015

Copyright
(c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.

connected
to target database: ORCL (DBID=3420093019)

RMAN> configure default device type to sbt;

using
target database control file instead of recovery catalog

new
RMAN configuration parameters:

CONFIGURE
DEFAULT DEVICE TYPE TO 'SBT_TAPE';

new
RMAN configuration parameters are successfully stored

RMAN> configure device type sbt parallelism 2;

new
RMAN configuration parameters:

CONFIGURE
DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;

new
RMAN configuration parameters are successfully stored

RMAN> configure channel device type sbt

2> PARMS='SBT_LIBRARY= c:\oracle\product\11.2.0\database\opc_lib\oraopc.dll,

3> ENV=(OPC_PFILE= c:\oracle\product\11.2.0\database\database\opcORCL.ora,

4> ORACLE_HOME= c:\oracle\product\11.2.0\database)';

new
RMAN configuration parameters:

CONFIGURE
CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=
c:\oracle\product\11.2.0\database\opc_lib\oraopc.dll,ENV=(OPC_PFILE= c:\oracle\product\11.2.0\database\database\opcORCL.ora,ORACLE

_HOME= c:\oracle\product\11.2.0\database\)';

new
RMAN configuration parameters are successfully stored

)

RMAN>
configure compression algorithm 'MEDIUM';

new
RMAN configuration parameters:

CONFIGURE
COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;

new
RMAN configuration parameters are successfully stored

RMAN> configure controlfile autobackup on;

old
RMAN configuration parameters:

CONFIGURE
CONTROLFILE AUTOBACKUP ON;

new
RMAN configuration parameters:

CONFIGURE
CONTROLFILE AUTOBACKUP ON;

new
RMAN configuration parameters are successfully stored


RMAN> set encryption on identified by
"oracle" only;

executing
command: SET encryption


RMAN> show all;

RMAN
configuration parameters for database with db_unique_name ORCL12 are:

CONFIGURE
RETENTION POLICY TO REDUNDANCY 1; # default

CONFIGURE
BACKUP OPTIMIZATION OFF; # default

CONFIGURE
DEFAULT DEVICE TYPE TO 'SBT_TAPE';

CONFIGURE
CONTROLFILE AUTOBACKUP ON;

CONFIGURE
CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default

CONFIGURE
CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default

CONFIGURE
DEVICE TYPE 'SBT_TAPE' PARALLELISM 2 BACKUP TYPE TO BACKUPSET;

CONFIGURE
DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

CONFIGURE
DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default

CONFIGURE
DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE
ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default

CONFIGURE
ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default

CONFIGURE
CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=
c:\oracle\product\11.2.0\database\opc_lib\oraopc.dll,ENV=(
OPC_PFILE=
c:\oracle\product\11.2.0\database\database\opcORCL.ora,ORACLE_HOME= c:\oracle\product\11.2.0\database)';

CONFIGURE
MAXSETSIZE TO UNLIMITED; # default

CONFIGURE
ENCRYPTION FOR DATABASE OFF; # default

CONFIGURE
ENCRYPTION ALGORITHM 'AES128'; # default

CONFIGURE
COMPRESSION ALGORITHM 'MEDIUM' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE;

CONFIGURE
RMAN OUTPUT TO KEEP FOR 7 DAYS; # default

CONFIGURE
ARCHIVELOG DELETION POLICY TO NONE; # default

CONFIGURE
SNAPSHOT CONTROLFILE NAME TO 'c:\oracle\product\11.2.0\database\DATABASE\SNCFORCL.ORA';
# default


RMAN>
BACKUP
DATABASE;


Verify the backup:

RMAN> list backup;

In a SQL Prompt restart the database in mount mode. 

SQL> shutdown abort;
SQL> startup mount;

Note: A normal shutdown will throw an error due to the missing datafile.

SQL> shutdown immediate;

Go back to the RMAN terminal and set decryption on.

RMAN> set decryption identified by "oracle";

Restore the database using the backup

RMAN> restore database;

Recover the database

RMAN> recover database;

Bring the database online.

RMAN> alter database open;



Join the discussion

Comments ( 1 )
  • Usama Monday, December 7, 2015

    Hello,

    Thanks for your clear explanation , is the Backup Module supports only 64 bit OS??

    I tried to run on windows server 2003 32bit but it hang on this step

    Oracle Database Cloud Backup Module Install Tool, build 2015-11-03

    Regards

    Usama


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha

Recent Content