Avamar 7.3 RMAN configuration

 

The Avamar 7.3 for Oracle User guide is full of details on configuring RMAN and the avamar plugin. In attempting to use RMAN with the plugin I came across a few gotcha’s and this post will hopefully save others time.

After testing the Avamar Administrator Gui I quickly came to the conclusion that all backups and restores work more smoothly from the client on demand rather than through the Administrator. Especially if you are backing up instances in noarchivelog mode where you must stop oracle and mount and do other pre and post processing steps. The Gui has pre and post script options but keeping the context and error handling is quite limited.

Backups should always be performed from either the client or from the GUI.  You should not mix them as Avamar claims it will cause issues. However if you use the prefix command on the client you will be able to restore from the GUI if need be. However from my experience using the client side on demand using RMAN scripting is less risky, and has a higher success rate.

Using just the client means you do not have to setup datasets, and schedules in the Avamar Adminstrator. Basically you can see your backups and because we use a taskfile.txt on the client and send a prefix, the administrator will show all the requests and notify us if we have a failure or success.

Installation of the plugin on a client is straight forward, and the guide tells you the commands to either upgrade or install the plugin.

In my case I upgraded the plugin on Oracle Enterprise Unix using the following commands as root.

rpm –Uvh AvamarClient-linux-sles11-x86_64-7.3.100-233.rpm

rpm –Uvh AvamarRMAN-linux-sles11-x86_64-7.3.100-233.rpm

 

Login to Avamar Administrator

A domain can be created for instance which just contains your oracle databases to be backed up and restored.

I named my domain Oracle so when running the avregister command I just had to type in the domain as /Oracle

Also in Avamar Administrator you should create a user that is going to be used to login from the client to either backup or restore from the RMAN plugin. You can scope this user to the entire administrator site or to a specific domain.

I currently have oracle configured at the management servers top level.

I created a user named oracle with a role of Backup/Restore and took note of the password for when we setup the client scripts.

On the oracle server go to /usr/local/avamar/bin as root and run avregister.

typing in the /Oracle or whatever domain you created in your Avamar Administrator for this server.

also typing in the Avamar Server host name.

Now If you login to Avamar Administrator you should see your oracle server registered under the domain you chose.

image

The next step that you may miss because the instructions jump around on topics, and don’t show you a working example from the oracle account’s perspective. See the plugin is installed as root, and of course RMAN and the oracle account is  really what we need configured to run RMAN and write to the logs.

So make sure that the following directories have read write access for oracle.

/usr/local/avamar

/var/avamar

Now that we have a user account configured in Avamar Administrator, and a Domain, and a oracle server registered there we can configure the oracle server with RMAN scripts to backup or restore from the client.

On this first post I’m just going to show you a simple backup script.

Logged into our oracle server as oracle we can create a avamar flag file named my-avtar-flags.txt

In my-avatar-flags.txt we will have entries as follows:

–pidname=Oracle
–pidnum=1002        #(specific to OS see Avamar 7.3 user guide for number)
–logfile=/home/oracle/logs/backup_stage.log
–vardir=/usr/local/avamar/var
–id=oracle               #(name of user account on avamar server)
–bindir=/usr/local/avamar/bin
–ap=password        #( avamar server acccount password)
–path=/Oracle/viradbstage        # (Domain name/server name)
–server=Avamar.Lojackone.lojack.com      #(Avamar server name)
–expires=30 #(Requested days of backup: RMAN Policies will override)

after saving that file we create a taskfile.txt as follows:

–no_of_channels=1
–operation=backup

after saving that file we create an RMAN script rman_ljstage_backup.rm

run {
configure controlfile autobackup on;
allocate channel c1 type sbt PARMS=”SBT_LIBRARY=/usr/local/avamar/lib/libobk_avamar64.so”;
set controlfile autobackup format for device type sbt to ‘CONTROLFILE.LJSTAGE.%F’;
send ‘”–prefix=11g/LJSTAGE/” “–flagfile=/home/oracle/scripts/my-avtar-flags.txt” “–bindir=/usr/local/avamar/bin” “–taskfile=/home/oracle/scripts/taskfile.txt”‘;
backup database plus archivelog;
release channel c1;
}
exit

so the above rman script is setup for a SID of LJSTAGE. This RMAN script and the myavtar-flags.txt and taskfile.txt are stored in /home/oracle/scripts directory.

so to test this script we can just log in to RMAN and run the script

In my case I have an rman repository so I would login as follows:

source the oracle environment we want to backup

. oraenv

LJSTAGE

Launch rman using our repository

rman target / catalog rman/password@LJCAT

once at the RMAN prompt we would just type the script to run.

RMAN> @rman_ljstage_backup.rm

If you are not using an oracle repository you would obviously just login to rman without the catalog. and run the script the same using only the control file as a source of backup meta data.

Also note: if the above script fails you can rerun it with a little more detail in the logs by adding –debug to your myavtar-flags.txt file.

Once you have a working RMAN script you may create a bash script with all your oracle configurations and place on a cron job for daily backups:

example: rman_backup.sh

#!/bin/bash

export TMP=/tmp
export TMPDIR=$TMP
export PATH=/usr/sbin:/usr/local/bin:$PATH
export ORACLE_HOSTNAME=viradbstage.LoJackOne.LoJack.com
export NLS_DATE_FORMAT=’DD-MON-YY HH24:MI:SS’

export ORACLE_SID=LJSTAGE
export ORACLE_UNQNAME=LJSTAGE1
ORAENV_ASK=NO
. oraenv
ORAENV_ASK=YES

rman target /  catalog rman/password@LJCAT cmdfile=/home/oracle/scripts/rman_ljstage_backup.rm msglog=/home/oracle/logs/rman_ljstage_backup.`date +%Y%m%d-H%M%S`.log

 

Note: the above script has  an ORACLE_UNQNAME set.

This becomes an important setting for RMAN configured with a catalog and using dataguard. Since oracle is registered with the ORACLE_SID and if you want to do backups on your secondary RMAN will recognize the standby database when connected to the catalog properly.

My next post on this subject will be to show the steps to perform a restore using the Avamar plugin.

Thanks and as always “DBA’s don’t fly by the seat of your pants!”

This entry was posted in Oracle. Bookmark the permalink.

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s