Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: 8i and Veritas NetBackup

RE: 8i and Veritas NetBackup

From: Sandeep Kurliye <Sandeep_at_almoayyedintl.com.bh>
Date: Sat, 23 Mar 2002 01:13:19 -0800
Message-ID: <F001.0043189C.20020323011319@fatcity.com>

Hi Rick,

Sorry, replying very late.

I was facing some problem in setting up RMAN with netbackup 3.4 and Oracle has sent me one document. Its very easy to setup.

I'll cut n paste it here.

Hope this helps.

Regards,
Sandeep.

Problem



How to configure RMAN to work with Netbackup for Oracle ?

Solution:



Steps for configuring Netbackup for Oracle : 1. First of all we need to decide whether we want to use Recovery catalog or not . Recovery catalog stores critical backup information that is required for doing a database restore . It stores information about
  1. Datafiles and archived redo log backup set and backup piece information
  2. Datafile copy information
  3. Archived redo logs and their copy information
  4. Tablespaces and datafiles on the target database information
  5. Stored scripts

We can also use RMAN without a recovery catalog wherein all these information are stored in the control files of the database . More details about this , is given in the ORACLE 8i BACKUP AND RECOVERY GUIDE . Oracle recommends that use Recovery catalog if you have more than 20 datafiles in an instance . Since you find critical information in this , we need to keep this catalog away from the target database , because if it's on the same database and in the same disk where we have the datafiles , if the database crashes or the disk gets corrupted , it's very difficult to restore the database . So Oracle recommends that in case we need to backup 2 databases on 2 servers , say DB1 and DB2 , create 2 recovery catalogs , one on each say RCAT1 and RCAT2 , so that RCAT1 on DB1 stores the backup information for DB2 and vice versa ..

2. Create a database for housing the recovery catalog . Lets' call this instance as RCAT1 . The typical disk space requirements depends on the number of databases this catalog monitors , the number and size of the stored scripts and it grows as the number of archived logs and backups grow . The typical requirement for 1 year is :

SYSTEM TABLESPACE :            50 MB
TEMP TABLESPACE :                  5 MB
ROLLBACK SEGMENT :            5 MB
ONLINE REDO  LOG  :                  1 MB for each
RECOVERY CATALOG :            10 MB


You can create this database using the dbassist command in Oracle .

3. Create a tablespace called "cattbs" for holding the recovery catalog .
$ sqlplus sys/change_on_install_at_RCAT1

SQL> create tablespace cattbs DATAFILE '<where U want to put it>' SIZE 10M;
SQL> exit
4. Create a user for using the recovery catalog .

$ sqlplus sys/change_on_install_at_RCAT1

SQL > create user rman identified by rman temporary tablespace temp
default tablespace cattbs
quota unlimited on cattbs ;

where cattbs -> is the name of the recovery catalog's tablespace . SQL > grant RECOVERY_CATALOG_OWNER to rman ; SQL > grant connect , resource to rman ;

5. Now the user has been created try testing the connection as the user RMAN .
$ sqlplus rman/rman_at_RCAT1

This should work fine .

6. Now create the RMAN catalog tables in the tablespace CATTBS .

$ rman catalog rman/rman_at_RCAT1

rman > create catalog tablespace cattbs ;

This command takes some time when the tables are created . Query this , to see if the tables have been created or not .
$ sqlplus rman/rman_at_rcat1

SQL > select table_name from user_tables ;

This should list all the table names from the catalog .

7. Now you need to register the target database with the recovery catalog . Before this , if the database is running in MTS mode , make sure that RMAN gets a dedicated server connection when connecting . For this create an entry in $ORACLE_HOME/network/admin/tnsnames.ora file

Inst1_ded

(      description 
      ( address = ( protocol = TCP ) ( host = db1 ) ( port1521 ))
      ( connect_data = (service_name = inst1 ) (server = dedicated ))
)

You can test this connection to see if it's a dedicated server connection or not ..
$ sqlplus sys/<password>@inst1_ded

SQL > select server from v$session where sid ( select distinct sid from v$mystat ) ;
Here you should get DEDICATED .

8. Register the target database .

