Home -> Enterprise Data Backup and Recovery Methods Blog -> How to Backup Oracle Database with Bacula? Oracle Backup and Recovery Technical Overview.

How to Backup Oracle Database with Bacula? Oracle Backup and Recovery Technical Overview.

  • November 17, 2018

How to Backup Oracle Database with Bacula Enterprise SBT Plugin?

There are many ways to backup Oracle database. Clustered modes provide resilience to hardware issues, and highly available, cloud, and converged infrastructures offer new options for data assurance and freedom along with redundancy. However, Oracle backup remains a critical issue in order to ensure that a small mistake, corruption, or hack doesn't destroy the critical data residing on even the best infrastructure. Database servers remain a key component of most organizations, and often contain the most critical information for the continuity of operations. The guide that follows will show you how to execute Oracle backup and recovery using RMAN's SBT functionality, which allows data to stream directly to Bacula Enterprise Edition.

Possible Types of Oracle Backup and Recovery

There are two methods to backup Oracle database:

  • Bacula managed backup using Oracle dump mode. This is quick and easy to set up, but is limited in scope to smaller databases and does not support point-in-time recovery or incremental backups.
  • RMAN managed backup (Oracle SBT mode). This mode uses the excellent RMAN backup tool and APIs to allow Bacula to initiate more advanced backup modes that support PITR, incremental and differential database backups, and can take advantage of RMAN’s change tracking feature to improve incremental backup performance. For this how-to, we'll be setting up Oracle SBT backups.

Part 1: Configure the Oracle backup and recovery plugin in Bweb

Step 1. In Bweb, configure a new fileset for the job. In the 'Plugin' tab on the fileset, select Oracle SBT.

backup oracle database

Step 2. The Oracle backup and recovery plugin is configured primarily on the client side, so in most cases no further configuration is required on in Bweb. The new fileset can be committed.

oracle backup and recovery

Step 2a: Please note the different options to backup Oracle database available if the Oracle plugin (non-SBT) is chosen. The Oracle Plugin Whitepaper covers these alternate methods in depth.

oracle backup

Part 2: Configure the Oracle Database Backup Plugin on the Oracle server

As with other database plugins, the Bacula Enterprise File Daemon and the relevant database plugin component (Oracle SBT in this case) must first be installed on the database server. This places the necessary tools for Bacula backup onto the database server. Please review the Oracle whitepaper or contact Bacula Systems support if you need help with this step.

Step 1: Install the Bacula File Daemon and the Oracle backup plugin packages

Step 2: Install the sbt library into Oracle

/opt/bacula/scripts/install-sbt-libobk.sh install

Step 3: Restart oracle

Step 4: Copy bconsole and make sure Oracle can read it:

cp /opt/bacula/bin/bconsole /opt/bacula/ oracle
cp /opt/bacula/etc/bconsole.conf /opt/bacula/oracle
chown oracle:dba /opt/bacula/oracle/bconsole*
chmod go-rxw /opt/bacula/oracle/bconsole*

Step 5: Edit /opt/bacula/etc/sbt.conf to indicate the job name, bconsole path and configuration, and client name:

client=oracle-fd
job=OracleBackup
bconsole="/opt/bacula/oracle/bconsole -n -c /opt/bacula/oracle/bconsole.conf"

Fileset and Job examples:

Below are examples of the simple fileset configured in Bweb in Part 1, and a sample job that uses this fileset. For in depth Bweb tutorials, please see the Bacula Systems video documentation at: https://www.youtube.com/channel/UCQhaFedTbaOzjge4hfXCtzQ


FileSet {
Name = SBT-FileSet
Include {
Options {
Signature = MD5
}
Plugin = oracle-sbt
}
}

Job {
Name = SBT-Backup
FileSet = SBT-FileSet
Client = oracle-fd
Maximum Concurrent Jobs = 10
Messages = Standard
Pool = Default
Storage = File
}

Part 3: Test Plugin Connectivity and Run Oracle Backup:

Step 1: Test the plugin

/opt/bacula/scripts/install-sbt-libobk.sh test

Step 2: Manually run a backup through RMAN:

RUN {
ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
ALLOCATE CHANNEL c2 DEVICE TYPE sbt;
ALLOCATE CHANNEL c3 DEVICE TYPE sbt;
BACKUP INCREMENTAL LEVEL 0 DATABASE plus archivelog;
}

A typical successful RMAN backup output looks like below, and is an indication that the SBT plugin is installed, correctly configured, and ready to run backups:

[oracle@centos07 ~]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Mar 23 11:02:22 2017

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

connected to target database: CENTOS07 (DBID=2213460080)

RMAN> run {

2> allocate channel c1 type sbt;

3> backup database plus archivelog;

4>}

