利用NBU6.5备份AIX5.3下的ORACLE 10G数据库

声明:此文档仅作参考,如出现任何问题,文档编写者不承担任何责任!水平有限,文中定有错误之处,见谅!编写:老管,email:funpower#gmail.com

NBU服务器端由一台IBM 226服务器及一台昆腾虚拟带库组成,需备份的客户端为安装AIX5.3的IBM小机,备份的对象为ORACLE 10G数据库。

整个备份的拓扑图如下:

环境说明:
1、NBU备份主服务器与昆腾虚拟带库已配置完成
2、次只为增加的一台Oracle数据库服务器安装NBU客户端相关软件并调试,然后在NBU备份主服务器上添加此客户端并建立备份策略等相关调试
3、IP地址(化名):
NBU备份主服务器:10.31.111.111
Oracle数据库服务器:10.31.111.100

操作步骤:

1、配置Oracle数据库服务器的hosts文件

#cd /etc
#vi hosts

添加一行:
10.31.111.111 nbuserver
保存退出。

2、安装NBU clients软件
通过FTP将NBU客户端软件上传至小机的TMP目录下,然后运行:

#cd /tmp
#chmod –R 777 unixclients
#cd unixclients
#./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 RS6000/AIX5 client.
This package will install NetBackup client 6.5.
Enter the name of the NetBackup server : nbuserver       //输入NBU备份主服务器hostname
Would you like to use “oracle1” as the configured
name of the NetBackup client? [y,n] (y)       //输入y,使用原小机的hostsname:oracle1

确认后,就开始安装NBU客户端软件,安装的默认路径为/usr/openv/netbackup。

3、配置和查看bp.conf

#cd /usr/openv/netbackup
#cat bp.conf

SERVER = nbuserver
CLIENT_NAME = oracle1

4、安装database agent
将database agent安装文件上传至上机的/tmp文件夹中,然后:

#cd /tmp
#chmod –R 777 /agents
#./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   //选择2,安装database agent

**********

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      //选择oracle

Choose an option: q       //完成选择操作

You have chosen to install these Database Agents:
        NetBackup for Oracle
Is this list correct? [y,n] (y)        //确定安装oracle agents

5、编辑sh备份脚本
Database agent安装完后,会在/usr/openv/netbackup/ext/db_ext/oracle/samples/rman中有一些例子文件,利用其中的一个,运行:

#cd /usr/openv/netbackup/ext/db_ext/oracle/samples/rman
#cp hot_database_backup.sh hot_database_backup.10.31.111.100.sh

然后使用vi编辑该sh,只需修改如下参数:
ORACLE_HOME=/oracle/product/10G
export ORACLE_HOME
ORACLE_SID=orcl2
export ORACLE_SID
ORACLE_USER=oracle
TARGET_CONNECT_STR=/

完成设置后,保存退出。

6、链接NetBackup for Oracle 和RMAN

#su – oracle
#cd /usr/openv/netbackup/bin
#./oracle_link

Mon Mar 15 11:29:34 BEIST 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     //输入y,开始安装

LIBOBK path: /usr/openv/netbackup/bin
ORACLE_HOME: /oracle/product/10G
Oracle version: 10.2.0.3.0
Linking LIBOBK:
ln -s /usr/openv/netbackup/bin/libobk.a64 /oracle/product/10G/lib/libobk.a
Done

Please check the trace file located in /tmp/make_trace.856304
to make sure the linking process was successful.

出现上面文字后,说明动态链接库已链接成功。

7、NBU备份主服务器设置

首先设置主服务器的hosts文件,将IBM小机的hostname:oracle1添加至hosts中,用记事本打开c:windowssystem32driversetchosts,添加如下:
10.31.111.100 oracle1

打开NBU主界面,开始为10.31.111.100创建一个备份策略

在policies上点右键选择new policy,输入相应策略名称后点击确定

设置attributes选项卡,policy类型选择oracle,policy storage unix选择有效的存储单元

设置Schedules选项卡,点击选项卡下面的New…按扭,新建一个备份日程,选择automatic full backup,全备,frequency选择每星期一次备份,retention选择保留两个星期

备份开始时间为星期日晚上9点开始

设置完后,schedules有两个备份策略,全备和增量备份

设置clients,输入IBM小机的hostname:oracle1,操作系统选择RS6000/AIX5

设置backup selections,将上面新建并编辑好的.sh备份脚本输入至对话框中,点击确定后,完成策略的新建

开始测试备份,在新建的policies的10.31.111.100上点右键选择Manual Backup…,手动启动备份
 

转至Activity Monitor,查看备份情况

至此,IBM小机上的ORACLE已经可以定期的备份至昆腾虚拟磁带库中。

2 Comments

  1. leo说道:

    好文!!!!

Leave a Reply