$ rman target sys/<password>@inst1_ded catalog rman/rman_at_RCAT1 rman >
register database ;
Please note that RMAN connects to the target database using a user who has a SYSDBA privilege defined in the target . So grant SYSDBA privilege to user RMAN . 9. Now you are all set to use the catalog for storing the backup information . A recovery catalog can store information for multiple target databases . So it needs to be backed up frequently . In case this catalog is lost , we can reconstruct the catalog partially from the current control file or it's copies . The recovery catalog should be run in ARCHIVE LOG mode .
10. The recovery catalog can be backed up using either export command , or use a cold backup strategy .

$ exp rman/rman_at_rcat1 file = RCAT1_backup.dmp owner=rman

  1. Now the Netbackup server must have already been configured and the Oracle server must have been configured as a Netbackup client . Load the Netbackup for Oracle CD into the Oracle server and mount it .

# cd /cdrom/cdrom0
# ./install

Answer the prompts accordingly .
After the installation is complete , do
# cd /usr/openv/netbackup/dbext
# ./install_dbext

  1. By default a backup API library has been supplied with Oracle . This needs to be disabled and we need to use the library that's supplied with Netbackup . Otherwise we get all sorts of error messages .. Please follow the steps mentioned in the Netbackup for Oracle manual on doing this .

For 8.1.6 , the following steps need to be done . # su - oracle
Shutdown all the Oracle instances on the server .
$ svrmgrl

SQL > connect internal
SQL > shutdown
SQL > exit

$ cd $ORACLE_HOME/lib
$ mv libobk.so libobk.so.orig
$ ln -s /usr/openv/netbackup/bin/libobk.so.1 libobk.so
$ cd $ORACLE_HOME/bin
$ cp oracle oracle.orig
$ cd $ORACLE_HOME/rdbms/lib
$ make -f ins_rdbms.mk ioracle LLIBOBK=-lobk

Start the instances again .
$ svrmgrl connect internal

SQL > startup
SQL > exit

  1. Now the database has been configured to use the Netbackup API library for backing up .
  2. There are some sample scripts given by Netbackup for backing up the Database , tablespace and restoring them . It's present in /usr/openv/netbackup/ext/db_ext/oracle/samples/rman/ directory . We need to customize these scripts according to our requirement .
  3. Go to the Netbackup Master server and setup classes for the Oracle backup .

Start the xbpadm window using
# /usr/openv/netbackup/bin/xbpadm &

Actions -> New -> Classes

Class type :       Oracle
Class name :       Daily_oracle
Volume Pool :      Specify the Volume pool where U want to store the
Oracle backups .
Clients :      Specify the client names and their Hardware and OS version (
e.g. : Solaris / Solaris 2.6 )
Schedules :      U need to specify 2 schedules . By default a
backup policy is created . Specify
The backup type as : Oracle , schedule type as : backup policy , set the retention period , Frequency and the times when U want to start the backup and the backup window U want to give .Refer to the Netbackup for Oracle manual for more information .

Create another backup schedule with the schedule type as : Automatic full backup / differential incremental / Cumulative incremental ( depending on requirement ) . All the other things are same as the backup policy .

File list : Specify the path of the Database backup script in the client machine . For e.g. :
/u01/app/oracle/product/8.1.6/backup_scripts/hot_database_backup.sh Basically during backup , the backup server initiates these commands on the client machine during the backup window , so that the client runs the RMAN commands and sends the backup to the Netbackup server and finally to the Tape library . This script is basically a customized version of the sample script found in /usr/openv/netbackup/ext/db_ext/oracle/samples/rman/ directory .
The scripts have detailed information on what needs to be customised for the particular environment .
Now save the class , terminate the media manager request daemon BPRD and restart the same again , so that the change takes into effect immediately . For killing the BPRD daemon , Xbpadm -> File -> Terminate the Request daemon . For starting the daemon again ,
/usr/openv/netbackup/bin/initbprd

  1. Now you can check the status of the backup from the Job Monitor of Netbackup or you can view the text file which is the one where the output of the hot_database_backup.sh script is written .

# tail -f $ORACLE_HOME/backup_scripts/hot_database_backup_level0.out

