Using Data Domain as a backup target for RMAN

In this post, I will demonstrate how to set up Data Domain as a backup target for RMAN using NFS.

This is a basic process that involves creating the storage unit on the Data Domain, configuring NFS and then testing the backup.  The post will serve as a basis for future posts where we will cover Mtree replication in Data Domain, and the acceleration option called DD Boost.

The EMC Data Domain backup appliance is a remarkable disk-based backup solution that replaces tape for most live backups. It integrates with a large number of operating systems and applications such as SQL Server and Oracle, as well as backup software such as EMC Networker and Avamar.

The Data Domain system uses a complex de-duplication process to analyze incoming data and recognize what has been seen before, removing the need to store multiple copies of the same data. In the context of an Oracle RMAN backup for example, a full or level zero backup changes very little from day to day or week to week. This allows the Data Domain to be extremely efficient in storage multiple backups of the same database, since only the changes really need to be stored.

Unlike an RMAN incremental, there is no need for periodic level zero backups, since each backup, even though it is de-duplicated, is presented to RMAN as a complete and atomic backup.

A backup solution like Data Domain provides exceptional operational flexibility to DBAs, allowing us to directly manage both backups and restores.

The simplest method to leverage a solution like Data Domain for RMAN, is to present some storage from the Data Domain to the database host as an NFS mount.

So let’s log into our Data Domain as an administrator account, and select the Data Management tab on the top ribbon and then select Mtree

Log into the Data Domain as an administrator

An Mtree is a logical unit of storage within the Data Domain. The Data Domain uses a global de-duplication algorithm, so regardless of if you select one Mtree or many, you will get the same rates of de-duplication.

A DBA might wish to have more than one Mtree to allow for selective replication or maintenance tasks, or may wish to keep production and non-production separate so that unauthorized DBAs cannot restore sensitive data from the RMAN backup.

There is a maximum number of Mtrees a Data Domain can support, which varies by model and software release. If your Data Domain is a shared resource, be sure to architect your Mtree solution with these limits in mind.

In our example, we are going to click on the Create button to create a new Mtree.

Click Create to create a new Mtree

The button will bring up a new dialog Create Mtree. Here we will specify the name of the new Mtree we are creating. In my example I have called it dd0205_rman. Later on I plan to automatically replicate my Mtree to another Data Domain, so that I have protection from data center failure by automatically moving my RMAN backups to a second location.

Specify a name for the new Mtree

If you have quotas enabled, you can specify a limit to the size of the physical space that the Mtree can consume. De-duplication rates can vary, especially with volatile data sets, so setting a quota is good idea to make sure one Oracle system doesn’t impact other mission critical systems. In my example however I am not going to use a quota.

Once the Mtree is created, it will be listed in the catalog of Mtrees.

Mtree has been added to the list

Next we are going to add this new Mtree as an NFS export. Click on the NFS tab under Data Management, and then click Create

Click Create to create a new NFS mount

The interface will prompt us to enter the name of the Mtree to be exported, and then we need to add a list of the client systems that are authorized to access the NFS export.

Enter the name of the Mtree to use for the new NFS mount

Clicking on the green plus symbol allows us to add a list of client systems that may access the NFS export.

We may enter a wildcard or * symbol to indicate that every client may access the new NFS export. Since we are going to be using this for Oracle RMAN backups, a wildcard is probably not a good idea.

Enter a list of client systems authorized to access the NFS mount

Add a list of all servers running Oracle that we expect to use this NFS export to write or restore RMAN backups to.

Enter a list of client systems authorized to access the NFS mount

Next we are going to mount the NFS export on the Linux server where we are running Oracle.

Connect as the root user and edit the file /etc/fstab

In this example, the lines added for the new NFS export are shown in bold.

#
# /etc/fstab
# Created by anaconda on Fri Aug  1 10:31:36 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_rstemcvm06-lv_root /                       ext4    defaults        1 1
UUID=f3b39de2-e180-4072-958a-083f09f6e947 /boot                   ext4    defaults        1 2
/dev/mapper/vg_rstemcvm06-lv_home /home                   ext4    defaults        1 2
UUID=b484a41f-14f3-4f35-a10e-6f753d8c3e54 swap                    swap    defaults        0 0
tmpfs                           /dev/shm                tmpfs   defaults        0 0
devpts                          /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                           /sys                    sysfs   defaults        0 0
proc                            /proc                   proc    defaults        0 0
/dev/vg_u01/u01                 /u01            ext4    defaults        1 2
#
# nfs mounts to data domain
#
rstdd0205mgmt.emc.com:/data/col1/dd0205_rman      /nfs_mount/dd0205_rman         nfs     rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
#
# eof

