图文详解安装NetBackup 6.5备份恢复Oracle 10g rac 数据库(修订)

我们使用Linux平台进行测试,OS版本为Oracle Enterprise Linux 5.5 x86_64:
[root@nas servsoft]# cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Kernel \r on an \m

Netbackup 6.0仅支持2.4内核的Linux版本,2.6内核的Linux版本(主流的包括RHEL4,5 Centos等)需要使用NBU,只能安装Netbackup 6.5或以上版本。
现在我们有三台主机: rh1(rac的2号节点),rh2(rac的1号节点),nas(NBU Server)。
首先需要安装的是Netbackup Server端软件,当然你需要用到安装介质,你可以尝试在Veritas的官方网站下载到最新的版本;获取到安装介质后,我们首先要解压它:

[root@nas netbackup]# cp NetBackup_6.5_LinuxRedhat2.6.tar.gz /tmp

[root@nas tmp]# gunzip NetBackup_6.5_LinuxRedhat2.6.tar.gz

[root@nas tmp]# tar -xvf NetBackup_6.5_LinuxRedhat2.6.tar

在进入安装前确认xinetd服务正确运行着:

[root@nas tmp]# service xinetd status

xinetd (pid  2886) is running...

[root@nas NB_65_LinuxR_x86_20070723]# ./install

Do you want to install NetBackup and Media Manager files? [y,n] (y) y

NetBackup and Media Manager are normally installed in /usr/openv.

Is it OK to install in /usr/openv? [y,n] (y) y

Reading NetBackup files from /tmp/NB_65_LinuxR_x86_20070723/linuxR_x86/anb

...................

Enter the full path name to the directory where the

appropriate installics script is located followed by

a  to continue. This script will then install

the package(s).

        OR

Enter q to stop this install and abort.

此时我们需要输入Netbackup ISC(Infrastructure Core Services)软件所在的目录,当然你也可以从Veritas官方网站下载到该软件包,尝试解压:

[root@nas tmp]# cp NetBackup_6.5_ICS_LinuxX86.tar.gz /tmp

[root@nas tmp]# cd /tmp

[root@nas tmp]# gunzip NetBackup_6.5_ICS_LinuxX86.tar.gz

[root@nas tmp]# tar -xvf NetBackup_6.5_ICS_LinuxX86.tar

则此时ISC安装介质位于/tmp/NB_65_ICS_1.4.37.0_LinuxX86下,在原终端窗口中输入该目录

Enter q to stop this install and abort.

/tmp/NB_65_ICS_1.4.37.0_LinuxX86

Installing VRTSpbx...

A NetBackup Server or Enterprise Server license key is needed

for installation to continue.

Enter license key:

继续安装,此时需要输入您所购买的License注册码;如果您没有购买该软件但仍想使用的话,

可以尝试下面一串字符:DEX6-23FJ-T92R-O4O4-O4O4-K777-7777-EPXP-3XO。

Enter license key: DEX6-23FJ-T92R-O4O4-O4O4-K777-7777-EPXP-3XO

DEX6-23FJ-T92R-O4O4-O4O4-K777-7777-EPXP-3XO:

        NetBackup Enterprise Server Base product with all the features enabled

        has been registered.

All additional keys should be added at this time.

Do you want to add additional license keys now? [y,n] (y) n

Use /usr/openv/netbackup/bin/admincmd/get_license_key

to add, delete or list license keys at a later time.

Installing NetBackup Enterprise Server version: 6.5

If this machine will be using a different network interface than the

default (nas), the name of the preferred interface should be used

as the configured server name.  If this machine will be part of a

cluster, the virtual name should be used as the configured server name.

Would you like to use "nas" as the configured

name of the NetBackup server? [y,n] (y) y

Is nas the master server? [y,n] (y) y

Do you have any media servers? [y,n] (n) n

Checking /etc/services for the needed NetBackup and Media Manager services.

Copying original /etc/services file to /etc/services.NBU_062910.14:27:41

Editing /etc/services to update NetBackup and Media Manager services.

/etc/services will be updated to add the following entries for

NetBackup/Media Manager.

bpjobd  13723/tcp       bpjobd

vmd     13701/tcp       vmd

acsd    13702/tcp       acsd

tl8cd   13705/tcp       tl8cd

tldcd   13711/tcp       tldcd

odld    13706/tcp       odld

tl4d    13713/tcp       tl4d

tshd    13715/tcp       tshd

tlmd    13716/tcp       tlmd

tlhcd   13717/tcp       tlhcd

rsmd    13719/tcp       rsmd

...................

好了Netbackup Server端软件已经在NAS主机上安装完成,接下来我们需要进一步配置备份策略。

将/usr/openv/netbackup/bin路径加入到你的用户环境变量PATH中,以方便调用相关执行文件;

并在具有X11 forwarding功能的软件中(譬如Xmanager)中输入jnbSA命令,

您可能遭遇java.lang.UnsatisfiedLinkError: /usr/openv/java/jre/lib/i386/libawt.so: libXp.so的错误,

一般是由于没有安装libXp(i386和x86_64版本的都装一下)包所导致的。

正确安装的话输入jnbSA命令可以看到以下界面:

接着我们需要定义存储单元(Storage Unit),如果你同我一样没有真实的磁带机的话那么我们可以定义普通Disk

类型的存储单元, 选择Netbackup Management->Storage -> Storage Unit,在右边分隔栏右键点击New Storage Unit,

为你的存储单元起一个名字,并输入相关存储目录:

接下来点击NetBackup Management->Policies 选项定义Oracle备份使用到的备份策略,启用Backup Policy Configuration Wizard,并选择Oracle为备份策略类型:

在客户端列表(client list)中加入需要备份2台RAC所在主机,分别为rh1,rh2;硬件与操作系统选择Linux,Redhat2.6

好了,server端的配置完成了,接下来我们安装client端软件,安装前确认你已经获得了相关安装介质,以NBU6.5举例来说你需要有:NetBackup_6.5_CLIENTS2.tar.gz和NetBackup_6.5_UnixOptions.tar.gz 分别为Client端和Oracle Agent软件。

[root@rh2 tmp]# gunzip  NetBackup_6.5_UnixOptions.tar.gz
[root@rh2 tmp]# gunzip  NetBackup_6.5_CLIENTS2.tar.gz
[root@rh2 tmp]# tar -xvf NetBackup_6.5_UnixOptions.tar
[root@rh2 tmp]# tar -xvf NetBackup_6.5_CLIENTS2.tar
[root@rh2 tmp]# cd NB_65_CLIENTS2_20070723/
[root@rh2 NB_65_CLIENTS2_20070723]# ./install

Symantec Installation Script
Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved.

Installing NetBackup Client Software

NOTE:  To install NetBackup Server software, insert the appropriate
NetBackup Server cdrom.

Do you wish to continue? [y,n] (y) y
Do you want to install the NetBackup client software for this client? [y,n] (y) y

This package will install Linux/RedHat2.6 client.

This package will install NetBackup client 6.5.

Enter the name of the NetBackup server : nas

Would you like to use "rh2" as the configured
name of the NetBackup client? [y,n] (y) y
........................
File /usr/openv/tmp/install_trace.10994 contains a trace of this install.
That file can be deleted after you are sure the install was successful.

[root@rh2 tmp]# cd NB_65_UOptions_20070723/
root@rh2 NB_65_UOptions_20070723]# ./install

Symantec Installation Script
Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved.

Installation Options

1 NetBackup Add-On Product Software
2 NetBackup Database Agent Software

q To quit from this script
Choose an option [default: q]: 2

**********

There are two ways to install database agent software.

1.  Remote Installation:  Loads the software on a server with
the intent of pushing database software out to affected clients.

2.  Local Installation:   Loads and installs the software only to this
local machine.

**********

Do you want to do a local installation? [y,n] (n) y

**********

NetBackup Database Agent Installation

Choose the Database Agents you wish to install
one at a time or select Install All Database Agents.

1)  NetBackup for DB2
2)  NetBackup for Informix
3)  NetBackup for Lotus Notes
4)  NetBackup for Oracle
5)  NetBackup for SAP
6)  NetBackup for Sybase

7)  Install All Database Agents

q)  Done Selecting Agents
x)  Exit from this Script

Choose an option: 4

Choose an option: q

You have chosen to install these Database Agents:

NetBackup for Oracle

Is this list correct? [y,n] (y) y

**********

Of the agents selected, the following are supported
on this platform and will be installed:

Oracle

Loading the Database Agent packages into the
/usr/openv/netbackup/dbext directory and installing.

**********

Installing NetBackup for Oracle

Installing NetBackup for Oracle...
..........................
NetBackup for Oracle installation completed.

完成NBU客户端和Netbackup for Oracle Agent安装后,我们还需要对MML介质库文件进行链接,使用dba或oinstall组账户执行/usr/openv/netbackup/bin/oracle_link文件:
[root@rh2 NB_65_UOptions_20070723]# su - maclean
[maclean@rh2 ~]$ cd /usr/openv/netbackup/bin/
[maclean@rh2 bin]$ ./oracle_link
Tue Jun 29 19:22:28 EDT 2010
All Oracle instances should be shutdown before running this script.

Please log into the Unix system as the Oracle owner for running this script

Do you want to continue? (y/n) [n]
[maclean@rh2 bin]$ echo $ORACLE_HOME
/s01/rac10g
[maclean@rh2 bin]$ ./oracle_link
Tue Jun 29 19:22:35 EDT 2010
All Oracle instances should be shutdown before running this script.

Please log into the Unix system as the Oracle owner for running this script

Do you want to continue? (y/n) [n] y

LIBOBK path: /usr/openv/netbackup/bin
ORACLE_HOME: /s01/rac10g
Oracle version: 10.2.0.5.0
Platform type: x86_64
Linking LIBOBK:
ln -s /usr/openv/netbackup/bin/libobk.so64 /s01/rac10g/lib/libobk.so
Done

接下来在rh2主机上进行备份测试:

[maclean@rh2 bin]$ rman target /

Recovery Manager: Release 10.2.0.5.0 - Production on Tue Jun 29 19:26:00 2010

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

connected to target database: RACDB (DBID=720516428)

RMAN> run
2> { allocate channel c1 type sbt parms="ENV=(NB_ORA_SERV=nas,NB_ORA_POLICY=racdb,NB_ORA_CLIENT=rh2)";
3> backup current controlfile;
4> release channel c1;
5> }
RMAN> run
2> { allocate channel c1 type sbt parms="ENV=(NB_ORA_SERV=nas,NB_ORA_POLICY=racdb,NB_ORA_CLIENT=rh2)";
3> backup current controlfile;
4> release channel c1;
5> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=136 instance=racdb1 devtype=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2007072323)