Some useful commands in RMAN :
1. Starting a database from RMAN .

RMAN > startup mount
pfile=/u01/app/oracle/product/8.1.6/dbs/init<SID>.ora

2. To see a database schema :

RMAN > report schema ;

3. To copy a Datafile to say another disk , make sure that you have taken the particular tablespace of that Datafile OFFLINE .

RMAN > run {
Allocate channel c1 type disk ;
Copy Datafile 1 to '/u02/oradata/backup/datafile1.bak';

               }

4. To backup a tablespace :

RMAN > run {
Allocate channel c1 type 'SBT_TAPE';
Backup tablespace system ;

                     }

5.	Listing the backups :


RMAN > list backup ;

6. Validate the backup , so that it does a test run and checks if the backup can be restored successfully . Run the LIST command to find the primary key for the backup set .

RMAN > list backup ;
RMAN > run {
Allocate channel c1 type 'SBT_TAPE';

Validate backup set 3 ;                  # This validates
the entire backup set
Restore controlfile validate ;      # This does for a
control file
Restore tablespace 'system' validate ; # for a tablespace "SYSTEM"
Restore archivelog all validate ;      # For an archivelog
                }


7.	Use the list and report commands for querying the recovery catalog .


LIST - This command queries the catalog / control file to produce a listing of its contents .
$ rman target sys/pass_at_PROD1 catalog rman/rman_at_RCAT1 rman > list copy of
database archivelog all; rman > list backup ; For particular objects :
Rman > list backup of database ; # all files in the database Rman > list copy of Datafile '/u01/oracle/dbs/tbs1.dbf' ;

Rman > list copy of archivelog all ;
Rman > list backup of tablespace 'SYSTEM';
Rman > list backup of control file ;

REPORT - This command is used for getting a detailed information from the catalog like
a.	Which files need a backup
b.	Which files haven't been backed up recently
c.	Which files are listed unrecoverable
d.	Which backup sets are obsolete and can be deleted
e.	Which copies are on disk and which are on tape



To identify which datafiles need a backup : Rman > report need backup days = 7 database ; Rman > report need backup days = 30 tablespace system ; Where days = x , is the number of days of archive logs required to recover the database safely .

Types of Oracle backups :
1. Full -> It backs up all the used datablocks in a Datafile . It's not the same as a Incremental Level
0 backup .
2. Incremental -> It backs up only all the data blocks that have changed since the last incremental backup . During a restore we need to have a level 0 backup also . 3. Open -> Backup of any part of target database when it's open

4. Closed -> When the database is mounted , but closed .

5. Consistent -> The database is mounted but not open . The database must have been shutdown cleanly before this step . The checkpoint SCNs in the Datafile must match the Datafile headers in the control file . This backup can be restored without recovery .

6. Inconsistent -> The backup of the database when it's open , when it crashed lasttime when it was mounted or when U use a shutdown abort before backup . U need to do a database recovery . Reference:

  1. Oracle 8I backup and recovery guide
  2. Netbackup 3.2 Administrator's guide
  3. Netbackup 3.2 media manager's guide
  4. Netbackup for Oracle installation guide .

Additional Keywords



Solaris; Configure Netbackup; VOS

Note:



This document was written by VOS JEC
( Veritas Oracle Sun Joint Escalation Center ) analyst.

Hope this helps.

Regards,
Sandeep.

 -----Original Message-----

Sent:	Friday, February 22, 2002 5:38 PM
To:	Multiple recipients of list ORACLE-L
Subject:	8i and Veritas NetBackup

Is anyone using this combination? We're having problems getting backups to work with 8i. It works fine with our 8 dbs, but when we try to backup the 8i ones, the control panel says the backup has started, but it doesn't finish and usually has a dead rman process on the db.

We've working with Veritas support, but it's been 2 weeks and no answer.

The dbs are 8.1.7.3 on Solaris 7 and we did patch the oracle executables.

Thank you for any help.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: rick_at_dormir.org

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Sandeep Kurliye
  INET: Sandeep_at_almoayyedintl.com.bh

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Sat Mar 23 2002 - 03:13:19 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US