The NFS export from the Data Domain will be mounted to the Linux mount point /nfs_mount/dd0205_rman.

I will create that mount point now, and then mount the NFS export.

[root@rstemc64vm22 ~]# mkdir /nfs_mount/dd0205_rman

[root@rstemc64vm22 ~]# mount -a

[root@rstemc64vm22 ~]#

The entry in the /etc/fstab file means that Linux will automatically mount the NFS export at startup, so the mount point should be available even after reboot.

Now we can test to see if RMAN is able to write to the Data Domain.

Create an RMAN backup script following your preferred best practices. In my example I am backing up a database called xio11wsb. I am backing up and deleting all archivelogs older than 24 hours, and backing up the remainder of the archivelogs without deleting them. This approach ensures that a Dataguard instance can be maintained by the archiver.

configure default device type to disk;
configure controlfile autobackup on;
configure retention policy to recovery window of 3 days;
configure backup optimization on;

configure device type disk backup type to backupset parallelism 4;
configure channel device type disk maxopenfiles 1;

set snapshot controlfile name to '/tmp/xio11wsb.snp';

run {

   sql 'alter system switch logfile';
   backup as backupset filesperset 1 format '/nfs_mount/dd0205_rman/%d_df_%U.rmn' incremental level = 0 (database);
   sql 'alter system switch logfile';
   backup as backupset format '/nfs_mount/dd0205_rman/%d_al_%s_%p.rmn' archivelog until time 'sysdate-(1/24)' delete input;
   backup as backupset format '/nfs_mount/dd0205_rman/%d_al_%s_%p.rmn' archivelog until time 'sysdate';

}

backup current controlfile format '/nfs_mount/dd0205_rman/%d_cf_%u_%p_%c.ctl';

#
# eof

Executing this script should now backup the database to the Data Domain.

We can check the contents of the NFS export to verify:

[root@rstemc64vm22 ~]# ls /nfs_mount/dd0205_rman
XIO11WSB_al_4501_1.rmn  XIO11WSB_al_4506_1.rmn        XIO11WSB_df_cgqdetbj_1_1.rmn
XIO11WSB_al_4502_1.rmn  XIO11WSB_al_4507_1.rmn        XIO11WSB_df_chqdetbj_1_1.rmn
XIO11WSB_al_4503_1.rmn  XIO11WSB_cf_ctqdeu0m_1_1.ctl  XIO11WSB_df_ciqdetbq_1_1.rmn
XIO11WSB_al_4504_1.rmn  XIO11WSB_df_ceqdetbj_1_1.rmn  XIO11WSB_df_cjqdetdr_1_1.rmn
XIO11WSB_al_4505_1.rmn  XIO11WSB_df_cfqdetbj_1_1.rmn

Next we are going to replicate the Mtree to a second Data Domain. We have two Data Domains in our environment; dd0205mgmt is the one we used for the backup, and we have a second one called dd0204mgmt.

Using the Data Domain interface, select the Replication tab and then press Create Pair.

Replication Type will be Mtree.

The Source System will default to the source Data Domain, in this case dd0205mgmt. The source path will be the Storage Unit that was created for the Mtree, which we created earlier; dd0205_rman.

The Destination System drop-down needs to be changed to the second Data Domain; dd0204mgmt.

We will set the Desintation Path to use the same name as the source Mtree; dd0205_rman. Creating a replication pair will create the destination path, so don’t specify an existing Mtree on the destination side.

Replication of the Mtree to the second Data Domain

Clicking OK will start the process:

Replication is established

Once the process completes our backups will be replicated, but that doesn’t help us very much unless we can access them. Checking the NFS exports tab on the dd0204mgmt Data Domain shows that no NFS exports currently exist.

NFS exports on the second Data Domain

