Friday, June 19, 2009

Netbackup Oracle RMAN agent implementation

Implementing Netbackup's Oracle RMAN agent is pretty straight forward for any simple configuration. Here is the step-by-step procedure:

STEP 1) On Netbackup master server:
- Install Oracle Database extension
- During above add-on installation, you will be asked for RMAN license

STEP 2) On Netbackup client (which is running a database)
- Install Netbackup client (if not already installed)
- Test a normal file system backup to avoid any unwanted complication
- Once test file system backup is done successfully, then install Netbackup's Oracle add-on on this client.

STEP 3) Configuring a test policy on Netbackup master server for RMAN backup
- Create a new policy (eg. CL-SERVER1-RMAN-DEMO)
- Select Policy type "Oracle"
- In Clients tab, select the client (in our case, lets say SERVER1)
- In schedule (for test purpose only), just make sure that the backup type is "Application backup"
- Save the policy and exit from here. Next step is in SERVER1

STEP 4) On SERVER1 (client which is running database):
- need to shutdown the database - It is just for the one time only to link the database to netbackup agent
- Login as oracle user and set the ORACLE_SID
- As oracle dba user, run the script /usr/openv/netbackup/bin/oracle_link
- Once done, basic things are done. Lets move on to RMAN test backup now.

STEP 5) On SERVER1 itself:
- Login as oracle or database admin
- Set the oracle SID (eg. export ORACLE_SID=db1)
- Type commands given below:


oracle@SERVER1:/export/home/oracle $ rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Thu Oct 25 17:56:03 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: NBTEST (DBID=2904014931)

RMAN> run {
2> ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
3> send 'NB_ORA_POLICY=CL-SERVER1-RMAN-DEMO,NB_ORA_SERV=NBU-MASTER-SRV';
4> BACKUP DATABASE PLUS ARCHIVELOG;
5> }




using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=120 instance=nbtest1 devtype=SBT_TAPE
channel c1: VERITAS NetBackup for Oracle - Release 6.0 (2006110304)

sent command to channel: c1


Starting backup at 25-OCT-07
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=3 stamp=636919005
input archive log thread=2 sequence=1 recid=1 stamp=636919003
input archive log thread=3 sequence=1 recid=2 stamp=636919004
channel c1: starting piece 1 at 25-OCT-07
channel c1: finished piece 1 at 25-OCT-07
piece handle=01ivd777_1_1 tag=TAG20071025T175654 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:01:46
Finished backup at 25-OCT-07


Starting backup at 25-OCT-07
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00001 name=+ASMDGPRD1/nbtest/datafile/system.875.636916501
input datafile fno=00003 name=+ASMDGPRD1/nbtest/datafile/sysaux.912.636916501
input datafile fno=00002 name=+ASMDGPRD1/nbtest/datafile/undotbs1.692.636916503
input datafile fno=00005 name=+ASMDGPRD1/nbtest/datafile/undotbs2.717.636916761
input datafile fno=00006 name=+ASMDGPRD1/nbtest/datafile/undotbs3.878.636916763
input datafile fno=00004 name=+ASMDGPRD1/nbtest/datafile/users.867.636916503
channel c1: starting piece 1 at 25-OCT-07
channel c1: finished piece 1 at 25-OCT-07
piece handle=02ivd7aj_1_1 tag=TAG20071025T175842 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:01:05
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel c1: starting piece 1 at 25-OCT-07
channel c1: finished piece 1 at 25-OCT-07
piece handle=03ivd7ck_1_1 tag=TAG20071025T175842 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:00:47

Finished backup at 25-OCT-07

Starting backup at 25-OCT-07
current log archived
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=2 recid=6 stamp=636919239
input archive log thread=2 sequence=2 recid=4 stamp=636919238
input archive log thread=3 sequence=2 recid=5 stamp=636919239
channel c1: starting piece 1 at 25-OCT-07


channel c1: finished piece 1 at 25-OCT-07
piece handle=04ivd7e7_1_1 tag=TAG20071025T180039 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:07:07
Finished backup at 25-OCT-07
released channel: c1

RMAN>



This way, the simplest Oracle RMAN backup using Netbackup client is performed. The same can be seen on netbackup console as well.

2 comments:

Marcelo SIlva said...

Ohhh. But when you allocate channel c1 this backup is sent to disk, not to tape. To send to tape need to allocate sbt_tape chnannel T1 or T2 (for paralelism in oracle enterprise). I'm studing NetBackup Oracle integration and i think that Tivoli TSM integration with Oracle is better because the policy is defined by DBA in RMAN. TSM in just an media repository to Oracle, like disk. RMAN can delete backups stored in TSM when this is obsolete.

Unix Geek said...

@Marcelo: Thanks for the comment. I know T1 and C1 difference, but it was in a test environment where DBAs wanted to run Netbackup + RMAN test. :)

Btw, RMAN behavior is same for Netback as well as for TSM. You can control every RMAN backup image from RMAN itself. Netbackup in this case is only a media manager.