Starting backup at 29-JUN-10
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
including current control file in backupset
channel c1: starting piece 1 at 29-JUN-10
channel c1: finished piece 1 at 29-JUN-10
piece handle=03lhfi11_1_1 tag=TAG20100629T192729 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:00:37
Finished backup at 29-JUN-10

released channel: c1

如上所示成功备份了当前控制文件。
RMAN> run
2> {
3> allocate channel c1 type sbt parms="ENV=(NB_ORA_SERV=nas,NB_ORA_POLICY=racdb)";
4> backup archivelog all delete input;
5> release channel c1;
6> }

using target database control file instead of recovery catalog
allocated channel: c1
channel c1: sid=136 instance=racdb1 devtype=SBT_TAPE
channel c1: Veritas NetBackup for Oracle - Release 6.5 (2007072323)

Starting backup at 29-JUN-10
channel c1: starting archive log backupset
channel c1: specifying archive log(s) in backup set
input archive log thread=1 sequence=1 recid=2 stamp=722901460
input archive log thread=1 sequence=2 recid=4 stamp=722901476
input archive log thread=1 sequence=3 recid=5 stamp=722901499
input archive log thread=1 sequence=4 recid=6 stamp=722904852
input archive log thread=2 sequence=1 recid=1 stamp=722901426
input archive log thread=2 sequence=2 recid=3 stamp=722901470
input archive log thread=2 sequence=3 recid=7 stamp=722904852
channel c1: starting piece 1 at 29-JUN-10
channel c1: finished piece 1 at 29-JUN-10
piece handle=06lhfjqr_1_1 tag=TAG20100629T195819 comment=API Version 2.0,MMS Version 5.0.0.0
channel c1: backup set complete, elapsed time: 00:00:46
channel c1: deleting archive log(s)
archive log filename=/arch/1_1_722899663.dbf recid=2 stamp=722901460
archive log filename=/arch/1_2_722899663.dbf recid=4 stamp=722901476
archive log filename=/arch/1_3_722899663.dbf recid=5 stamp=722901499
archive log filename=/arch/1_4_722899663.dbf recid=6 stamp=722904852
archive log filename=/arch/2_1_722899663.dbf recid=1 stamp=722901426
archive log filename=/arch/2_2_722899663.dbf recid=3 stamp=722901470
archive log filename=/arch/2_3_722899663.dbf recid=7 stamp=722904852
Finished backup at 29-JUN-10

Starting Control File and SPFILE Autobackup at 29-JUN-10
piece handle=c-720516428-20100629-01 comment=API Version 2.0,MMS Version 5.0.0.0
Finished Control File and SPFILE Autobackup at 29-JUN-10

released channel: c1