Click the Create button to add an NFS export for the Mtree created when we established replication from the dd0205mgmt Data Domain.

As before, the new NFS export will need to be configured to allow access from all servers where we expect to be running RMAN backups or restores.

Add permissions for the NFS export

And on the Linux Oracle server, we need to mount the NFS export, by again editing the /etc/fstab file:

#
# /etc/fstab
# Created by anaconda on Fri Aug  1 10:31:36 2014
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_rstemcvm06-lv_root /                       ext4    defaults        1 1
UUID=f3b39de2-e180-4072-958a-083f09f6e947 /boot                   ext4    defaults        1 2
/dev/mapper/vg_rstemcvm06-lv_home /home                   ext4    defaults        1 2
UUID=b484a41f-14f3-4f35-a10e-6f753d8c3e54 swap                    swap    defaults        0 0
tmpfs                           /dev/shm                tmpfs   defaults        0 0
devpts                          /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                           /sys                    sysfs   defaults        0 0
proc                            /proc                   proc    defaults        0 0
rstnetapp:/vol/stage            /oracle_software        nfs     defaults,noauto 0 0
rstemcstage:/emcstage           /nfs_mount/emc_software           nfs     defaults,noauto 0 0
/dev/vg_u01/u01                 /u01            ext4    defaults        1 2
#
# nfs mounts to data domain
#
rstdd0205mgmt.emc.com:/data/col1/dd0205_rman      /nfs_mount/dd0205_rman         nfs     rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
rstdd0204mgmt.emc.com:/data/col1/dd0205_rman      /nfs_mount/dd0205_rman_rep     nfs     rw,bg,hard,nointr,tcp,vers=3,timeo=600,rsize=32768,wsize=32768,actimeo=0 0 0
#
# eof

I will create a directory to mount the NFS export called dd0205_rman_rep, this will make it easier to recognize that the directory points to a replication target. With Data Domain, the replication target is read-only and cannot be written to.

[root@rstemc64vm22 ~]# mkdir /nfs_mount/dd0205_rman_rep

[root@rstemc64vm22 ~]# mount -a

We can now check the directory to see if the RMAN backup we created was replicated:

[root@rstemc64vm22 ~]# ls /nfs_mount/dd0205_rman_rep
XIO11WSB_al_4501_1.rmn  XIO11WSB_al_4506_1.rmn        XIO11WSB_df_cgqdetbj_1_1.rmn
XIO11WSB_al_4502_1.rmn  XIO11WSB_al_4507_1.rmn        XIO11WSB_df_chqdetbj_1_1.rmn
XIO11WSB_al_4503_1.rmn  XIO11WSB_cf_ctqdeu0m_1_1.ctl  XIO11WSB_df_ciqdetbq_1_1.rmn
XIO11WSB_al_4504_1.rmn  XIO11WSB_df_ceqdetbj_1_1.rmn  XIO11WSB_df_cjqdetdr_1_1.rmn
XIO11WSB_al_4505_1.rmn  XIO11WSB_df_cfqdetbj_1_1.rmn

In order for RMAN to be able to use the replicated files for recovery purposes, it needs to know they exist. We can add them to the RMAN catalog with the RMAN catalog command:

RMAN> catalog start with '/nfs_mount/dd0205_rman_rep' noprompt; 

searching for all files that match the pattern /nfs_mount/dd0205_rman_rep

List of Files Unknown to the Database
=====================================
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_ceqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_cfqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_cgqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_chqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_ciqdetbq_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_cjqdetdr_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4501_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4502_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4503_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4504_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4505_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4506_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4507_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_cf_ctqdeu0m_1_1.ctl
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_ceqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_cfqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_cgqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_chqdetbj_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_ciqdetbq_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_df_cjqdetdr_1_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4501_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4502_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4503_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4504_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4505_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4506_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_al_4507_1.rmn
File Name: /nfs_mount/dd0205_rman_rep/XIO11WSB_cf_ctqdeu0m_1_1.ctl

RMAN>
Advertisements

2 thoughts on “Using Data Domain as a backup target for RMAN

  1. Pingback: Configuring DD Boost Replication for Oracle RMAN | The Gruff DBA

  2. Pingback: Using Data Domain as a backup target for RMAN | Wissam Dagher

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s