using target database control file instead of recovery catalog

allocated channel: c1

channel c1: SID=44 device type=SBT_TAPE

channel c1: Bacula Enterprise Oracle SBT Plugin 1.0.0.7

Starting backup at 23-MAR-17

current log archived

channel c1: starting archived log backup set

channel c1: specifying archived log(s) in backup set

input archived log thread=1 sequence=23 RECID=1 STAMP=894837644
input archived log thread=1 sequence=24 RECID=2 STAMP=894882191
input archived log thread=1 sequence=25 RECID=3 STAMP=894882226
input archived log thread=1 sequence=26 RECID=4 STAMP=894924027
input archived log thread=1 sequence=27 RECID=5 STAMP=912953744
input archived log thread=1 sequence=28 RECID=6 STAMP=912955548
input archived log thread=1 sequence=29 RECID=7 STAMP=912955554
input archived log thread=1 sequence=30 RECID=8 STAMP=912955561
input archived log thread=1 sequence=31 RECID=9 STAMP=912955564
input archived log thread=1 sequence=32 RECID=10 STAMP=912964429
input archived log thread=1 sequence=33 RECID=11 STAMP=939375680
input archived log thread=1 sequence=34 RECID=12 STAMP=939380476
input archived log thread=1 sequence=35 RECID=13 STAMP=939380575

channel c1: starting piece 1 at 23-MAR-17

channel c1: finished piece 1 at 23-MAR-17

piece handle=07rvrjqv_1_1 tag=TAG20170323T110255 comment=API Version 2.0,MMS Version 1.0.0.7

channel c1: backup set complete, elapsed time: 00:00:25

Finished backup at 23-MAR-17

Starting backup at 23-MAR-17

channel c1: starting full datafile backup set

channel c1: specifying datafile(s) in backup set

input datafile file number=00001
name=/u01/app/oracle/oradata/CENTOS07/datafile/o1_mf_system_c2kyrs39_.dbf

input datafile file number=00003
name=/u01/app/oracle/oradata/CENTOS07/datafile/o1_mf_sysaux_c2kyqoql_.dbf

input datafile file number=00004
name=/u01/app/oracle/oradata/CENTOS07/datafile/o1_mf_undotbs1_c2kyt7s9_.dbf

input datafile file number=00006
name=/u01/app/oracle/oradata/CENTOS07/datafile/o1_mf_users_c2kyt6j4_.dbf

channel c1: starting piece 1 at 23-MAR-17

channel c1: finished piece 1 at 23-MAR-17

piece handle=08rvrjrp_1_1 tag=TAG20170323T110321 comment=API Version 2.0,MMS Version 1.0.0.7

channel c1: backup set complete, elapsed time: 00:00:56

channel c1: starting full datafile backup set

channel c1: specifying datafile(s) in backup set

including current control file in backup set

channel c1: starting piece 1 at 23-MAR-17

channel c1: finished piece 1 at 23-MAR-17

piece handle=09rvrjth_1_1 tag=TAG20170323T110321

comment=API Version 2.0,MMS Version 1.0.0.7

channel c1: backup set complete, elapsed time: 00:00:03

Finished backup at 23-MAR-17

Starting backup at 23-MAR-17

current log archived

channel c1: starting archived log backup set

channel c1: specifying archived log(s) in backup set

input archived log thread=1 sequence=36 RECID=14 STAMP=939380664

channel c1: starting piece 1 at 23-MAR-17 channel c1: finished piece 1 at 23-MAR-17

piece handle=0arvrjto_1_1 tag=TAG20170323T110424 comment=API Version 2.0,MMS Version 1.0.0.7

channel c1: backup set complete, elapsed time: 00:00:01

Finished backup at 23-MAR-17 released channel: c1

Final Thoughts on Oracle Backup and Recovery:

Because the Bacula Enterprise Oracle SBT plugin leverages RMAN for advanced backup features, some additional configuration must be done in Oracle.

Retention period:

When using RMAN SBT plugin, the backup retention defined in RMAN should match the Bacula volume or job retention.

Archive log:

In order to use the RMAN backup mode, the database must be in ARCHIVELOG mode.

Please consult the Oracle Backup whitepaper and Bacula Systems Support if you need more information, assistance, or have questions after reading this Oracle backup and recovery guide.

2 Comments
  1. Adam
    Adam

    I used to think that it’s hard to backup oracle database. But with Bacula plugin it’s easier that ever to do oracle backup and recovery. Also you can look through Bacula oracle backup whitepaper to learn more details.

  2. George
    George

    That’s a great step-by-step oracle backup and recovery tutorial with the definition of oracle backup types.
    If you want to backup oracle database you should check this post. Just follow the steps or contact support if necessary.

Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>