Comments

  1. admin says

    RMAN: How to perform alternate client restore with Veritas Netbackup
    Applies to:
    Oracle Server – Enterprise Edition – Version: 9.2.0.1 to 10.2.0.2 – Release: 9.2 to 10.2
    Oracle Server – Enterprise Edition – Version: 9.2.0.2 to 10.2.0.5.0 [Release: 9.2 to 10.2]
    Information in this document applies to any platform.
    Goal
    The goal of this note is to describe how to achieve restores with VERITAS NETBACKUP
    and Oracle Recovery Manager (RMAN) on a different host, than the backup host.

    This functionality called “Alternate Client Restore” is needed in several circumstances:

    * Restoring in a Real Application Cluster (RAC) Environment
    * Restoring in a physical Standby Environment
    * Creation of a test database with DUPLICATE DATABASE command
    * Creation of a standby database using DUPLICATE DATABASE … FOR STANDBY
    * Restoring Database for Point-in-Time-Recovery (PITR)
    * Restoring parts of database for Tablespace-Point-in-Time-Recovery (TSPITR)
    * Restoring full database after disaster, when original host no longer exists

    Solution
    The following environment has been used for the tests:

    * RAC 10.2.0.2.0 with 2 Nodes named “veritas01” and “veritas02”
    * RAC Instances “TEST1” and “TEST2”
    * Solaris 10
    * Veritas Netbackup 6.0MP3
    * Automatic Storage Management (ASM) for Database and Flash Recovery Area (FRA)

    1. Archivelogs from Thread 2 with Sequence# 525-527 are backed up on veritas01/TEST1 and Sequence# 522-524 on veritas02/TEST2:

    RMAN> run {
    2> allocate channel xy device type ‘SBT_TAPE’;
    3> backup archivelog sequence between 525 and 527 thread 2;
    4> }

    allocated channel: xy
    channel xy: sid=319 instance=TEST1 devtype=SBT_TAPE
    channel xy: VERITAS NetBackup for Oracle – Release 6.0 (2005090703)

    Starting backup at 13-DEC-06
    channel xy: starting archive log backupset
    channel xy: specifying archive log(s) in backup set
    input archive log thread=2 sequence=525 recid=805 stamp=609066794
    input archive log thread=2 sequence=526 recid=807 stamp=609067711
    input archive log thread=2 sequence=527 recid=809 stamp=609068621
    channel xy: starting piece 1 at 13-DEC-06
    channel xy: finished piece 1 at 13-DEC-06
    piece handle=2ci4rbig_1_1 tag=TAG20061213T101751 comment=API Version 2.0,MMS Version 5.0.0.0
    channel xy: backup set complete, elapsed time: 00:03:16
    Finished backup at 13-DEC-06

    RMAN> run {
    2> allocate channel xy device type ‘SBT_TAPE’;
    3> backup archivelog sequence between 522 and 524 thread 2;
    4> }
    allocated channel: xy
    channel xy: sid=642 instance=TEST2 devtype=SBT_TAPE
    channel xy: VERITAS NetBackup for Oracle – Release 6.0 (2005090703)

    Starting backup at 13-DEC-06
    channel xy: starting archive log backupset
    channel xy: specifying archive log(s) in backup set
    input archive log thread=2 sequence=522 recid=799 stamp=609064126
    input archive log thread=2 sequence=523 recid=801 stamp=609065010
    input archive log thread=2 sequence=524 recid=803 stamp=609065929
    channel xy: starting piece 1 at 13-DEC-06
    channel xy: finished piece 1 at 13-DEC-06
    piece handle=2bi4rbia_1_1 tag=TAG20061213T101746 comment=API Version 2.0,MMS Version 5.0.0.0
    channel xy: backup set complete, elapsed time: 00:03:57
    Finished backup at 13-DEC-06

    2. Verification of the Backups in Netbackup Catalog:

    oracle@veritas01:/usr/openv/netbackup/bin #./bplist -C veritas01.backup -l -t 4 -R /
    -rw——- oracle oracle 308543488 Dec 13 2006 /2ci4rbig_1_1

    oracle@veritas01:/usr/openv/netbackup/bin #./bplist -C veritas02.backup -l -t 4 -R /
    -rw——- oracle oracle 308543488 Dec 13 2006 /2bi4rbia_1_1

    The Client Names in Netbackup “veritas01.backup” and “veritas02.backup” don’t match the physical Hostnames.
    With the “bplist” command, we can display the Backup Pieces owned by each Backup Client.

    3. Manually delete the Archivelogs Sequence# 522-527 from the FRA

    This step is necessary to avoid the message “restore not done; all files readonly, offline, or already restored” otherwise. Used GridControl in order to achieve this, because it provides a GUI to the ASM Instance.
    Alternatively “asmcmd” could have been used to perform the deletion of above Archivelogs.

    4. Restore all Archivelogs on Node “veritas02”

    Assume, that node “veritas01” is no longer available and thus need to restore all archivelogs regardless where they have been backed up.

    This needs the RMAN AUTOLOCATE feature and therefor allocate 2 channels with different PARMS Settings of Veritas NB_ORA_CLIENT Variable:

    RMAN> run {
    2> allocate channel ch00 type ‘sbt_tape’ parms ‘ENV=(NB_ORA_CLIENT=veritas01.backup)’;
    3> allocate channel ch01 type ‘sbt_tape’ parms ‘ENV=(NB_ORA_CLIENT=veritas02.backup)’;
    4> restore archivelog sequence between 522 and 527 thread 2;
    5> }
    allocated channel: ch00
    channel ch00: sid=1021 instance=TEST2 devtype=SBT_TAPE
    channel ch00: VERITAS NetBackup for Oracle – Release 6.0 (2005090703)

    allocated channel: ch01
    channel ch01: sid=1163 instance=TEST2 devtype=SBT_TAPE
    channel ch01: VERITAS NetBackup for Oracle – Release 6.0 (2005090703)

    Starting restore at 13-DEC-06

    channel ch00: starting archive log restore to default destination
    channel ch00: restoring archive log
    archive log thread=2 sequence=525
    channel ch00: restoring archive log
    archive log thread=2 sequence=526
    channel ch00: restoring archive log
    archive log thread=2 sequence=527
    channel ch00: reading from backup piece 2ci4rbig_1_1
    channel ch00: restored backup piece 1
    piece handle=2ci4rbig_1_1 tag=TAG20061213T101751
    channel ch00: restore complete, elapsed time: 00:01:26
    channel ch01: starting archive log restore to default destination
    channel ch01: restoring archive log
    archive log thread=2 sequence=522
    channel ch01: restoring archive log
    archive log thread=2 sequence=523
    channel ch01: restoring archive log
    archive log thread=2 sequence=524
    channel ch01: reading from backup piece 2bi4rbia_1_1
    channel ch01: restored backup piece 1
    piece handle=2bi4rbia_1_1 tag=TAG20061213T101746
    channel ch01: restore complete, elapsed time: 00:00:45
    Finished restore at 13-DEC-06
    released channel: ch00
    released channel: ch01

    The Veritas Client Logfile shows the interesting pieces:

    10:52:30.198 [10994] <4> VxBSAQueryObject: INF – Object was not found in the NetBackup catalog.
    10:52:30.198 [10994] <2> xbsa_QueryObject: INF – leaving (17)
    10:52:30.198 [10994] <2> int_FindBackupImage: INF – 2bi4rbia_1_1 not found

    10:52:30.198 [10994] <2> int_DumpSbtInfo: INF – Media Information for Backup File : <2bi4rbia_1_1>
    10:52:30.198 [10994] <2> int_DumpSbtInfo: INF – Unknown Type : <8>
    10:52:30.198 [10994] <2> int_DumpSbtInfo: INF – leaving
    10:52:30.198 [10994] <2> sbtinfo2: INF – leaving
    10:52:30.274 [10960] <4> dbc_GetMediaListByName: Media ID : <0234L2>
    10:52:30.274 [10960] <4> dbc_GetMediaListByName: File Creation Date and Time : <1166004202>
    10:52:30.274 [10960] <4> dbc_GetMediaListByName: File Expiration Date and Time: <1166436202>
    10:52:30.274 [10960] <4> dbc_GetMediaListByName: Comment :
    10:52:30.274 [10960] <4> dbc_GetMediaListByName: Keyword :
    10:52:30.274 [10960] <4> VxBSAQueryObject: INF – Object was found on media <0234L2>.

    10994 and 10960 are the different channels allocated. i.e. when the first channel doesn’t get the piece, then the second channel asks with SBTINFO call and performs the restore.

    5. Explanation of AUTOLOCATE Feature

    Restoring Files in a Real Application Cluster Configuration

    In a Real Application Clusters configuration, RMAN automatically restores backups, control file copies, and datafile copies from channels that can read the files on tape or a local file system. For example, if channel 1 connected to instance 1 can read log 1000 from its tape drive, but channel 2 connected to instance 2 cannot read the same log from its tape drive, then channel 1 restores the log. Autolocation is automatically enabled when the channels meet any of the following criteria:

    * Different PARMS settings
    * Different CONNECT strings

    6. Errors when the Autolocate Feature is not used

    Also tested what happens if two channels are used without the correct NB_ORA_CLIENT settings.
    Defined a default channel pointing NB_ORA_CLIENT to first backup node “veritas01″ only.

    RMAN> show channel;

    RMAN configuration parameters are:
    CONFIGURE CHANNEL DEVICE TYPE ‘SBT_TAPE’ PARMS ‘ENV=(NB_ORA_CLIENT=veritas01.backup,NB_ORA_SERV=veritas03)’;

    RMAN> run {
    2> restore archivelog sequence between 522 and 527 thread 2;
    3> }

    Starting restore at 13-DEC-06
    allocated channel: ORA_SBT_TAPE_1
    channel ORA_SBT_TAPE_1: sid=1023 instance=TEST2 devtype=SBT_TAPE
    channel ORA_SBT_TAPE_1: VERITAS NetBackup for Oracle – Release 6.0 (2005090703)
    allocated channel: ORA_DISK_1
    channel ORA_DISK_1: sid=316 instance=TEST2 devtype=DISK

    channel ORA_SBT_TAPE_1: starting archive log restore to default destination
    channel ORA_SBT_TAPE_1: restoring archive log
    archive log thread=2 sequence=525
    channel ORA_SBT_TAPE_1: restoring archive log
    archive log thread=2 sequence=526
    channel ORA_SBT_TAPE_1: restoring archive log
    archive log thread=2 sequence=527
    channel ORA_SBT_TAPE_1: reading from backup piece 2ci4rbig_1_1
    channel ORA_SBT_TAPE_1: restored backup piece 1
    piece handle=2ci4rbig_1_1 tag=TAG20061213T101751
    channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:26
    channel ORA_SBT_TAPE_1: starting archive log restore to default destination
    channel ORA_SBT_TAPE_1: restoring archive log
    archive log thread=2 sequence=522
    channel ORA_SBT_TAPE_1: restoring archive log
    archive log thread=2 sequence=523
    channel ORA_SBT_TAPE_1: restoring archive log
    archive log thread=2 sequence=524
    channel ORA_SBT_TAPE_1: reading from backup piece 2bi4rbia_1_1
    ORA-19870: error reading backup piece 2bi4rbia_1_1
    ORA-19507: failed to retrieve sequential file, handle=”2bi4rbia_1_1″, parms=””
    ORA-27029: skgfrtrv: sbtrestore returned error
    ORA-19511: Error received from media manager layer, error text:
    Backup file <2bi4rbia_1_1> not found in NetBackup catalog
    failover to previous backup

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of restore command at 12/13/2006 11:15:12
    RMAN-06026: some targets not found – aborting restore
    RMAN-06025: no backup of log thread 2 seq 524 lowscn 117366298 found to restore
    RMAN-06025: no backup of log thread 2 seq 523 lowscn 117073569 found to restore
    RMAN-06025: no backup of log thread 2 seq 522 lowscn 116774471 found to restore

    This happens, because the piece “2bi4rbia_1_1” is owned by Netbackup Client veritas02.backup.

    Restore the missing Archivelogs 522-524 with NB_ORA_CLIENT=veritas02.backup:

    RMAN> run {
    2> allocate channel ch00 type ‘sbt_tape’ parms ‘ENV=(NB_ORA_CLIENT=veritas02.backup)’;
    3> restore archivelog sequence between 522 and 524 thread 2;
    4> }

    released channel: ORA_SBT_TAPE_1
    released channel: ORA_DISK_1
    allocated channel: ch00
    channel ch00: sid=1023 instance=TEST2 devtype=SBT_TAPE
    channel ch00: VERITAS NetBackup for Oracle – Release 6.0 (2005090703)

    Starting restore at 13-DEC-06

    channel ch00: starting archive log restore to default destination
    channel ch00: restoring archive log
    archive log thread=2 sequence=522
    channel ch00: restoring archive log
    archive log thread=2 sequence=523
    channel ch00: restoring archive log
    archive log thread=2 sequence=524
    channel ch00: reading from backup piece 2bi4rbia_1_1
    channel ch00: restored backup piece 1
    piece handle=2bi4rbia_1_1 tag=TAG20061213T101746
    channel ch00: restore complete, elapsed time: 00:01:36
    Finished restore at 13-DEC-06
    released channel: ch00

  2. admin says

    How to Configure RMAN to Work with Netbackup for Oracle
    ——————————————————————–
    This article describes a solution that was used to resolve this
    issue for another Oracle customer. As it relates to a third-party
    product, Oracle does not guarantee that this resolution will work
    for all customers using this or any other third-party product. The
    appropriate third-party vendor should be contacted if there are any
    questions or problems relating to this resolution or these errors.
    ——————————————————————–

    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

    a. Datafiles and archived redolog, backupset and backuppiece
    information
    b. Datafile copy information
    c. Archived redo logs and their copy information
    d. Tablespaces and datafiles on the target database information
    e. Stored scripts

    We can also use RMAN without a recovery catalog wherein all these
    information, except the scripts, are stored in the control files
    of the database. Moredetails about this, is given in the
    Oracle 8i Backup and Recovery Guide.

    Oracle recommends the use of a 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.

    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 : 100 MB (depends on the Oracle release)
    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@RCAT1
    SQL> create tablespace cattbs DATAFILE ‘‘ SIZE 10M;
    SQL> exit

    4. Create a user for using the recovery catalog.

    $ sqlplus sys/change_on_install@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@RCAT1

    This should work fine.

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

    $ rman catalog rman/rman@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@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) (port = 1521))
    (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/@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/@inst1_ded catalog rman/rman@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.

    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 ARCHIVELOG mode.

    10. The recovery catalog can be backed up using any appropiate backup
    scenario like, export command, cold or hot backup strategy.

    Export :
    $ exp rman/rman@rcat1 file = RCAT1_backup.dmp owner=rman

    Oracle recommends for Oracle9i :
    – Run the recovery catalog database in ARCHIVELOG mode so that you
    can do point-in-time recovery is needed.
    – Set the retention policy to a REDUNDANCY value greater than 1.
    – Back up the database onto two separate media (for example, disk and tape).
    You can specify BACKUP COPIES 2 when making backups.
    – Run BACKUP DATABASE PLUS ARCHIVELOG at regular intervals, to a media
    manager if available or just to disk.
    – Do not use another recovery catalog as the repository for the backups.
    – Configure the control file autobackup feature to ON.

    11. 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

    12. Prior to Oracle9i, 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
    SVRMGR> connect internal
    SVRMGR> shutdown
    SVRMGR> 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

    Start the instances again .
    $ svrmgrl connect internal
    SVRMGR> startup
    SVRMGR> exit

    13. Now the database has been configured to use the Netbackup API
    library for backing up.

    14. 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.

    15. 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 the Oracle backups
    are stored in.
    Clients : Specify the client names and their Hardware and OS
    version ( e.g. : Solaris / Solaris 2.6 )
    Schedules : Specify 2 schedules. By default a backup policy is
    created.
    – Backup type : Oracle
    – Schedule type : backup policy
    – Retention period , Frequency and times
    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_db_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

    16. 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_db_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.ora

    2. To see a database schema:

    RMAN> report schema;

    3. To copy a Datafile to say another disk.

    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 all 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@PROD1 catalog rman/rman@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 is 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 headers must match the
    corresponding SCNs in the datafile records in the control file,
    and the datafiles must not be fuzzy..
    This backup can be restored without recovery.

    6. Inconsistent -> The backup of the database when it is open, when it crashed
    lasttime, when it was mounted or after a shutdown abort
    before backup. It requires a database recovery.

    Reference
    =========
    Oracle8i backup and recovery guide
    Netbackup 3.2 Administrator’s guide
    Netbackup 3.2 media manager’s guide
    Netbackup for Oracle installation guide
    Note.209117.1 : How to Install, Configure, Check and Troubleshoot
    VERITAS NetBackup 4.5 for Oracle
    Additional Keywords
    ===================
    Solaris; Configure Netbackup; VOS

  3. admin says

    How to determine which media an RMAN backup used in Netbackup
    Description
    When an RMAN backup is started, RMAN creates a file called Piece Name and sends this to Netbackup. This document will show how to figure out which media was used to backup the piece name.

    Steps to Follow
    When a backup from RMAN is executed, RMAN gathers the data that is to be backed up and creates an image that is called Piece name . RMAN then sends the Piece name to NBU (Netbackup) to backup to media.
    RMAN doesn’t know which media is used for the backup and Netbackup doesn’t have information about what is contained in the Piece Name.

    You can list the piece names from RMAN by connecting to RMAN and running list backup

    For example:

    RMAN> list backup;

    using target database controlfile instead of recovery catalog

    List of Backup Sets

    ===================

    BS Key Type LV Size Device Type Elapsed Time Completion Time

    ——- —- — ———- ———– ———— —————

    31 Incr 0 303M SBT_TAPE 00:10:18 04-APR-05

    BP Key: 31 Status: AVAILABLE Tag: TAG20050404T113238

    Piece Name: bk_u11gh102m_s33_p1_t554729558

    SPFILE Included: Modification time: 16-FEB-05

    List of Datafiles in backup set 31

    File LV Type Ckp SCN Ckp Time Name

    —- — —- ———- ——— —-

    1 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/SYSTEM01.DBF

    2 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/UNDOTBS01.DBF

    3 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/CONFIG01.DBF

    4 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/CONFIG_IDX01.DBF

    5 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/CURRENTDATA01.DBF

    6 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/CURRENTDATA_IDX01.DBF

    7 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/HISTORY01.DBF

    8 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/HISTORY_IDX01.DBF

    9 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/INDX01.DBF

    10 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/STATISTICS01.DBF

    11 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/TOOLS01.DBF

    12 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/USERS01.DBF

    13 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/FSRMDATATBS01.DBF

    14 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/FSRMINDXTBS01.DBF

    15 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/MVWDATATBS01.DBF

    16 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/MVWINDXTBS01.DBF

    17 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/OIQDATATBS01.DBF

    18 0 Incr 1901661 04-APR-05 /opt/oracle/product/9.2.0.1.0/oradata/APPIQ/OIQINDXTBS01.DBF

    BS Key Size Device Type Elapsed Time Completion Time

    ——- ———- ———– ———— —————

    32 76M SBT_TAPE 00:00:42 04-APR-05

    BP Key: 32 Status: AVAILABLE Tag: TAG20050404T114309

    Piece Name: arch-s34-p1-t554730189

    List of Archived Logs in backup set 32

    Thrd Seq Low SCN Low Time Next SCN Next Time

    —- ——- ———- ——— ———- ———

    1 28 1793753 02-APR-05 1901874 04-APR-05

    1 29 1901874 04-APR-05 1901877 04-APR-05

    BS Key Type LV Size Device Type Elapsed Time Completion Time

    ——- —- — ———- ———– ———— —————

    33 Full 1M SBT_TAPE 00:00:45 04-APR-05

    BP Key: 33 Status: AVAILABLE Tag: TAG20050404T114356

    Piece Name: bk_u13gh10ns_s35_p1_t554730236

    Controlfile Included: Ckp SCN: 1901892 Ckp time: 04-APR-05

    RMAN>

    From the output above we can see that there are 3 Piece Names:

    – Piece Name: bk_u11gh102m_s33_p1_t554729558

    – Piece Name: arch-s34-p1-t554730189

    – Piece Name: bk_u13gh10ns_s35_p1_t554730236

    Now from the NBU server you can list all Oracle backups for the client that you are interested in. From the output of bpfilst you can match up the Piece Name with the backup id.

    The Piece Name is listed under Files in the bpflist output and looks like

    P=/bk_u13gh10ns_s35_p1_t554730236

    In the following example, snowmass is the NBU server, pts-440 is the client and -pt is the policy type which is Oracle:

    # ./bpflist -U -M snowmass -client pts-440 -pt Oracle

    Client: pts-440

    Policy: PTS-440_Oracle

    Backup ID: pts-440_1112629058

    Backed up: Mon Apr 04 2005 11:37:38 (1112629058)

    Software Version:

    Policy Type: Oracle

    Schedule Type: UBAK

    Version: 7

    Keyword: APPIQ

    Num Files: 1

    Files:

    FN=1 L=1835008 PL=31 DL=127 BK=0 II=1 RS=0 GB=0 DN=-1
    P=/bk_u13gh10ns_s35_p1_t554730236
    D=33152 oracle oracle 1835008 1112629464 1112629464 1112629464 1 0 0 15 13 0 0 3 1112629440 1 4 Oracle Database Oracle Backup

    Client: pts-440

    Policy: PTS-440_Oracle

    Backup ID: pts-440_1112629009

    Backed up: Mon Apr 04 2005
    11:36:49 (1112629009)

    Software Version:

    Policy Type: Oracle

    Schedule Type: UBAK

    Version: 7

    Keyword: APPIQ

    Num Files: 1

    Files:

    FN=1 L=80740352 PL=23 DL=128 BK=0 II=1 RS=0 GB=0 DN=-1 P=/arch-s34-p1-t554730189 D=33152 oracle oracle 80740352 1112629420 1112629420 1112629420 1 0 0 15 13 0 0 3 1112629393 1 4 Oracle Database Oracle Backup

    Client: pts-440

    Policy: PTS-440_Oracle

    Backup ID: pts-440_1112628668

    Backed up: Mon Apr 04 2005 11:31:08 (1112628668)

    Software Version:

    Policy Type: Oracle

    Schedule Type: UBAK

    Version: 7

    Keyword: APPIQ

    Num Files: 1

    Files:

    FN=1 L=318242816 PL=31 DL=129 BK=0 II=1 RS=0 GB=0 DN=-1 P=/bk_u11gh102m_s33_p1_t554729558 D=33152 oracle oracle 318242816 1112629359 1112629359 1112629359 1 0 0 15 13 0 0 3 1112628760 1 4 Oracle Database Oracle Backup

    To get the media id for the backup, run the following command using the dates from the list backup output:

    # ./bpimmedia -L -client pts-440
    -d 04/04/2005 -e 04/04/2005

    Backup-ID Policy Type RL Files C E T PC Expires

    Copy Frag KB Type Density FNum Off Host DWO MPX Expires RL MediaID

    ————————————————————————————————

    pts-440_1112629058 PTS-440_Or UBAK 3 1 N N R 1 11:37 05/05/2005

    1 1 1824 RMed hcart 3 6096 snowmass 0 N 11:37 05/05/2005 3
    EFP781

    pts-440_1112629009 PTS-440_Or UBAK 3 1 N N R 1 11:36 05/05/2005

    1 1 78880 RMed hcart 2 4861 snowmass 0 N 11:36 05/05/2005 3
    EFP781

    pts-440_1112628668 PTS-440_Or UBAK 3 1 N N R 1 11:31 05/05/2005

    1 1 310816 RMed hcart 1 2 snowmass 0 N 11:31 05/05/2005 3
    EFP781

    #

    The media id that was used for the 3 Oracle backups is EFP781.

  4. admin says

    How to Install, Configure, Check and Troubleshoot VERITAS NetBackup 4.5 for Oracle

    PURPOSE

    The purpose of this document is to act as a ‘quick start’ guide for
    Installing, Configuring, Checking and Troubleshooting VERITAS NetBackup
    for Oracle and its integration with Oracle RMAN.

    SCOPE & APPLICATION

    This document is aimed at Support Personnel. It is not intended as a
    replacement for detailed VERITAS NetBackup or RMAN documentation. For
    specific information about the NetBackup server software, refer to:
    – NetBackup System Administrator’s Guide – UNIX

    Related Documents:

    The following documents provide related information. For a more detailed
    listing of NetBackup documents, refer to NetBackup Release Notes.
    For a UNIX server, refer to these documents:
    – NetBackup 4.5 for Oracle System Administrator’s Guide for UNIX
    How to install, configure and manage NetBackup for Oracle on a
    UNIX system.
    – NetBackup System Administrator’s Guide for UNIX
    How to configure and manage NetBackup on a UNIX system.
    – NetBackup Media Manager System Administrator’s Guide for UNIX
    Explains how to configure and manage the storage devices and media on
    UNIX NetBackup servers. Media Manager is part of NetBackup.
    – NetBackup Troubleshooting Guide – UNIX
    Provides troubleshooting information for UNIX-based NetBackup
    products. You can also refer to http://www.support.veritas.com, access the
    Knowledge Base Search option and search for TechNotes.

    1. Introduction
    ===============

    How Does NetBackup for Oracle on UNIX Work?

    For a backup:
    1. The rman command starts the requested operation on the databases.
    2. When the process requires media to store backup data, RMAN starts a
    user-directed backup by issuing a backup request.
    3. The NetBackup master server connects to NetBackup for Oracle on UNIX on
    the client and transfers the database data to secondary storage. A
    restore works in essentially the same manner except that RMAN issues a
    restore request. This causes NetBackup to retrieve the data from
    secondary storage and send it to NetBackup for Oracle on UNIX on the
    client.

    Since the Oracle Recovery Manager supports parallel operations, a single
    rman execution can start more than one backup or restore on the
    NetBackup system.

    2. Installation
    ===============

    NOTE: To determine which Oracle version levels are supported, refer to the
    Database Agent Platform Support section in the NetBackup Release Notes.

    Installation Prerequisites
    ————————–
    Before installing NetBackup for Oracle on UNIX, be sure you have completed the
    installation of the NetBackup server software on the server.

    Note: For HP and Solaris clients, the NetBackup for Oracle installation package
    includes three different NetBackup for Oracle database agents. This
    combination is for installation purposes only. Each NetBackup for Oracle
    database agent will continue to function with no dependencies on the other
    agents. See the release notes for further explanation.

    Installing NetBackup for Oracle on UNIX
    There are two ways to install database agent software.
    – Remote Installation
    Loads the software on a master server.
    The user will then push the database software out to affected clients. Refer
    to the Netbackup Installation Guide.
    – Local Installation
    Loads and installs the software only to the local machine.

    Local Installation of NetBackup for Oracle on UNIX
    ————————————————–
    During a local installation, the NetBackup for Oracle on UNIX files are extracted
    and installed. The local machine can be a client or a master server that also
    happens to be a client.

    Installation Requirements
    ————————-
    – The version of the NetBackup Client and the version of NetBackup for Oracle on
    UNIX are the same (e.g., 4.5).
    – The local machine must have adequate disk space.
    – Less than one megabyte of additional disk space is required in the
    install_path/netbackup directory. However, more disk space may be necessary at
    run time.
    – NetBackup version 4.5 client software is installed and operational.
    This also means that the install_path/netbackup directory already exists.

    Local Install Procedure
    ———————–
    1. Log in as the root user on the machine.
    % su – root
    – If the local machine is a client, go to step 3.
    – If the local machine is a server, go to step 2.
    2. Make sure a valid license key for NetBackup for Oracle on UNIX has been
    registered.
    To view or add license keys, perform one of the following:
    – Run the command install_path/netbackup/bin/admincmd/get_license_key.
    – Open the NetBackup Administration Console and from the Help menu choose
    License Keys.
    3. Insert the CD-ROM into the drive.
    4. Change the working directory to the CD-ROM directory.
    % cd /CD_mount_point
    5. Load and install the software by executing the install script.
    Note: It is expected that the NetBackup version level (for example, 4.5) running
    on the local machine matches the version level of the database agent being installed.
    % ./install
    a) Select the NetBackup Database Agent Software option.
    The following prompt will appear:
    Do you want to do a local installation? (y/n) [n]
    b) Answer y.
    You are presented with a menu of all database agents available on the CD-ROM.
    c) Select the NetBackup for Oracle+ option.
    d) Enter q to quit selecting options.
    A prompt will appear asking if the list is correct.
    e) Answer y.

    If installation has successfully completed, there will be a version file in directory
    install_path/netbackup/ext/ that contains the version of NetBackup for Oracle on UNIX
    that was installed and an installation timestamp.

    Install Oracle8 Recovery Manager
    ——————————–
    To configure the Oracle8 Recovery Manager, refer to the Oracle8 Server Backup and
    Recovery Guide.
    Linking RMAN with a library provided by NetBackup for Oracle on UNIX is the only
    NetBackup requirement. Before writing to sequential devices such as tape, you must
    link the Oracle8 Server software with the media management API library installed by
    NetBackup for Oracle on UNIX. Oracle uses this library when it needs to write to,
    or read from devices supported by Media Manager.

    The default location for the NetBackup API library is /install_path/netbackup/bin,
    while its name is:
    – libobk.so on NCR, SGI, Sequent, Linux, and Data General
    – libobk.so.1 on Solaris, Tru64 and Digital UNIX (32-bit)
    – libobk.so64.1 on Solaris (64-bit)
    – libobk.sl on HP-UX (32-bit)
    – libobk.sl64 on HP-UX (64-bit)
    – libobk.a on AIX
    – libobk.a64 on AIX (64-bit)
    – libobk.so64 on SGI (64-bit)

    Linking Oracle8 with NetBackup for Oracle on UNIX
    ————————————————-
    This section documents the preferred way to link Oracle with the NetBackup API library.
    The linking process is not consistent across hardware platforms and Oracle Server
    release levels and on some platforms, it is not consistent across OS levels. For this
    writing, it was not possible to include all of the supported platform, OS level, and
    Oracle Server level combinations. However, OS levels are specified when known differences
    occur. Runtime problems may occur if these linking instructions are not followed.

    To link Oracle8 with NetBackup for Oracle on UNIX
    1. Become the Oracle user.
    % su – oracle
    2. Shutdown all of the Oracle instances (SIDs). The following example is for Oracle8i.
    svrmgrl
    SVRMGR> connect internal
    shutdown
    exit
    Change the ORACLE_SID environment variable to any other SID that uses this Oracle
    installation and repeat above commands.
    3. Set up automatic or manual linking.

    a) Automatic Linking
    Run the oracle_link script located in install_path/netbackup/bin/
    This script determines the Oracle version level and then links Oracle to NetBackup
    accordingly. All output from this script will be captured in a /tmp/make_trace.pid file.
    To change the trace file location, change the MAKE_TRACE variable in the oracle_link script.

    b) Manual Linking
    Make a copy of the existing Oracle executable.
    % cd ${ORACLE_HOME}/bin
    % cp oracle oracle.orig

    Starting with version 8.0.4, Oracle is shipped with default media management software.
    To disable this media management software you must remove or rename the libobk file from
    ${ORACLE_HOME}/lib. It may be a file or a symbolic link. To satisfy this and other linking
    requirements, follow the instructions below for your specific platform and version of Oracle.

    On (32-bit or 64-bit) Solaris using 32-bit Oracle software.
    a. Create a symbolic link from Oracle to the NetBackup API library

    Oracle8 Release 8.0.3, 8.0.4, 8.0.5, 8.0.5.1, and 8.0.6 and
    Oracle8i Release 8.1.5 and 8.1.7
    $ cd ${ORACLE_HOME}/lib
    $ ls -l libobk.so
    If libobk.so exists.
    $ mv libobk.so libobk.so.orig
    $ ln -s /install_path/netbackup/bin/libobk.so.1 libobk.so

    Oracle8i Release 8.1.6
    $ cd ${ORACLE_HOME}/lib
    $ ls -l libdsbtsh8.so
    $ If libdsbtsh8.so exists.
    $ mv libdsbtsh8.so libdsbtsh8.so.orig
    $ ln -s /install_path/netbackup/bin/libobk.so.1 libdsbtsh8.so

    Oracle8i Release 8.1.5, 8.1.6, and 8.1.7
    This is the only required step. You no longer have to make a new Oracle
    executable to use the NetBackup for Oracle API library. With Oracle 8i, the Oracle
    executable always looks for the shared library: ${ORACLE_HOME}/lib/libobk.so.

    b. Make a new Oracle executable
    $ cd ${ORACLE_HOME}/rdbms/lib

    Oracle8 Release 8.0.3, 8.0.4, 8.0.5, 8.0.5.1, and 8.0.6
    $ make -f ins_rdbms.mk ioracle

    Procedure to verify library is linked, VERITAS path should be first one.
    $ ldd $ORACLE_HOME/bin/oracle
    libobk.so => /install_path/netbackup/bin/libobk.so
    libnsl.so.1 => /usr/lib/libnsl.so.1
    libsocket.so.1 => /usr/lib/libsocket.so.1
    libdl.so.1 => /usr/lib/libdl.so.1
    libc.so.1 => /usr/lib/libc.so.1
    libaio.so.1 => /usr/lib/libaio.so.1
    libm.so.1 => /usr/lib/libm.so.1
    libmp.so.2 => /usr/lib/libmp.so.2

    On 64-bit Solaris using 64-bit Oracle software
    Use the same procedure as with 32 bits software but
    change the directory `lib’ to `lib64′

    Install Oracle9i Recovery Manager
    ———————————
    To configure the Oracle9i Recovery Manager, refer to the Oracle9i Server Backup
    and Recovery Guide.
    Linking RMAN with a library provided by NetBackup for Oracle on UNIX is the only
    NetBackup requirement. Before writing to sequential devices such as tape, you must
    link the Oracle9i Server software with the media management API library installed
    by NetBackup for Oracle on UNIX. Oracle uses this library when it needs to write to,
    or read from devices supported by Media Manager.

    The default location for the NetBackup API library is /usr/openv/netbackup/bin; while
    its name is:
    – libobk.a64 on AIX (64-bit)
    – libobk.so on NCR, SGI, Sequent, Linux, and Data General
    – libobk.so.1 on Solaris, Tru64 and Digital UNIX (32-bit)
    – libobk.so64.1 on Solaris (64-bit)
    – libobk.sl on HP-UX (32-bit)
    – libobk.sl64 on HP-UX (64-bit)
    – libobk.a on AIX
    – libobk.so64 on SGI (64-bit)

    Linking Oracle9i with NetBackup for Oracle on UNIX
    ————————————————–
    This section documents the preferred way to link Oracle with the NetBackup API library.
    The linking process is not consistent across hardware platforms and Oracle Server release
    levels and on some platforms, it is not consistent across OS levels. For this writing, it was
    not possible to include all of the supported platform, OS level, and Oracle Server level
    combinations. However, OS levels are specified when known differences occur.
    Runtime problems may occur if these linking instructions are not followed.

    To link Oracle9i with NetBackup for Oracle on UNIX
    1. Become the Oracle user.
    $ su – oracle
    2. Shutdown all of the Oracle instances (SIDs).
    $ sqlplus /nolog
    SQL> connect sys/change_on_install as sysdba (login/password)
    shutdown
    exit
    Change then ORACLE_SID environment variable to any other SID that uses this
    Oracle installation and repeat above commands.
    3. Set up automatic or manual linking.

    – Automatic Linking
    See Oracle8/8i
    – Manual Linking
    Starting with version 8.0.4, Oracle is shipped with default media management
    software. To disable this media management software you must remove or
    rename the libobk file from ${ORACLE_HOME}/lib. It may be a file or a symbolic
    link. To satisfy this and other linking requirements, follow the instructions below
    for your specific platform and version of Oracle.

    Solaris (32-bit or 64-bit) using 32-bit Oracle software.
    a. Create a symbolic link from Oracle to the NetBackup API library
    $ cd ${ORACLE_HOME}/lib
    $ ls -l libobk.so
    $ If libobk.so exists.
    $ mv libobk.so libobk.so.orig
    $ ln -s /usr/openv/netbackup/bin/libobk.so.1 libobk.so

    Solaris 64-bit using 64-bit Oracle software.
    a. Create a symbolic link from Oracle to the NetBackup API library
    $ cd ${ORACLE_HOME}/lib
    $ ls -l libobk.so
    If libobk.so exists.
    $ mv libobk.so libobk.so.orig
    $ ln -s /usr/openv/netbackup/bin/libobk.so64.1 libobk.so

    This is the only required step. You no longer have to make a new Oracle
    executable to use the NetBackup for Oracle API library. With Oracle8i the Oracle
    executable always looks for the shared library: ${ORACLE_HOME}/lib/libobk.so.

    Linking Rollback Procedure
    If you run into problems and are unable to re-link Oracle with NetBackup for
    Oracle on UNIX, you can roll back what you have done by entering the following
    command:
    $ cd $ORACLE_HOME/bin
    $ cp oracle.orig oracle
    $ cd $ORACLE_HOME/lib
    $ mv libobk.so.orig libobk.so
    (or whatever the API library file was originally called).

    Install Oracle Recovery Catalog
    ===============================

    Create a recovery catalog, as detailed in Note:50875.1.
    The recovery catalog schema can be initially sized at 20MB.

    Setup SQLNet Connectivity to Recovery Catalog
    =============================================
    A TCP loopback test to the catalog should be performed.

    % sqlplus rman/rman@catalog
    where the SQL*Net alias for the catalog database is ‘catalog’.

    Setup SQLNet Connectivity to Target Database
    ===============================================
    A user with SYSDBA privileges is required to connect to the target database.

    i. set up remote logins to the target database
    a. add the following to the init.ora:
    remote_login_passwordfile=exclusive
    b. create a password file
    orapwd file=$ORACLE_HOME/dbs/orapw$SID password=oracle
    ii. for the above changes to take affect, stop/start the target instance
    iii. create a user, and grant SYSDBA priveleges
    This step is optional, as the ‘internal’ could be used.
    SVRMGR> create user targdba identified by targdba
    temporary tablespace temp
    default tablespace users quota unlimited on users;
    SVRMGR> grant connect, resource to targdba;
    SVRMGR> grant sysdba to targdba;

    Note, if (i) and (ii) have not succeeded, this step will fail with
    ORA 1994 – GRANT failed: cannot add users to public password file

    iv. Do a loopback test as the SYSDBA user

    % sqlplus targdba/targdba@target
    or
    % sqlplus internal/oracle@target
    where the SQLnet alias for the target database is ‘target’.

    Enable Archiving
    ================
    RMAN catalog and the target database may need to have archiving enabled.
    eg, init.ora changes:
    log_archive_dest = /oracle/OFA_base/app/oracle/admin/V817/arch/arch_
    log_archive_format = t%t_s%s.arc
    log_archive_start = true

    SQL> startup mount
    SQL> alter database archivelog;
    SQL> alter database open;

    Configuration
    =============

    Configuration Using the NetBackup Administration Console for UNIX
    Although the database agent is installed on the NetBackup client, some configuration
    procedures are performed using the NetBackup Administration Console on the server.

    These procedures include:
    – Configuring the Media Manager
    – Setting the Maximum Jobs per Client global attribute
    – Configuring a NetBackup policy
    – Testing NetBackup for Oracle on UNIX configuration settings
    See the next section for instructions on starting the NetBackup Administration Console.

    To launch the NetBackup Administration Console for UNIX
    1. Log onto the UNIX server as root.
    2. Start the NetBackup Administration Console.
    $ install_path/netbackup/bin/jnbSA &
    The Login dialog box appears.
    3. Type the name of the master server where you initially want to manage NetBackup.
    You can specify any NetBackup master server. Indicate the User and Password.
    4. Click Login. The NetBackup Administration Console appears.

    Configuring the Media Manager
    —————————–
    Use the Media Manager to configure tapes or other storage units for a NetBackup for
    Oracle configuration.
    The number of volumes required will depend on the devices used, the size of the Oracle
    databases that you are backing up, and the frequency of backups.

    Setting the Maximum Jobs per Client Global Attribute
    —————————————————-
    The Maximum jobs per client attribute value is figured with the following formula.
    Max Jobs per Client = Number of Streams x Number of Policies
    Where:
    Number of Streams: Is the number of backup streams between the database server and
    NetBackup. Each separate stream starts a new backup job on the client.
    Number of Policies: Is the number of policies that may back up this client at the same time.
    This number can be greater than one. For example, a client may be in two
    policies in order to back up two different databases. These backup windows
    may overlap.

    For Oracle backups and restores, the number of jobs is hard to determine, as Oracle internally
    determines when and how many streams to run in parallel to optimize performance.To avoid any
    problems, we recommend that you enter a value of 99 for the Maximum jobs per client global attribute.

    – To set the Maximum jobs per client attribute on a UNIX server
    Use this procedure to set the Maximum jobs per client global attribute using the
    NetBackup Administration Console – Java interface on a Java-capable platform.
    1. In the left pane of the NetBackup Administration Console, expand Host Properties
    and select Master Servers.
    2. In the right pane, double-click on the server icon.
    Click Global Attributes.
    The Master Server Properties dialog box appears.
    The default value is 1 for Maximum jobs per client.
    3. Change the Maximum jobs per client value to a value equal to the maximum number
    of backups allowed per client.
    Tip: To avoid any problems, we recommend that you enter a value of 99 for
    the Maximum jobs per client global attribute.

    Configuring a NetBackup Policy
    ——————————
    A NetBackup policy defines the backup criteria for a specific group of one or more clients.
    These criteria include:
    – storage unit and media to use
    – backup schedules
    – backup templates or script files to be executed on the clients
    – clients to be backed up

    To use NetBackup for Oracle on UNIX, at least one Oracle policy with the appropriate
    schedules needs to be defined. A configuration can have a single policy that includes
    all clients or there can be many policies, some of which include only one client. Most
    requirements for Oracle policies are the same as for file system backups. In addition
    to the attributes described here, there are other attributes for a policy to consider.
    Refer to the NetBackup System Administrator’s Guide for detailed configuration instructions
    and information on all the attributes available.

    Adding New Policies
    ——————-
    Use this procedure when configuring a policy from a UNIX server.
    – To add a new policy
    1. Log onto the server as root.
    2. Start the NetBackup Administration Console.
    3. If your site has more than one master server, choose the one to which you want
    to add the policy.
    4. In the left pane, click on Policies. The right pane splits into a All Policies
    pane and a details pane.
    5. In the All Policies pane, right-click on the Master Server, and click New.

    The Add a New Policy dialog box appears.
    a. In the Policy name box, type a unique name for the new policy.
    b. Choose whether to use the wizard for configuring the policy.
    The wizard guides you through the setup process and simplifies it by automatically
    choosing default values that are good for most configurations. If necessary, you can
    change the defaults later by editing the policy.
    – To use the wizard, select the Use add policy wizard box and click OK. The wizard
    starts and you create the policy by following the prompts. When prompted, select
    the Oracle policy type.
    – If you require more control over the settings than the wizard provides, do not
    select the Use add policy wizard box and proceed to step 6.
    6. Click OK.
    A dialog box appears in which you can specify the general attributes for the policy.
    7. From the Policy type box, select the Oracle policy type.
    8. Complete the entries on the Attributes tab as explained in “Description of Attributes”
    and click Apply to save the attribute entries.
    9. Add other policy information:
    To add schedules, see “Adding New Schedules.”
    To add templates or shell scripts, see “Specifying the List of Scripts.”
    To add clients, see “Adding Clients to a Policy.”

    Adding New Schedules
    ——————–

    Each policy has its own set of schedules. These schedules control initiation
    of automatic backups and also specify when user operations can be initiated.
    A Oracle backup requires at least two specific schedule types: an Application
    Backup schedule and an Automatic Backup schedule. You can also create additional
    schedules. The following procedures explain how to configure the required schedule
    types, and how to add other new schedules.

    To configure an Application Backup schedule
    ——————————————-
    1. Under the policy name, select Schedules.
    2. In the right pane, double-click on the schedule named Default-Application-Backup.
    A dialog box appears. The title bar shows the name of the policy to
    which you are adding the schedule.

    All Oracle database operations are performed through NetBackup for Oracle on
    UNIX using an Application Backup schedule. This includes those backups started
    automatically. You must configure an Application Backup schedule for each Oracle
    policy you create. If you do not do this, you will not be able to perform a backup.
    To help satisfy this requirement, an Application Backup schedule named
    Default-Application-Backup is automatically created when you configure a new
    Oracle policy.
    3. Specify the other properties for the schedule as explained in “Schedule Properties.”
    The backup window for an Application Backup schedule must encompass the time period
    during which all NetBackup jobs, scheduled and unscheduled, will occur. This is
    necessary because the Application Backup schedule starts processes that are required
    for all NetBackup for Oracle on UNIX backups, including those started automatically.

    For example, assume that you:
    – expect users to perform NetBackup operations during business hours, 0800 to 1300.
    – configured automatic backups to start between 1800 and 2200.
    The Application Backup schedule must have a start time of 0800 and a duration of 14 hours.

    Tip: Set the time period for the Application Backup schedule for 24 hours per day,
    seven days per week. This will ensure that your NetBackup for Oracle on UNIX
    operations are never locked out due to the Application Backup schedule.

    To configure an automatic backup schedule
    —————————————–
    1. In the All Policies pane, expand the policy you wish to configure. Right-click
    Schedules and choose New.
    A dialog box appears. The title bar shows the name of the policy to which you are
    adding the schedules.
    2. Specify a unique name for the schedule.
    3. Select the Type of Backup.
    For information on the types of backups available for this policy, see “Types of
    Backups.”
    4. Specify the other properties for the schedule as explained in “Schedule Properties.”
    When a schedule is executed, NetBackup sets environment variables based on which
    type of automatic backup schedule is selected. These environment variables can then
    be used to conditionally start a backup.
    To add other schedules, repeat step 1 through step 4.

    Schedule Properties
    ——————-
    Some of the schedule properties have a different meaning for database backups than for
    a regular file system backup. These properties are explained below. Other schedule
    properties will vary according to your specific backup strategy and system configuration.
    Consult the NetBackup System Administrator’s Guide for detailed explanations of the
    schedule properties.

    Type of backup: Specifies the type of backup that this schedule will control.
    The selection list shows only the backup types that apply to the
    policy you are configuring. For more information see “Types of Backups.”

    Frequency: This setting is used only for scheduled backups, and not for user-directed
    backups. Frequency specifies the period of time that will elapse until the
    next backup operation can begin on this schedule. For example, if the
    frequency is seven days and a successful backup occurs on Wednesday, the
    next full backup will not occur until the following Wednesday. Normally,
    incremental backups will have a shorter frequency than full backups.

    Calendar: This setting is used only for scheduled backups, and not for user-directed
    backups. The Calendar option allows you to schedule backup operations based
    on specific dates, recurring week days, or recurring days of the month.

    Retention: Frequency based scheduling
    The retention period for an Application Backup schedule refers to the length
    of time that NetBackup keeps backup images. The retention period for an
    Automatic Full Backup, Automatic Differential Incremental Backup, or Automatic
    Cumulative Incremental Backup schedule controls how long NetBackup keeps
    records of when scheduled backups have occurred.

    The NetBackup scheduler compares the latest record to the frequency to determine whether
    a backup is due. This means that if you set the retention period to expire the record too
    early, the scheduled backup frequency will be unpredictable. However, if you set the
    retention period to be longer than necessary, the NetBackup catalog will accumulate
    unnecessary records.

    Therefore, set a retention period that is longer than the frequency setting for the
    schedule.
    For example, if the frequency setting is set to one week, set the retention period to be
    more than one week.

    Note Oracle is not notified when NetBackup expires a backup image. You must use Oracle
    RMAN repository maintenance commands to periodically delete expired backup sets
    from the Oracle RMAN repository.

    Calendar based scheduling –
    The retention period for an Application Backup schedule refers to the length of time
    that NetBackup keeps backup images. The retention period for an Automatic Full Backup,
    Automatic Differential Incremental Backup, or Automatic Cumulative Incremental Backup
    schedule controls how long NetBackup keeps records of when scheduled backups have
    occurred. However, this setting is not significant for calendar based scheduling.

    Multiple copies: If you are licensed for the Inline Tape Copy feature and wish to specify
    multiple copies for your Oracle policy, configure Multiple copies on the
    Application Backup schedule.

    Expiration of Backup Files
    ————————–

    NetBackup and Oracle each maintain a repository for backup image information. Currently,
    automatic expiration of backup images from both repositories is not supported. The
    following describes how to expire images and synchronize the NetBackup and the Oracle
    repositories.

    Expiration of Backup Images from the NetBackup Repository Using Retention Level.
    NetBackup automatically controls the expiration of the Oracle backup images from its
    repository using the retention setting in an Application Backup schedule. Use the
    retention setting to specify the length of time before NetBackup expires a backup
    image. Note that the retention setting has a slightly different meaning for an
    Application Backup schedule and an automatic backup schedule. See “Schedule Properties”
    for more details.
    When you use the retention setting to expire backup images, you must perform periodic
    Oracle repository maintenance to remove references to expired backup files.

    Oracle Recovery Manager Repository Maintenance.
    Manually remove references to backup images from the Oracle RMAN repository. Use RMAN
    repository maintenance commands to remove references to backup files. You can use these
    commands to delete backup image information from both the Oracle RMAN repository and
    the NetBackup repository.
    When a request is issued to delete a backup file from the RMAN repository, RMAN sends
    the request to NetBackup for Oracle to delete the corresponding image from the
    NetBackup repository, regardless of the retention level.

    Specifying the List of Scripts
    ——————————
    The File list in a database policy has a different meaning than the File list has for
    other policies. Normally, in a Standard policy, you would list files and directories to
    be backed up. But since you are now configuring a database policy, you will list templates
    or scripts.

    Add templates or scripts only if you are setting up a policy for automatic scheduling. All
    templates or scripts listed in the Files list will be executed for the Automatic Full
    Backup, Automatic Differential Incremental Backup, or Automatic Cumulative Incremental
    Backup schedules as specified under the Schedules tab.
    All templates or scripts specified in the Files list are executed during manual or
    automatic backups. NetBackup will start backups by running the templates or scripts in
    the order that they appear in the Files list.

    To add templates or scripts to the Scripts List
    Caution Be sure to use the correct NetBackup for Oracle template or shell script name
    in the file list to prevent an error or possibly a wrong operation.
    1. In the left pane, click Policies.
    2. In the All Policies pane, expand the policy you want to add the templates or shell
    scripts.
    3. Right-click on Files and choose New.

    The Add File dialog box appears. The title bar shows the name of the policy to which
    you are adding the scripts.
    4. Type the name of the Oracle template or shell script.

    Shell scripts:
    Be sure to specify the full pathname when listing Oracle scripts. For example:
    install_path/netbackup/ext/db_ext/oracle/samples/rman/cold_databas e_backup.sh
    Be sure that the Oracle scripts listed here are installed on each client in the Client
    list.

    Templates:
    Since templates are stored in a known location on the master server, only the template
    filename should be entered. For example:
    weekly_full_backup.tpl
    5. Click Add.
    6. To add more scripts, repeat step 4 and step 5.

    Adding Clients to a Policy
    The client list is the list of clients on which your NetBackup for Oracle on UNIX
    backups will be performed. A NetBackup client must be in at least one policy but can
    be in more than one.

    To add clients to a policy
    1. In the left pane, expand Policies.
    2. In the All Policies pane, expand the policy you wish to configure.
    3. Right-click on Clients and choose New.
    The Add Client dialog box appears. The title bar shows the name of the policy where you
    are adding clients.
    4. In the Client name text box, type the name of the client that you are adding.

    On the client the following should be installed:
    – Oracle
    – NetBackup client or server
    – NetBackup for Oracle on UNIX
    – the backup shell script(s) (unless you are using templates)
    5. Choose the hardware and operating system type and click Add.
    6. If this is the last client, click OK. If you are going to add more clients, repeat
    step 4 and step 5.

    Configuring the Run-Time Environment
    ————————————
    The following is the order of precedence for the run-time configuration variable settings
    (when applicable).
    1. vendor-specific string with send command
    2. parms operand
    3. environment variables
    4. user bp.conf
    5. master bp.conf

    Environment Variables Set Up by NetBackup for Oracle on UNIX
    ————————————————————
    When a schedule executes, NetBackup sets environment variables for templates
    and shell scripts to use when performing a NetBackup operation. These variables
    can be used to perform conditional operations. These variables are set only if
    the backup is started from the server (either automatically by the NetBackup
    scheduler or manually through the administrator interface).

    NB_ORA_SERV: Name of the NetBackup Server.
    NB_ORA_POLICY: Name of the Oracle policy.
    NB_ORA_CLIENT: Name of the NetBackup client that hosts the Oracle database.
    NB_ORA_FULL: Set to 1 if this is an Automatic Full Backup.
    NB_ORA_INCR: Set to 1 if this is an Automatic Differential Incremental Backup.
    NB_ORA_CINC: Set to 1 if this is an Automatic Cumulative Incremental Backup.

    Environment Variables Set Up by User
    ————————————
    Environment variables set by the user will take precedence over those set up by
    NetBackup for Oracle.
    The NetBackup for Oracle on UNIX variables that follow can be set for use in the Oracle
    user environment.

    NB_ORA_SERV: Specifies the name of NetBackup master server.
    NB_ORA_CLIENT: Specifies the name of the Oracle client. It is especially useful for
    redirecting a restore to a different client.
    NB_ORA_POLICY: Specifies the name of the policy to use for the Oracle backup.
    NB_ORA_SCHED: Specifies the name of the Application Backup schedule to use for theOracle backup.

    Oracle RMAN Environment
    ———————–
    The way to set environment variables depends upon the version of Oracle you are using.

    Note: When connecting to a database using a TNS alias, you must use a send command or
    a parms operand to specify environment variables. In other words, when accessing
    a database through a listener, the environment variables set at the system level
    are not visible when RMAN is running.

    Templates:
    ———-
    With templates, NetBackup for Oracle on UNIX environment variables are specified on
    the NetBackup for Oracle Configuration Variables Wizard page.

    Shell scripts:
    ————–
    Use the send command or the parms operand to specify Netbackup for Oracle on
    UNIX environment variables for use during a backup or restore. The send command
    was introduced with Oracle8i. If you are using an Oracle8.0.x version of RMAN you
    must use the parms operand.

    The send command sends a vendor-specific quoted string to NetBackup for Oracle on UNIX.
    For example, the following will specify what policy and server to use for a database backup.

    run {
    allocate channel t1 type ‘sbt_tape’;
    allocate channel t2 type ‘sbt_tape’;

    send ‘NB_ORA_POLICY=your_policy, NB_ORA_SERV=your_server’;

    backup
    (database format ‘bk_%U_%t’);
    }

    Specify the variables in the string in the RMAN script after all channels have been
    allocated and before the backup command.
    The parms operand can also be used to set environment variables at runtime. The
    following example uses the parms operand to specify what policy and server to use
    for a database backup. parms is set with each allocate channel command in the shell script.

    run {
    allocate channel t1 type ‘sbt_tape’
    parms=”ENV=(NB_ORA_POLICY=your_policy, NB_ORA_SERV=your_server)”;
    allocate channel t2 type ‘sbt_tape’
    parms=”ENV=(NB_ORA_POLICY=your_policy, NB_ORA_SERV=your_server)”;

    backup
    (database format ‘bk_%s_%p_%t’);
    }

    For more information on the send command and parms operand of an rman command, see
    the Oracle Server Backup and Recovery Guide.

    Creating a bp.conf File
    ———————–

    A NetBackup for Oracle on UNIX user can create an Oracle client bp.conf file in
    the Oracle user’s home directory on the NetBackup for Oracle on UNIX client host.
    When a NetBackup for Oracle on UNIX operation is started, the user’s bp.conf file
    is searched before the master configuration file (install_path/netbackup/bp.conf) on
    the client. Any option found at the user level takes precedence over the same option
    in the master level configuration.

    The following options can be set in the user’s bp.conf file:
    BPBACKUP_POLICY: The name of the policy to use for the Oracle backup.
    BPBACKUP_SCHED: The name of the Application Backup type of schedule to use
    for the Oracle backup.
    CLIENT_NAME: The name of the Oracle client. It is especially useful for a
    redirected restore operation.
    CLIENT_READ_TIMEOUT: This option specifies the number of seconds the Oracle client will
    initially wait for a response from the NetBackup server. The default
    value is 900.
    SERVER: The name of the NetBackup master server.
    VERBOSE: This option causes NetBackup to include more information in
    its logs. See the NetBackup System Administrator’s Guide – UNIX for
    more details and default values.

    The following shows example bp.conf entries for an Oracle user:
    SERVER=jupiter
    CLIENT_READ_TIMEOUT=1200
    VERBOSE=1

    Creating Templates and Shell Scripts
    ————————————
    RMAN templates and RMAN shell scripts contain commands that are used to
    execute NetBackup for Oracle backup and recovery jobs. Templates and scripts must be
    created before NetBackup for Oracle can perform scheduled backups. These are the
    template files or shell scripts that are specified in policy configuration on the NetBackup
    server.

    Recovery Manager (RMAN)
    =======================

    RMAN Templates and Shell Scripts
    ——————————–

    Templates:
    The NetBackup for Oracle Backup Wizard is used to create backup templates. This wizard
    is initiated from the NetBackup Backup, Archive, and Restore interface. The NetBackup
    for Oracle Backup Wizard does not support all of the RMAN commands and options provided
    by Oracle. A shell script should be written for situations where a template does not
    provide all of the required functionality.

    Shell scripts:
    Shell scripts are written by the user and must conform to RMAN and UNIX shell syntax.
    Sample backup and recovery shell scripts are installed on the client with the NetBackup
    for Oracle agent. Modify these scripts to meet your individual requirements.
    NetBackup for Oracle also provides a utility, bpdbsbora, that can generate a shell
    script from a Backup Wizard template. This allows a user to create a template with the
    Wizard, then generate a shell script from it. The user can then run the shell script,
    or modify the shell script further.

    Storing RMAN Templates and Shell Scripts
    —————————————-

    Templates:
    The NetBackup for Oracle Backup Wizard saves a backup template to a NetBackup specific
    location on the current NetBackup master server. A backup template is retrieved from
    the master server as part of a backup (server-directed, scheduled, or user-directed)
    and is executed on the client. Backup templates are associated with a policy by
    specifying its name in the policy file or script list. Because backup templates are
    stored on the server in a known location, server directed and scheduled backups will
    use the same copy of the template for each client in the policy client list.

    The NetBackup for Oracle Recovery Wizard saves a restore template to a user specified
    location on the client. The location specified should include a fully qualified path
    to a directory where the user has write access.
    Templates store encrypted passwords that are decrypted at runtime.

    Shell scripts:
    RMAN shell scripts must reside on the NetBackup client. Backup shell scripts are
    associated with a policy by specifying the file name (including path) in the policy
    file or script list. This means that for server-directed or scheduled backups, each
    client in the policy’s client list must have a copy of the script with the same name
    in the same location. The backup and recovery processes sometimes require passwords
    for Oracle database access and/or system user accounts. RMAN shell scripts, because a
    Shell interprets them, store passwords in clear text.

    Creating RMAN Templates Using the NetBackup for Oracle Backup Wizard
    ——————————————————————–

    NetBackup for Oracle includes a Backup Wizard that solicits information about desired
    RMAN backup operations. The wizard uses the information to create a template that can be
    run immediately or saved in a NetBackup specific location on the current master server
    for later use.
    Please review your Oracle Backup and Recovery Guide for more information on backup
    strategies and RMAN functionality.

    To start the NetBackup Backup, Archive, and Restore interface, execute:
    % install_path/netbackup/bin/jbpSA &

    Creating RMAN Shell Scripts Using bpdbsbora
    ——————————————-

    bpdbsbora is a NetBackup for Oracle command line utility used to initiate template
    based user-directed backup and recovery. This utility is also used to generate RMAN
    shell scripts from templates created by the Backup Wizard.

    At the command prompt, type:
    % bpdbsbora -backup -g

  5. admin says

    RMAN: Configuring Oracle db Hosts to Backup via a Private Network with NetBackup
    ——————————————————————–
    This article describes a solution that was used to resolve this
    issue for another Oracle customer. As it relates to a third-party
    product, Oracle does not guarantee that this resolution will work
    for all customers using this or any other third-party product. The
    appropriate third-party vendor should be contacted if there are any
    questions or problems relating to this resolution or these errors.
    ——————————————————————–

    Problem Description
    ——————-
    Oracle backups and restores can fail with a NetBackup exit status 5 or 6.
    Regular NetBackUp file system backups and restores work fine.

    Some systems have the requirements for Oracle backups and restores to be
    configured to run out of a designated, private backup network. Regular
    file system backup are configured to run out a different, public network
    interface. You will experience NetBackup exit status code 5 or 6 when trying
    to run hot RMAN scripted backups and restores. Regular file system backups
    and restores work fine. Bprd and bpcd logs indicate the failed backups and
    restores are passing hostnames for the public network, not the private one.
    When the wrong host name is encountered the connection either times out or
    fails to authenticate resulting in failure of the backup or restore.

    Solution Description
    ——————–
    Create a second usr/openv/netbackup/bp.conf file and place this file in the
    {Oracle User’s}/home directory on the NetBackup client hosting the Oracle
    db. This second bp.conf file should contain the host names of the NetBackup
    server(s)’ and client’s private backup network interface, not the public
    network hostnames. Here is a typical example:

    usr/openv/netbackup/bp.conf:

    SERVER = nbumaster
    SERVER = nbumedia
    CLIENT = OracleDBhost_Public

    {Oracle User’s}/home/bp.conf :

    SERVER = nbumaster
    SERVER = nbumedia
    CLIENT = OracleDBhost_Private
    REQUIRED_INTERFACE = OracleDBhost_Private
    CLIENT_READ_TIMEOUT = 3600
    CLIENT_CONNECT_TIMEOUT = 3600
    VERBOSE = 99

    Note that additional parameters that pertain to the backup of the Oracle
    client can be either added or excluded from the {Oracle User’s}/home/bp.conf
    file. For example, CLIENT_READ_TIMEOUT and CLIENT_CONNECT_TIMEOUT variables
    can be added to the Oracle backup only. Modifications to the {Oracle
    User’s}/home/bp.conf file will not effect the configuration of regular file
    system backups.

    Explanation
    ———–
    Force backups to travel down the public network by designating a
    REQUIRED_INTERFACE entry on the NetBackup client’s usr/openv/bp.conf file.
    This workaround avoids the private network entirely but also increases traffic
    on the public network and can impact public network performance.

    Platform:
    ———
    – This issue applies to all UNIX operating systems and is hardware and
    platform independent.

    Products/Versions:
    —————–
    – NetBackup DataCenter 3.4 and 3.4.1
    – All supported Oracle versions using RMAN

  6. admin says

    Improving performance with RMAN and Netbackup
    Applies To
    Oracle Server – Enterprise Edition – Version: 8.1.7.4 to 10.2.0.0
    Information in this document applies to any platform.
    Veritas Netbackup
    Veritas Module for Oracle
    RMAN
    Goal

    Improve RMAN backup and restore performance with Veritas Netbackup. This recommendation is due to file lookup method used by Veritas Netbackup to read and write backups to/from tape.
    Solution

    For performance reasons, NetBackup for Oracle on UNIX strongly recommends
    that an RMAN timestamp be placed at the end of each backup piece name.

    Without this timestamp, there will be performance degradation as the NetBackup catalog grows. To guarantee uniqueness and optimal performance, specify each backup file name as:

    _%U%_%t
    where
    is any user-defined string
    %t specifies the backup set timestamp
    %U specifies a shorthand for %u_%p_%c that guarantees uniqueness in generated file names.

    Other format combinations may be used but the point is to to have %t, the timestamp as the last variable in your backup format.

    NOTE: This only applies to Veritas Netbackup.

  7. admin says

    RMAN Can not Recognize NetBackup Policy then Default

    The information in this article applies to:

    Oracle Server 8i and 9i
    Using RMAN to take backup
    MML Veritas Netbackup

    Symptom(s)
    ~~~~~~~~~~

    You are using more than one policy in your NetBackup configuration and use
    NB_ORA_POLICY parameter in RMAN script to inform NetBackup which policy you want to use,
    but you verify that for any reason NetBackup are not using the correct policy.

    For example:

    run {
    allocate channel t1 type ‘sbt_tape’;

    parms=’ENV=(NB_ORA_POLICY=policy_2, NB_ORA_SERV=your_server)’;

    backup
    format ‘%d_hfb_%s_%p_%t.bkp’
    filesperset 20
    database;
    }

    Cause
    ~~~~~~~

    RMAN parameter NB_ORA_POLICY can not work properly in some case and Netbackup does not
    recognize it.

    Fix
    ~~~~

    Use NB_ORA_SCHED instead of NB_ORA_POLICY. Also you should configurate it in “send” command
    instead of “parms” as the example:

    run {
    allocate channel t1 type ‘sbt_tape’;

    send ‘NB_ORA_SCHED=policy_2, NB_ORA_SERV=your_server’;

    backup
    format ‘%d_hfb_%s_%p_%t.bkp’
    filesperset 20
    database;
    }

  8. admin says

    Use Symantec’S Netbackup “Deduplication” Feature with RMAN
    Applies to:
    Oracle Server – Enterprise Edition – Version: 11.1.0.6 to 11.2.0.0 – Release: 11.1 to 11.2
    Information in this document applies to any platform.
    Purpose
    Determine if Symantec’S Netbackup “Deduplication” Feature can be used with RMAN
    Questions and Answers
    === ODM Question ===
    Backups are using RMAN and Symantec’s Netbackup v6.5. Can Deduplication feature be used in conjunction with RMAN backups?

    === ODM Answer ===
    Deduplication is something that happens at the media manager layer and is transparent to Rman. The media vendor can use deduplication as long as the media api still works with the same sbt calls as specified in the sbt api specs.

  9. admin says

    OS datafile header or Block 2 are CORRUPT when using RMAN / NetBackup
    Applies to:
    Oracle Server – Enterprise Edition – Version: 8.1.7.4 to 10.2.0.3
    This problem can occur on any platform.
    Netbackup, Rman
    Symptoms

    Header block is corrupted for a database file. Corruption has been seen in database file OS block and also in block 2.

    – DBVERIFY produces the next errors when the corruption is in block 2:

    DBVERIFY – Verification starting : FILE = /oracle/oradata/example1.dbf
    Page 2 is marked corrupt
    ***
    Corrupt block relative dba: 0x4e800002 (file 314, block 2)
    Bad header found during dbv:
    Data in bad block –
    type: 50 format: 3 rdba: 0x313a3032
    last change scn: 0x205b.2e343335 seq: 0x31 flg: 0x39
    consistency value in tail: 0x96e50601
    check value in block header: 0x335d, block checksum disabled
    spare1: 0x3a, spare2: 0x34, spare3: 0x203c

    Assuming that the blocksize for that datafile is 8192 (v$datafile.block_size), a Unix dd | od ascii output is:

    $ dd if=/oracle/oradata/example1.dbf bs=8192 skip=2 count=1 | od -c block.out |head -2

    1+0 records in
    1+0 records out

    0000000 2 3 : 4 1 : 0 2 . 4 3 5 [ 1 9
    0000020 3 ] < 4 > :

    Which looks like a timestamp: 23:41:02.435 [193] <4> :

    In another example, if the corrupted block is dumped using the datafile name:

    alter system dump datafile ‘/oracle/oradata/example2.dbf’ block 2;

    the trace file contains something similar to:

    Dump all the blocks in range:
    buffer rdba: 0x353a3536 (212/3814710)
    scn: 0x205b.2e353937 seq: 0x36 flg: 0x36 tail: 0x791a1d02
    frmt: 0x04 chkval: 0x3533 type: 0x31=unknown
    Hex dump of corrupt header 4 = CORRUPT
    Dump of memory from 0x8000000100174800 to 0x8000000100174814
    8000000100174800 31343A30 353A3536 2E353937 205B3636 [14:05:56.597 [66]
    8000000100174810 35335D20 [53] ]

    Note the timestamp value in the block header: 14:05:56.597 [66]

    – RMAN is used with NetBackup. When the block 2 is corrupted, RMAN can produce the errors:

    RMAN-00571: ===========================================================
    RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
    RMAN-00571: ===========================================================
    RMAN-03002: failure of backup command at 06/12/2006 22:54:48
    ORA-19566 : exceeded limit of 0 corrupt blocks for file /oracle/oradata/example4.dbf

    In the alert.log file:

    ***
    Corrupt block relative dba: 0x0ec00002 (file 59, block 2)
    Bad header found during backing up datafile
    Data in bad block –
    type: 49 format: 4 rdba: 0x353a3536
    last change scn: 0x205b.2e353937 seq: 0x36 flg: 0x36
    consistency value in tail: 0x791a1d02
    check value in block header: 0x3533, computed block checksum: 0x31c4
    spare1: 0x3a, spare2: 0x30, spare3: 0x5d20
    ***
    Reread of blocknum=2, file=/oracle/oradata/example4.dbf. found same corrupt data

    – Another error example when block 2 is corrupted can be produced by a select as:

    SQL> select * from dba_data_files;
    ERROR:
    ORA-00600: internal error code, arguments: [kcbgcur_9], [310378498], [13],
    [4294965488], [8192], [], [], []

    dbverify on the file shows errors on block=2 as above and the dd output is:

    dd if=S_ERS_08_D_05.dbf bs=8192 count=1 skip=2 | od -c |head -2
    1+0 records in
    1+0 records out
    0000000 0 1 : 3 5 : 2 7 . 6 0 4 [ 2 7
    0000020 1 7 2 ] < 4 > : 300 \n 004 \0 \0

    The timestamp is here as well.

    – When the corruption is in the datafile OS block header, ORA-27047 can be produced when creating the controlfile. dbverify will not detect this corruption because it does not check this block. dbfsize may produce the next error message:

    $ dbfsize example3.dbf
    example3.dbf: Header block magic number is bad; trying raw file format…
    example3.dbf: Header block magic number is bad

    The corrupted header contains:

    $ dd if=example3.dbf bs=8192 count=1 | od -x | head -2

    0000000 3035 3a30 303a 3036 2e33 3830 205b 3439
    0000020 3438 3138 325d 203c 343e 203a 200a

    The ascii representation of these hexadecimal values is:

    05:00:06.380 [4948182] <4> :

    – When the datafile header block 1 is corrupted , ORA-27048 can be produced by “Create Controlfile”
    Cause
    This type of timestamps is used by Veritas Netbackup tool. Netbackup is corrupting the block in a backup.

    Netbackup is a 3rd party tool provided by Symantec/Veritas and it can be used with rman.

    Netbackp should be reading from Oracle files, but somehow it is writing timestamps into the Oracle file head
    Solution
    To repair this corruption when the affected block is 2, recovery the block using rman BLOCKRECOVER or restore the datafile and recover it.

    Note:144911.1 RMAN 9i: Block-Level Media Recovery – Concept & Example

    To repair this corruption when the affected block is the datafile OS header, a dummy resize of that datafile will solve the corruption:

    alter database datafile ‘/oracle/oradata/example3.dbf’ resize ;

    Note 360032.1 How to detect and fix a corruption in the datafile OS Header

    To prevent this corruption: this issue is known by Symantec/Veritas, and it is fixed beginning with Netbackup client 5.1 MP6 or 4.5 MP9. Open a case with Symantec/Veritas if more information is needed.

Comment

*

沪ICP备14014813号-2

沪公网安备 31010802001379号