NBU 备份系统 操作手册 目录 第 1 章 维护 ............................................. 1.1 NBU中添加环境变量的方法 ................................................. 1.2 NBU服务自启动、停止脚本位置 1.3 NBU启动、关闭的方法 1.4 日常维护健康检查的内容和示例运行结果 ............................................ .................................................... . ................................... 第 2 章 安装 ............................................ 2.1 WINDOWS 平台软件安装 .................................................... 8 8 11 12 13 21 21 2.1.1 安装 NBU Master Server .............................................. 21 2.1.2 装 NBU Media Server ................................................. 31 2.1.3 安装 NBU Client ..................................................... 43 2.1.4 安装 NBU补丁 ....................................................... 50 2.2 LINUX/UNIX 平台软件安装 .................................................. 53 2.2.1 安装 Media Server ................................................... 53 2.2.2 安装 Media Server 补丁 .............................................. 56 2.2.3 安装 Client ......................................................... 61 2.2.4 安装 Client 63 补丁 .................................................... 第 3 章 配置 NBU ........................................ 3.1 配置 STORAGEUNIT ......................................................... 3.1.1 新建 storage Unit 3.1.2 storage unit 3.2 67 67 ................................................... 67 属性 .................................................. 67 配置带库 ............................................................... 69 3.2.1 配置设备 ........................................................... 69 3.2.2 配置磁带 ........................................................... 75 配置 DEDUPLICATIONSTORAGEPOOL. ............................................. 78 3.3 3.3.1 建立 storage server 3.3.2 设置存储池 ......................................................... 83 第 4 章 NBU灾难恢复 .................................... 86 ................................................. 78 配置 CATALOG 备份策略 ..................................................... 86 4.1.1 新建 policy ......................................................... 86 4.1.2 修改 Attributes ..................................................... 87 4.1.3 修改 schedule ....................................................... 87 4.1.4 指定 catalog 备份日志存放 ........................................... 88 4.1 4.2 CATALOG的灾难恢复 ....................................................... 90 4.2.1 导入 catalog 备份 ................................................... 90 4.2.2 恢复 catalog 日志文件 ............................................... 90 4.2.3 执行恢复 ........................................................... 91 第 5 章 文件备份与恢复 .................................. 5.1 WINDOWS 系统的文件备份 95 ................................................... 95 5.1.1 打开管理界面 ....................................................... 95 5.1.2 新建策略 ........................................................... 95 5.1.3 attributes 设置 ..................................................... 96 5.1.4 Schedules 设置 ...................................................... 97 5.1.5 client 5.1.6 Backup Seclection 5.2 设置 ........................................................ LINUX/ UNIX系统的文件备份 101 设置 ............................................. 102 . ............................................... 104 5.2.1 打开管理界面 ...................................................... 104 5.2.2 新建策略 .......................................................... 105 5.2.3 attributes 5.2.4 Schedules 设置 ..................................................... 5.2.5 client 5.2.6 Backup Seclection 5.3 属性设置 ............................................... 设置 ........................................................ 设置 ............................................. 文件恢复 .............................................................. 106 107 110 111 113 5.3.1 打开管理界面 ...................................................... 113 5.3.2 选择恢复选项 ...................................................... 113 5.3.3 选择需要恢复的文件 ................................................ 117 第 6 章 ORACLE 备份与恢复 . .............................. 118 6.1 使用模板创建备份脚本 6.2 修改备份脚本 .................................................. .......................................................... 118 118 6.2.1 全库备份脚本 ...................................................... 119 6.2.2 归档备份脚本 ...................................................... 125 6.3 创建 POLICY............................................................. 132 6.3.1 新建 policy ........................................................ 132 6.3.2 修改 Attributes .................................................... 134 6.3.3 修改 schedule ...................................................... 134 6.3.4 指定备份的 Client .................................................. 136 6.3.5 指定备份脚本 ...................................................... 137 6.4 恢复 ORACLE............................................................. 138 6.4.1 本机恢复 .......................................................... 138 6.4.2 异机恢复 .......................................................... 139 6.4.3 图形界面恢复 ...................................................... 142 第 7 章 MS-SQL备份与恢复 . .............................. 146 7.1 确认主机访问 .......................................................... 146 7.2 创建备份脚本 .......................................................... 147 7.2.1 全备份脚本 ........................................................ 147 7.2.2 增量备份脚本 ...................................................... 149 7.3 创建 POLICY............................................................. 150 7.3.1 新建 policy ........................................................ 150 7.3.2 修改 Attributes .................................................... 151 7.3.3 修改 schedule ...................................................... 152 7.3.4 指定备份的 Client .................................................. 154 7.3.5 指定备份脚本 ...................................................... 155 7.4 MS-SQL恢复 ............................................................ 156 7.4.1 创建权限 .......................................................... 156 7.4.2 创建脚本 .......................................................... 156 7.4.3 修改脚本 .......................................................... 158 第 8 章 虚拟机备份与恢复 ............................... 160 8.1 安装 MEDIA SERVER ........................................................ 160 8.2 配置虚拟机备份 173 8.3 虚拟机备份 ............................................................ ........................................................ 177 8.3.1 策略建立 .......................................................... 177 8.3.2 执行备份 .......................................................... 181 虚拟机恢复 ............................................................ 183 第 9 章 系统备份与恢复 ................................. 189 8.4 9.1 建立 BMR主服务器 ...................................................... 189 9.1.1 windows 安装 BMR主服务器 ........................................... 189 9.1.2 Linux/Unix 安装 BMR主服务器 ........................................ 191 9.2 配置资源树 ............................................................ 192 9.2.1 windows 配置 ....................................................... 192 9.2.2 Linux/Unix 配置 .................................................... 203 9.3 配置系统备份策略 ...................................................... 210 9.3.1 新建 policy ........................................................ 210 9.3.2 修改 Attributes .................................................... 211 9.3.3 修改 schedule ...................................................... 211 9.3.4 指定备份的 Client .................................................. 213 9.3.5 指定备份选项 ...................................................... 214 9.3.6 查看备份信息 ...................................................... 214 9.4 系统恢复 .............................................................. 215 9.4.1 windows BMR恢复 ................................................... 215 9.4.2 aix BMR 恢复 ....................................................... 223 9.4.3 linux BMR 恢复 ..................................................... 232 第 10 章 INFORMIX备份与恢复 . ............................ 235 10.1 I NFORMIX配置 ........................................................... 235 10.2 I NFORMIX脚本配置 ....................................................... 235 10.3 策略制定 ............................................................ 237 10.3.1 数据库备份 ...................................................... 237 10.3.2 配置文件备份 .................................................... 241 10.3.3 日志备份 ........................................................ 245 10.4 I NFORMIX恢复 ........................................................... 249 10.4.1 本机恢复 ........................................................ 249 10.4.2 异机恢复 ........................................................ 250 第 11 章 DB2备份与恢复 ................................. 252 11.1 参数设置 ............................................................ 252 11.2 第一种策略 .......................................................... 253 11.3 第二种策略 .......................................................... 261 11.4 第三种策略 .......................................................... 264 11.5 DB恢复 ................................................................ 第 12 章 EXCHANGE 备份与恢复 . ............................ 12.1 配置 NBU客户机服务登陆帐户 12.2 配置 EXCHANGE 备份策略 ................................................. .......................................... 271 272 272 274 12.2.1 全库备份 ........................................................ 274 12.2.2 单邮箱的备份 .................................................... 276 12.2.3 GTR备份 . .......................................................... 278 12.2.4 Exchange 的恢复 . ................................................... 282 第 13 章 LOTUSNOTES 备份 ................................ 292 13.1 WINDOWS 环境变量设置 13.2 UNIX&LINUX环境变量设置 .................................................... ................................................. 13.3 . ........................................................................ 292 293 293 第1章 维护 对于一个关键业务系统而言, 能失效, 存储介质的老化损坏, 数据资料是整个系统运作的核心。 人为的错误操作, 以及各种难以预料的外界因素导致数据意 外丢失或损坏, 那么将会对于企业业务运做造成无法估量的影响。 的完整性和可靠性以及整体的运行状况给与高度重视, 1.1 NBU中添加环境变量的方法 A. Unix 系统 修改 /etc/profile 文件,添加: PATH=$PATH:/usr/openv/netbackup/bin PATH=$PATH:/usr/openv/netbackup/bin/admincmd PATH=$PATH:/usr/openv/netbackup/bin/goodies PATH=$PATH:/usr/openv/volmgr/bin export PATH MANPATH=$MANPATH,/usr/openv/man export MANPATH B. Linux 系统 修改 /etc/.bash_profile ,添加 PATH=$PATH:/usr/openv/netbackup/bin PATH=$PATH:/usr/openv/netbackup/bin/admincmd PATH=$PATH:/usr/openv/netbackup/bin/goodies PATH=$PATH:/usr/openv/volmgr/bin export PATH MANPATH=$MANPATH,/usr/openv/man C. Windows 系统 点击打开控制面板中系统选项, 所以必须对数据存储系统 并根据整体的检查结果, 善的调整和优化建议,以避免在各种极端情况下造成的重大损失。 export MANPATH 一旦由于系统硬件的功 提供一个完 点击选择高级中环境变量选项, 其中选择添加系统变量,按照 NBU 安装路径设置,如下图示例 选择修改系统变量中其中的路径内容如下: ;%NETBACKUP%/bin; %NETBACKUP%/bin/admincmd; %NETBACKUP%/bin/goodies 1.2 NBU服务自启动、停止脚本位置 D. AIX /etc/rc.netbackup.aix /etc/rc.client.netbackup E. Alpha Tru64 /sbin/rc3.d/S77netbackup /sbin/rc0.d/K01netbackup /sbin/init.d/netbackup F. HP-UX /sbin/rc2.d/S777netbackup /sbin/rc1.d/K001netbackup /sbin/init.d/netbackup /sbin/rc1.d/K001nbclient /sbin/rc2.d/S951nbclient /sbin/init.d/nbclient G. Linux Red Hat /etc/rc.d/init.d/netbackup /etc/rc.d/rc0.d/K01netbackup /etc/rc.d/rc1.d/K01netbackup /etc/rc.d/rc2.d/S77netbackup /etc/rc.d/rc3.d/S77netbackup /etc/rc.d/rc5.d/S77netbackup /etc/rc.d/rc6.d/K01netbackup /etc/rc.d/init.d/nbclient /etc/rc.d/rc0.d/K01nbclient /etc/rc.d/rc1.d/K01nbclient /etc/rc.d/rc2.d/S95nbclient /etc/rc.d/rc3.d/S95nbclient /etc/rc.d/rc5.d/S95nbclient /etc/rc.d/rc6.d/K01nbclient H. Linux SuSE /etc/init.d/netbackup /etc/init.d/rc0.d/K01netbackup /etc/init.d/rc2.d/S77netbackup /etc/init.d/rc3.d/S77netbackup /etc/init.d/rc5.d/S77netbackup /etc/init.d/rc6.d/K01netbackup /etc/init.d/nbclient /etc/init.d/rc0.d/K01nbclient /etc/init.d/rc2.d/S95nbclient /etc/init.d/rc3.d/S95nbclient /etc/init.d/rc5.d/S95nbclient /etc/init.d/rc6.d/K01nbclient I. Other 操作系统 /etc/rc2.d/S77netbackup /etc/rc1.d/K01netbackup /etc/rc0.d/K01netbackup /etc/init.d/netbackup /etc/rc2.d/S95nbclient /etc/rc1.d/K01nbclient /etc/rc0.d/K01nbclient /etc/init.d/nbclient 1.3 NBU启动、关闭的方法 J. Master 主机的关闭 NBU 的方法: /usr/openv/netbackup/bin/bp.kill_all; 或 /usr/openv/netbackup/bin/goodies/netbackup stop K. Master 主机的启动 NBU 的方法: /usr/openv/netbackup/bin/bp.start_all 或 /usr/openv/netbackup/bin/goodies/netbackup L. Media Server 主机的关闭 NBU 的方法: /usr/openv/netbackup/bin/bp.kill_all; 或 /usr/openv/netbackup/bin/goodies/netbackup stop M. Media Server 主机的启动 NBU 的方法: /usr/openv/netbackup/bin/bp.start_all 或 /usr/openv/netbackup/bin/goodies/netbackup N. 使用 bpps 检查进程启动情况 /usr/openv/netbackup/bin/bpps -x 1.4 日常维护健康检查的内容和示例运行结果 NBU 的项目规划、安装、配置等实施工艺必须严谨规范,细小技术环节处理的得当,没有 发现严重影响系统稳定运行的部分,检查内容和范围请参考如下内容: O. 进程检查 #bpps –x P. 备份索引完整性检查 ( 3 个月): #bpcatlist –online –since-months 3 此命令是记录所有备份操作在 NBU 的 catalog 的记录; 检查结果输出(举例说明) : Backupid Backup Date Files Size Sched Catarcid S C Files file dms1_1195384006 dms1rmanfull dms1_1195383991 dms1rmanfull dms1_1195383802 dms1rmanfull dms1_1195383794 dms1rmanfull Nov 18 11:06:46 2007 1 288k Default-Application-Backup 0 1 0 dms1rmanfull_1195384006_UBAK.f Nov 18 11:06:31 2007 1 11.0M Default-Application-Backup 0 1 0 dms1rmanfull_1195383991_UBAK.f Nov 18 11:03:22 2007 1 5.0G Default-Application-Backup 0 1 0 dms1rmanfull_1195383802_UBAK.f Nov 18 11:03:14 2007 010 1 8.0G Default-Application-Backup Policy FULL.f Q. 主机全局变量配置检查 : #bpconfig –U bpconfig 命令显示 NetBackup 全局配置属性。这些属性影响所有策略和 客户机的操作;此项配置符合工程要求; 检查结果输出: Admin Mail Address: Job Retry Delay: 30 minutes Max Simultaneous Jobs/Client: 99 Backup Tries: 2 time(s) in 12 hour(s) Keep Error/Debug Logs: 28 days Max drives this master: 0 Keep TrueImageRecovery Info: 1 days Compress Image DB Files: (not enabled) Media Mount Timeout: 0 minutes (unlimited) Shared Media Mount Timeout:0 minutes (unlimited) Display Reports: 24 hours ago Preprocess Interval: 4 hours (default) Maximum Backup Copies: 2 Image DB Cleanup Interval: 12 hours Policy Update Interval: 10 minutes R. 备份作业检查 #bpdbjobs -summary bpdbjobs –U 与作业数据库进行交互 输出整个作业数据库、 输出数据库的 ,使用 bpdbjobs 等信息。 S. 备份异常事件检查 #bperror -U -d /mm/dd/yyyy -e /mm/dd/yyyy bperror 显示来自 STATUS CLIENT 6 dms1 NetBackup POLICY dms1arch 错误目录库的信息。 SCHED Full SERVER nbu_master TIME COMPLETED 11/06/2007 08:12:55 (the backup failed to back up the requested files) 6 dms2 dms2arch Full nbu_master 11/06/2007 08:19:09 (the backup failed to back up the requested files) 0 dms1 dms1test dms1test nbu_master 11/06/2007 08:24:40 0 dms2 dms2test dms2test nbu_master 11/06/2007 08:25:09 0 dms2 dms2arch Default-Ap nbu_master 11/06/2007 08:51:23 0 dms2 dms2arch Default-Ap nbu_master 11/06/2007 08:51:23 0 dms2 dms2arch Default-Ap nbu_master 11/06/2007 08:53:54 T. 0 dms2 dms2arch Default-Ap nbu_master 11/06/2007 08:55:15 0 dms2 dms2arch Full 11/06/2007 08:55:42 0 dms2 dms2archlog Default-Ap nbu_master 11/06/2007 09:02:11 0 dms2 dms2archlog Default-Ap nbu_master 11/06/2007 09:02:27 0 dms2 dms2archlog Default-Ap nbu_master 11/06/2007 09:03:37 0 dms2 dms2archlog dms2archlo nbu_master 11/06/2007 09:04:03 0 dms1 dms1arch Default-Ap nbu_master 11/06/2007 09:15:09 0 dms1 dms1arch Default-Ap nbu_master 11/06/2007 09:15:13 0 dms1 dms1arch Default-Ap nbu_master 11/06/2007 09:15:43 0 dms1 dms1arch Full 11/06/2007 09:16:10 0 dms1 dms1rmanfull Default-Ap nbu_master 11/06/2007 09:22:21 0 dms1 dms1rmanfull Default-Ap nbu_master 11/06/2007 09:25:21 0 dms1 dms1rmanfull Default-Ap nbu_master 11/06/2007 09:25:35 0 dms1 dms1rmanfull Default-Ap nbu_master 11/06/2007 09:26:13 0 dms1 dms1rmanfull Default-Ap nbu_master 11/06/2007 09:26:47 0 dms1 dms1rmanfull Default-Ap nbu_master 11/06/2007 09:27:54 0 dms1 dms1rmanfull rmanfull nbu_master 11/06/2007 09:28:21 0 nbu_master NBU-Catalogbacku Full nbu_master 11/07/2007 00:01:23 0 nbu_master NBU-Catalogbacku Full nbu_master 11/07/2007 00:01:54 0 nbu_master NBU-Catalogbacku Full unknown 11/07/2007 00:01:58 0 nbu_master NBU-Catalogbacku Full nbu_master 11/08/2007 00:03:48 0 nbu_master NBU-Catalogbacku Full nbu_master 11/08/2007 00:04:40 0 nbu_master NBU-Catalogbacku Full unknown 11/08/2007 00:04:42 0 nbu_master NBU-Catalogbacku Full nbu_master 11/09/2007 00:01:36 0 nbu_master NBU-Catalogbacku Full nbu_master 11/09/2007 00:02:22 0 nbu_master NBU-Catalogbacku Full unknown 11/09/2007 00:02:22 nbu_master nbu_master NBU 配置检查 #bpgetconfig –L 用于获取配置信息的助手程序; Client/Master = Master NetBackup Client Platform = RS6000, AIX5 NetBackup Client Protocol Level = 6.0.0.0.4.4 Product = NetBackup Version Name = 6.0 Version Number = 600000 NetBackup Installation Path = /usr/openv/netbackup/bin Client OS/Release = AIX 5.3 U. 供紧急恢复时的备份镜像保存信息 #bpimagelist -U bpimagelist 可移动介质; 使用指定的格式来报告与从命令选项发送的属性相匹配的目录库映像或 注: -policy -st 来检查关键数据的全备和增量镜像所在介质号 V. 检查磁带机清洗状况 tpclean -L 输出内容举例如下 : Drive Name Type Mount Time Frequency Last Cleaned Comment ********** **** ********** ********* **************** ******* HP.ULTRIUM3-SCSI.001 hcart3* 0.1 0 N/A HP.ULTRIUM3-SCSI.000 hcart3* 0.0 0 N/A IBM.ULTRIUM-TD2.003 hcart2* 0.3 0 N/A IBM.ULTRIUM-TD2.001 hcart2* 0.3 0 N/A IBM.ULTRIUM-TD2.000 hcart2* 0.3 0 N/A IBM.ULTRIUM-TD2.002 hcart2* 0.2 0 N/A W. 检查磁带介质是否都正常 #bpmedialist bpmedialist 查询一个或多个 NetBackup 报告; 经检查,部分磁带介质有被 介质目录库,并生成 NetBackup 介质状态 frozen 的现象, 此操作并不影响正常备份,可以在将 来方便的时候(比如系统周期维护日)对其状态进行重置,如继续发现读写错误,建议 更换磁带 ; X. 检查是否还有足够可用磁带 #available_media 部分磁带介质有被 frozen 的现象,此操作并不影响正常备份,可以在将来方便的时候 (比如系统周期维护日)对其状态进行重置,如继续发现读写错误,建议更换磁带 media ID media type type robot robot r obot side/ ret # slot face level size status KBytes ---------------------------------------------------------------------------CE1_FL_POOL_1 pool 000051 HCART3 ACS 0 - - 9 44562752 000052 HCART3 ACS 0 - - - - ACTIVE AVAILABLE CE1_FL_POOL_2 pool 000053 HCART3 ACS 0 - - 9 44562752 000054 HCART3 ACS 0 - - - - ACTIVE AVAILABLE CE1_L0_POOL_1 pool 000036 HCART3 ACS 0 - - 9 67703936 000035 HCART3 ACS 0 - - - - ACTIVE AVAILABLE CE1_L0_POOL_2 pool 000038 HCART3 ACS 0 - - 9 67703936 000037 HCART3 ACS 0 - - - - ACTIVE AVAILABLE CE1_L1_POOL_1 pool 000055 HCART3 ACS 0 - - 9 21280 ACTIVE 000056 HCART3 ACS 0 - - 9 9696640 000039 HCART3 ACS 0 - - 9 0 FROZEN 000040 HCART3 ACS 0 - - 9 0 FROZEN Y. SAN 环境下检查所有 在 MasterServer Media Server 上运行: #vmdareq –display 输出内容举例如下 : HP.ULTRIUM3-SCSI.000 - AVAILABLE cec164 SCAN_HOST UP cec163 UP cec106 UP cec104 UP HP.ULTRIUM3-SCSI.001 - AVAILABLE cec164 UP cec163 UP cec106 SCAN_HOST UP cec104 UP IBM.ULTRIUM-TD2.000 - AVAILABLE cec164 UP cec163 UP cec106 SCAN_HOST UP cec104 UP IBM.ULTRIUM-TD2.001 - AVAILABLE cec164 SCAN_HOST UP cec163 UP cec106 UP cec104 UP IBM.ULTRIUM-TD2.002 - AVAILABLE cec164 SCAN_HOST UP cec163 UP cec106 UP cec104 UP IBM.ULTRIUM-TD2.003 - AVAILABLE cec164 SCAN_HOST UP cec163 UP 健康状态 ACTIVE cec106 UP cec104 UP Z. 检查磁带库设备状态 #tpconfig –l 输出内容举例如下 : Type Num Index Type DrNum Status robot 0 - TLD drive - 2 hcart2 drive - drive drive Name Path - - - 1 UP - IBM.ULTRIUM-TD2.003 /dev/rmt2.1 3 hcart2 2 UP - IBM.ULTRIUM-TD2.001 /dev/rmt3.1 - 4 hcart2 3 UP - IBM.ULTRIUM-TD2.000 /dev/rmt4.1 - 5 hcart2 4 UP - IBM.ULTRIUM-TD2.002 /dev/rmt5.1 1 - - - - drive - 0 hcart3 1 UP - HP.ULTRIUM3-SCSI.001 /dev/rmt0.1 drive - 1 hcart3 2 UP - HP.ULTRIUM3-SCSI.000 /dev/rmt1.1 robot - Comment TLD - AA. 检查所有策略定义 –U #bppllist -allpolicies bppllist 列出 NetBackup 数据库中的策略 ; 输出结果举例说明: Policy Name: CE1_FL_POLICY Policy Type: Standard Active: yes Effective date: 12/28/2006 10:01:11 Client Compress: no Follow NFS Mounts: no Cross Mount Points: no Collect TIR info: no Block Incremental: no Mult. Data Streams: no Client Encrypt: no Checkpoint: no Policy Priority: 0 Max Jobs/Policy: Unlimited Disaster Recovery: 0 Collect BMR info: no Residence: nbu_master-hcart3-robot-acs-0 Volume Pool: CE1_FL_POOL_1 Keyword: (none specified) HW/OS/Client: RS6000 AIX5 dms1 RS6000 AIX5 dms2 cec106 cec106 Include: (none defined) Schedule: CE1_FL_SCH Type: User Backup Maximum MPX: 1 Synthetic: 0 PFI Recovery: 0 Retention Level: 9 (infinity) 9 (infinity) Number Copies: Fail on Error: 2 00 Residence: nbu_master-hcart3-robot-acs-0 nbu_master-hcart3-robot-acs-0 Volume Pool: CE1_FL_POOL_1 CE1_FL_POOL_2 Daily Windows: Sunday 00:00:00 --> Saturday 23:59:59 ------------------------------------------------------------ BB. 检查存储单元配置 #bpstulist -U -show_available bpstulist 命令显示 NetBackup 存储单元或存储单元组的属性。 输出结果,举例说明如下: Label: nbu_master-hcart3-robot-acs-0 Storage Unit Type: Media Manager Host Connection: nbu_master Number of Drives: 3 On Demand Only: no Density: hcart3 (20) Robot Type/Number: ACS (1) / 0 Max Fragment Size: 1048576 Max MPX/drive: 1 Label: ets1-hcart3-robot-acs-0 Storage Unit Type: Media Manager Host Connection: ets1 Number of Drives: 3 On Demand Only: no Density: hcart3 (20) Robot Type/Number: ACS (1) / 0 Max Fragment Size: 1048576 Max MPX/drive: 1 CC. 根据实际情况和时间确认是否要进行数据检查 #bpverify bpverify 通过读取备份卷, 并将其内容与 NetBackup 目录库进行比较来验证一个或多 个备份的内容。 该操作并不将卷数据与客户机磁盘的内容进行比较。 它读取映像中的每 个块以验证卷是否为可读。 DD. 卷池信息一致性检查 #vmpool –listall 列出卷池;经检查,符合要求。 输出结果,举例说明如下: =================================================================== pool number: 0 pool name: None description: the None pool pool host: ANYHOST pool user: ANY pool group: NONE =========================================================================== ===== pool number: 1 pool name: NetBackup description: the NetBackup pool pool host: ANYHOST pool user: 0 (root) pool group: NONE =========================================================================== ===== pool number: 2 pool name: DataStore description: the DataStore pool pool host: ANYHOST pool user: 0 (root) pool group: NONE =========================================================================== ===== vmcheckxxx 报告磁带库的介质内容,并选择将它的内容与卷配置进行比较。 EE. NBU 系统全面性检查: support support 命令检查全面的系统运行状况。 第2章 安装 2.1 WINDOWS 平台软件安装 2.1.1 安装 NBU Master Server 根据主机及操作系统版本,把安装光盘放入光驱。安装程序自动启动 点击“ installation ”开始安装 点击“ Server Software Iinstallation ” 确认安装,点击运行: 弹出安装对话框,点击 NEXT : 选择“ I accept the terms of the license agreement”,点击“ Next” 选择“ Install to this computer only ”,选择 Custom 自定义点击“ Next ” 在 License Key 里面输入 Master Server 的 Licenses,点击 Netbackup Master Server 图标 确认安装目录,点击“ Next ” 选择需要安装的目录,点击 change,改变安装目录,然后选中 NEXT : 点击“ NEXT ” 指定 NBU 的通信端口,默认即可: 选择用户名,密码,默认选着本地管理员账号,并安装后启动进程: 确认 nbu server 和 EMMserver 的名字默认是主机名: 对安装环境进行检查,查看是否都通过,点击 开始安装: Install 开始安装: 安装完成,点击 Add Keys ,添加其他的 license: 点击 New ,添加 license,点击 Add 即可添加: 点击 Finish ,安装完成: 2.1.2 装 NBU Media Server 在 Master Server 和 Media Server 的 c:\windows\system32\drivers\etc\hosts 下加入主机名解析 示例: 0.0.0.0 NBUserver 打开 master server 控制台 选择左边界面的 Host Proparties Master server 右边的界面 master server 主机即可显示: 选择 Servers 属性,点击 Media server 对应的 Add 按键: 添加 media server 主机名: Media 主机名即添加,按 OK 确认: 弹出对话框,更改此设置需要重启 等 media server 安装完成后重启。 NBU 服务,点击确认: 开始安装 media server soft,点击 Installation : 点击 Server Software Installation : 确认运行安装: 弹出安装对话框,点击 Next : 选择“ I accept the terms of the license agreement”,点击“ Next” 点击 Custom 自定义安装,点击 Next 在 License Key 里面输入 Master Server 的 Licenses,点击 Netbackup Media Server : 确认安装目录,点击“ Next ” 选择需要安装的目录,点击 点击“ NEXT ” change,改变安装目录,然后选中 NEXT : 指定 NBU 的通信端口,默认即可: 选择用户名,密码,默认选着本地管理员账号,并安装后启动进程: 输入 master 的主机名: 对安装环境进行检查,查看是否都通过,点击 Install 开始安装: 开始安装: 安装完成,点击 Add Keys ,添加其他的 license: 点击 New ,添加 license,点击 Add 即可添加: 点击 Finish ,安装完成: Media server 安装完成,重启 media server。 master 进程,然后重启 media server 进程,已同步 master 和 2.1.3 安装 NBU Client 在 Master Server 和 Client 的 c:\windows\system32\drivers\etc\hosts 下加入主机名解析 示例: 0.0.0.0 nbuserver 根据主机及操作系统版本,把安装光盘放入光驱。安装程序自动启动, 点击 installation: 点击 Client Software Installation : 点击 Next : 选择 “ I agree”,接受许可,点击 选择 custom 自定义安装,点击 Next : Next : 选择安装目录,点击 Next : 选择服务自动启动,安装完后启动服务,端口默认即可,点击 Next : 本地管理员账号安装,点击 Next : 输入 master server 的主机名,点击 Next : 检查安装环境,点击 安装开始: Install : 安装完成,点击 Finish: 2.1.4 安装 NBU补丁 在下面的网址中可以下载到 NBU 的所有补本 http://www.symantec.com/business/support/downloads.jsp?pid=15143 在这里我们下载 NB_7.0.winnt.x86.exe provides updates for NetBackup 7.0 on 32-bit Windows server and clients. 把文件下载到本地解压后运行 setup.exe,出现以下界面,点击“ Next ” 点击“ Next” 点击“ Install ” 点击“ Finish ”完成补丁安装 2.2 Linux/UNIX 平台软件安装 2.2.1 安装 Media Server 在 Master Server 上的 c:\windows\system32\drivers\etc\hosts 下加入主机名解析 NN_GIS2 在本机的 /etc/hosts 里面加入 Master Server 的主机名解析 10.195.0.82 ngbackup 放入光盘 NB_70_AIX # ls install rs6000 # ./install This install script should no longer be executed from the cdrom location. Please cd to / and execute the the full pathname to this script. For example: cd / /gisdata/vrts/nb70/NB_70_AIX_20070723/install # cd / # /gisdata/vrts/nb70/NB_70_AIX_20070723/install 运行安装脚本 Symantec Installation Script Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved. Installing NetBackup Server Software NOTE: To install only NetBackup Client software locally on this machine or to load additional UNIX client software on this server, insert the NetBackup UNIX Clients cdrom. Do you wish to continue? [y,n] (y) The NetBackup and Media Manager software is built for use on RS6000 hardware. Do you want to install NetBackup and Media Manager files? [y,n] (y) NetBackup and Media Manager are normally installed in /usr/openv. Is it OK to install in /usr/openv? [y,n] (y) 安装路径 Reading NetBackup files from /gisdata/vrts/nb70/NB_70_AIX_20070723/rs6000/anb x usr/openv/NB-Java.tar.Z, 95360520 bytes, 186252 media blocks. x usr/openv/db/bin …………………………………… .. …………………………………… .. 安装文件过程略 x openv/resources/libaixlvmfi_root.res, 4088 bytes, 8 tape blocks x openv/resources/libjfsfi_root.res, 3520 bytes, 7 tape blocks x openv/resources/libnetappfi_root.res, 2112 bytes, 5 tape blocks x openv/resources/nbecmsg_root.res, 42706 bytes, 84 tape blocks Installing NB-Java. + /bin/cp ./nbj.conf /usr/openv/java An automatic startup script, /etc/rc.client.netbackup has been installed. This will cause NetBackup client daemons to be automatically restarted each time the server boots. Starting nbftclnt... LiveUpdate is not installed, skipping registration step... A NetBackup Server or Enterprise Server license key is needed for installation to continue. Enter license key: 输入 San Client Licenses XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-* NetBackup Enterprise Server Base product with the following features enabled: SAN Client Bare Metal Restore Encryption Open File Backup Robotic Library Sharing Support Remote Media Server Support Microsoft RSM Robotic Libraries ADIC DAS/SDLC Robotic Libraries IBM A TL Robotic Libraries Fujitsu LMF Robotic Libraries StorageTek ACS Robotic Libraries Snapshot Client Inline Tape Copy Library Based Tape Drives Additional Drives/Robotics DataStore Encryption (Legacy DES 56-bit) Encryption (Legacy DES 40-bit) Shared Storage Option Additional clients has been registered. All additional keys should be added at this time. Do you want to add additional license keys now? [y,n] (n) Installing NetBackup Enterprise Server version: 7.0 If this machine will be using a different network interface than the default (NN_GIS2), 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 "NN_GIS2" as the configured name of the NetBackup server? [y,n] (y) Is NN_GIS2 the master server? [y,n] (y) n 输入 N 表示本机不是 What is the fully qualified name of the master server? ngbackup 指定存在的 Master Checking /etc/services for the needed NetBackup and Media Manager services. Found the necessary NetBackup services in /etc/services. Checking for a bpcd entry in /etc/inetd.conf: Found. Checking for a vnetd entry in /etc/inetd.conf: Found. Checking for a vopied entry in /etc/inetd.conf: Found. Checking for a bpjava-msvc entry in /etc/inetd.conf: Found. Sending SIGHUP to inetd process. Copying NetBackup startup script rc.netbackup.aix found in /etc directory to /etc/rc.netbackup.aix.NBU_080609.18:38:15 for future reference. modifications to rc.netbackup.aix should be re-evaluated. Any local Master To make NetBackup start up automatically when the system is restarted, the netbackup script found in /usr/openv/netbackup/bin/goodies has been copied to /etc/rc.netbackup.aix. You must modify /etc/inittab to include it. Enter the Enterprise Media Manager server (default: ngbackup): 指定 EMM Server ,默认即可 DBMS Server 9.0.2 is being installed x bin x bin/dbbackup, 251994 bytes, 493 tape blocks …………………………………… .. …………………………………… .. 安装文件过程略 x tix x tix/default.tix, 6008 bytes, 12 tape blocks Starting the NetBackup Event Manager. Starting the NetBackup compatibility daemon. Starting the Media Manager device daemon processes. Starting the NetBackup Remote Monitoring Management System. Starting the NetBackup Service Layer. Starting the NetBackup Service Monitor. File /usr/openv/tmp/install_trace.536626 contains a trace of this install. That file can be deleted after you are sure the install was successful. 2.2.2 安装 Media Server 补丁 在下面的网址中可以下载到 NBU 的所有补本 http://www.symantec.com/business/support/downloads.jsp?pid=15143 在这里我们下载 NB_7.0.rs6000.tar provides updates to NetBackup 7.0 on AIX servers. NB_CLT_7.0.tar provides updates for NetBackup 7.0 for all UNIX clients NB_JA V_7.0.tar provides an update to NetBackup 7.0 Java on UNIX platforms 把文件下载到本地解压后运行 NB_update.install # ./NB_update.install There are 3 packs available in /gisdata/vrts/nbclt: (* denotes installed pack) NB_7.0 NB_CLT_7.0 NB_JAV_7.0 Enter pack name (or q) [q]: NB_7.0 Pack NB_7.0 requires pack NB_CLT_7.0 or a later. Pack NB_7.0 requires the following pack levels(s) : NB_CLT_7.0. Pack NB_7.0 will not be installed at this time. Installing required pack, NB_CLT_7.0, now. Pack NB_CLT_7.0 co-requires the following pack level(s) : NB_7.0 NB_JA V_7.0. Install pack NB_CLT_7.0 Fri Aug 7 10:05:19 BEIST 2009 Rev. 1.6.4.38 Can not install pack when NetBackup daemons are running. Do you want to kill all NetBackup daemons? (y/n) [n] y Looking for NetBackup processes that need to be terminated. Stopping nbsvcmon... Stopping nbsl... Stopping nbrmms... Stopping bpcompatd... Looking for Media Manager processes that need to be terminated. Stopping vmd... The following processes are still active root 991250 1 0 18:44:07 - 0:00 vmd Do you want this script to attempt to kill them? [y,n] (y) Killing remaining processes... Waiting for processes to terminate... Looking for VxDBMS processes that need to be terminated. Pack install will continue. 停止 NBU 进程 Performing install of RS6000/AIX5 client binaries locally. Running preinstall script. See /usr/openv/pack/pack.history for more details. Saving pre-existing binaries. This may take a few minutes. Saved binaries successfully. Using gzip to compress saved files in /usr/openv/pack/NB_CLT_7.0/save/pre_NB_CLT_7.0RS6000.080709_100519.tar. Extracting files out of /gisdata/vrts/nbclt/VrtsNB_CLT_7.0.RS6000.tar.Z. Extract /gisdata/vrts/nbclt/VrtsNB_CLT_7.0.RS6000.tar.Z usr/openv/netbackup/client/RS6000/AIX5 Extract /gisdata/vrts/nbclt/VrtsNB_CLT_7.0.RS6000.tar.Z usr/openv/ usr/openv/netbackup/ Tar extraction successful. See /usr/openv/pack/pack.history for more details. Running postinstall script. See /usr/openv/pack/pack.history for more details. /gisdata/vrts/nbclt/VrtsNB_CLT_7.0.postinstall: Running. Hardware/OS Type=RS6000/AIX5 /gisdata/vrts/nbclt/VrtsNB_CLT_7.0.postinstall: Installing RS6000/AIX5 client binaries locally. x openv x openv/lib x openv/lib/libvxSigScheduleJNI2.so, 2198029 bytes, 4294 tape blocks …………………………………… .. …………………………………… .. 安装文件过程略 + mv -f /usr/openv/lib/libvxulST.so.1_new /usr/openv/lib/libvxulST.so.1 -----------------------------------------------Installation of pack NB_CLT_7.0 completed Fri Aug 7 10:05:19 BEIST 2009 Rev. 1.6.4.38. -----------------------------------------------LiveUpdate is not installed, skipping registration step... Installing required pack, NB_7.0, now. Install pack NB_7.0 Fri Aug Running preinstall script. 7 10:05:19 BEIST 2009 Rev. 1.6.4.38 See /usr/openv/pack/pack.history for more details. /gisdata/vrts/nbclt/VrtsNB_7.0.preinstall: Running. Hardware/OS Type=RS6000/AIX5 This machine is a media server, and it is not the EMMSERVER. Checking for PBX update... Found newer version of PBX, no update required. PBX update Installation log located here: /tmp/installpbx-1011962-080709101411.log Saving pre-existing binaries. Saved binaries successfully. Using gzip to compress saved files in /usr/openv/pack/NB_7.0/save/pre_NB_7.0.080709_100519.tar. Using gzip to compress saved files in /usr/openv/var/global/NB_7.0/global_save.tar. Extracting files out of /gisdata/vrts/nbclt/VrtsNB_7.0.rs6000.tar.Z. Tar extraction successful. See /usr/openv/pack/pack.history for more details. Running postinstall script. See /usr/openv/pack/pack.history for more details. /gisdata/vrts/nbclt/VrtsNB_7.0.postinstall: Running. Hardware/OS Type=RS6000/AIX5 This machine is a media server, and it is not the EMMSERVER. Copying /etc/rc.netbackup.aix to /etc/rc.netbackup.aix.08-07-09.10:28:18 for future reference. Any local modifications to /etc/rc.netbackup.aix should be re-evaluated. Converting STREAMS files. This may take a few minutes... STREAMS files conversion is complete. DBMS Server 9.0.2 is being installed Creating /usr/openv/tmp/sqlany x bin x bin/dbbackup, 243550 bytes, 476 tape blocks …………………………………… .. …………………………………… .. scripts/wdata/sales_oi.dat, 53753 bytes, 105 tape blocks x shared x tix 安 装 文 件 过 程 略 x tix/default.tix, 6008 bytes, 12 tape blocks -----------------------------------------------Installation of pack NB_7.0 completed Fri Aug 7 10:05:19 BEIST 2009 Rev. 1.6.4.38. -----------------------------------------------LiveUpdate is not installed, skipping registration step... Installing required pack, NB_JA V_7.0, now. Install pack NB_JA V_7.0 Fri Aug 7 10:05:19 BEIST 2009 Rev. 1.6.4.38 Saving pre-existing binaries. Saved binaries successfully. Using gzip to compress saved files /usr/openv/pack/NB_JA V_7.0/save/pre_NB_JA V_7.0.080709_100519.tar. Extracting files out of /gisdata/vrts/nbclt/VrtsNB_JA V_7.0.tar.Z. Tar extraction successful. See /usr/openv/pack/pack.history for more details. Running postinstall script. See /usr/openv/pack/pack.history for more details. /gisdata/vrts/nbclt/VrtsNB_JA V_7.0.postinstall: Running. Hardware/OS Type=RS6000/AIX5 Uncompressing /usr/openv/NB-Java.tar.Z file. -----------------------------------------------Installation of pack NB_JA V_7.0 completed Fri Aug -----------------------------------------------LiveUpdate is not installed, skipping registration step... There are 3 packs available in /gisdata/vrts/nbclt: (* denotes installed pack) NB_7.0 * NB_CLT_7.0 * NB_JAV_7.0 * Enter pack name (or q) [q]: q 7 10:05:19 BEIST 2009 Rev. 1.6.4.38. in There are stopped daemons. Do you want to restart all NetBackup daemons? (y/n) [n] y 启动 NBU 进程 Starting VxDBMS database server... Starting nbevtmgr... Starting nbemm... Starting nbrb... Starting ltid... Starting bprd... Starting bpcompatd... Starting nbjm... Starting nbpem... Starting nbstserv... Starting nbrmms... Starting nbkms... Starting nbsl... Starting nbsvcmon... Starting nbftclnt... Exiting NB_update.install 2.2.3 安装 Client 在 Master Server 上的 c:\windows\system32\drivers\etc\hosts 下加入主机名解析 M85 在本机的 /etc/hosts 里面加入 Master Server 的主机名解析 10.195.0.82 ngbackup 放入光盘 NetBackup_7.0_CLIENTS1 ,进入目录 m85:root /data1/vrts/NB_70_CLIENTS1_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) Do you want to install the NetBackup client software for this client? [y,n] (y) This package will install RS6000/AIX5 client. This package will install NetBackup client 7.0. 输入 Master Server 名 Enter the name of the NetBackup server : ngbackup Would you like to use "m85" as the configured name of the NetBackup client? [y,n] (y) x openv x openv/lib x openv/lib/libvxSigScheduleJNI2.so, 2542212 bytes, 4966 media blocks. x openv/lib/libVmangle.so, 18704 bytes, 37 media blocks. x openv/lib/libVnbatST.so_new, 278530 bytes, 545 media blocks. …………………………………… .. …………………………………… .. 安装文件过程略 x openv/resources/libjfsfi_root.res, 3520 bytes, 7 media blocks. x openv/resources/libnetappfi_root.res, 2112 bytes, 5 media blocks. x openv/resources/nbecmsg_root.res, 42706 bytes, 84 media blocks. + /bin/cp NB-Java.tar.Z /usr/openv Installing NB-Java. + /bin/cp ./nbj.conf /usr/openv/java Checking for a bpcd entry in /etc/inetd.conf: Adding bpcd entry. Original /etc/inetd.conf saved as /etc/inetd.conf.08-10-09.13:24:38. Checking for a vnetd entry in /etc/inetd.conf: Adding vnetd entry. Checking for a vopied entry in /etc/inetd.conf: Adding vopied entry. Checking for a bpjava-msvc entry in /etc/inetd.conf: Adding bpjava-msvc entry. Send a SIGHUP to inetd or xinetd so the (x)inetd.conf file will be reread. updating /etc/inittab ... The following temporary file can be deleted after you verify the proper modification of /etc/inittab: /tmp/SYMCnbclt-inittab.2056300.i An automatic startup script, /etc/rc.client.netbackup has been installed. This will cause NetBackup client daemons to be automatically restarted each time the server boots. Starting nbftclnt... LiveUpdate is not installed, skipping registration step... File /usr/openv/tmp/install_trace.2142314 contains a trace of this install. That file can be deleted after you are sure the install was successful. 2.2.4 安装 Client 补丁 在下面的网址中可以下载到 NBU 的所有补本 http://www.symantec.com/business/support/downloads.jsp?pid=15143 在这里我们下载 NB_CLT_7.0.tar provides updates for NetBackup 7.0 for all UNIX clients NB_JA V_7.0.tar provides an update to NetBackup 7.0 Java on UNIX platforms 把文件下载到本地解压后运行 NB_update.install m85:root /data1/vrts>./NB_update.install There are 2 packs available in /data1/vrts: (* denotes installed pack) NB_CLT_7.0 NB_JAV_7.0 Enter pack name (or q) [q]: NB_CLT_7.0 Pack NB_CLT_7.0 co-requires the following pack level(s) : NB_JA V_7.0. Install pack NB_CLT_7.0 Mon Aug 10 13:27:59 BEIDT 2009 Rev. 1.6.4.38 Creating /usr/openv/netbackup/client/RS6000/AIX5 Performing install of RS6000/AIX5 client binaries locally. Running preinstall script. See /usr/openv/pack/pack.history for more details. /data1/vrts/VrtsNB_CLT_7.0.preinstall: Running. Hardware/OS Type=RS6000/AIX5 + /bin/cp /usr/openv/netbackup/bin/tar /usr/openv/netbackup/client/RS6000/AIX5/tar + /bin/cp /usr/openv/netbackup/bin/version /usr/openv/netbackup/client/RS6000/AIX5/version + /bin/cp /usr/openv/java/nbj.conf /usr/openv/netbackup/client/RS6000/AIX5/nbj.conf + cp /usr/openv/netbackup/bin/bpcd /usr/openv/netbackup/bin/bpcd_new + cp /usr/openv/bin/vnetd /usr/openv/bin/vnetd_new + cp /usr/openv/lib/libVnbatST.so /usr/openv/lib/libVnbatST.so_new + cp /usr/openv/lib/libVnbatST64.so /usr/openv/lib/libVnbatST64.so_new + cp /usr/openv/lib/libVxSS_helper.so /usr/openv/lib/libVxSS_helper.so_new + cp /usr/openv/lib/libVxSS_helper64.so /usr/openv/lib/libVxSS_helper64.so_new + cp /usr/openv/lib/libnbmangle.so /usr/openv/lib/libnbmangle.so_new + cp /usr/openv/lib/libvnoauth.so /usr/openv/lib/libvnoauth.so_new + cp /usr/openv/lib/libvnoauth64.so /usr/openv/lib/libvnoauth64.so_new + cp /usr/openv/lib/libvopie.so /usr/openv/lib/libvopie.so_new + cp /usr/openv/lib/libvopie64.so /usr/openv/lib/libvopie64.so_new + cp /usr/openv/lib/libvxicudataST.so /usr/openv/lib/libvxicudataST.so_new + cp /usr/openv/lib/libvxicui18nST.so /usr/openv/lib/libvxicui18nST.so_new + cp /usr/openv/lib/libvxicuucST.so /usr/openv/lib/libvxicuucST.so_new + cp /usr/openv/lib/libvxustdioST.so /usr/openv/lib/libvxustdioST.so_new + cp /usr/openv/lib/libvxACEST.so.3 /usr/openv/lib/libvxACEST.so.3_new + cp /usr/openv/lib/libvxexticuST.so.1 /usr/openv/lib/libvxexticuST.so.1_new + cp /usr/openv/lib/libvxlisST.so.1 /usr/openv/lib/libvxlisST.so.1_new + cp /usr/openv/lib/libvxulST.so.1 /usr/openv/lib/libvxulST.so.1_new Saving pre-existing binaries. Client tarball creation complete. Saved client binaries successfully. JRE tarball creation complete. Saved JRE binaries successfully. Saved binaries successfully. Using gzip to compress saved files /usr/openv/pack/NB_CLT_7.0/save/pre_NB_CLT_7.0.081009_132759.tar. Extracting files out of /data1/vrts/VrtsNB_CLT_7.0.RS6000.tar.Z. Extract /data1/vrts/VrtsNB_CLT_7.0.RS6000.tar.Z usr/openv/netbackup/client/RS6000/AIX5 Tar extraction successful. See /usr/openv/pack/pack.history for more details. Running postinstall script. See /usr/openv/pack/pack.history for more details. /data1/vrts/VrtsNB_CLT_7.0.postinstall: Running. Hardware/OS Type=RS6000/AIX5 /data1/vrts/VrtsNB_CLT_7.0.postinstall: Installing RS6000/AIX5 client binaries locally. x openv in x openv/lib x openv/lib/libvxSigScheduleJNI2.so, 2198029 bytes, 4294 tape blocks x openv/lib/libVmangle.so, 18708 bytes, 37 tape blocks …………………………………… .. …………………………………… .. 安装文件过程略 + mv -f /usr/openv/lib/libvxlisST.so.1_new /usr/openv/lib/libvxlisST.so.1 + rm -f /usr/openv/lib/libvxulST.so.1 + mv -f /usr/openv/lib/libvxulST.so.1_new /usr/openv/lib/libvxulST.so.1 -----------------------------------------------Installation of pack NB_CLT_7.0 completed Mon Aug 10 13:27:59 BEIDT 2009 Rev. 1.6.4.38. -----------------------------------------------LiveUpdate is not installed, skipping registration step... Installing required pack, NB_JA V_7.0, now. Install pack NB_JA V_7.0 Mon Aug 10 13:27:59 BEIDT 2009 Rev. 1.6.4.38 Saving pre-existing binaries. Saved binaries successfully. Using gzip to compress saved files /usr/openv/pack/NB_JA V_7.0/save/pre_NB_JA V_7.0.081009_132759.tar. Extracting files out of /data1/vrts/VrtsNB_JA V_7.0.tar.Z. Tar extraction successful. See /usr/openv/pack/pack.history for more details. Running postinstall script. See /usr/openv/pack/pack.history for more details. /data1/vrts/VrtsNB_JA V_7.0.postinstall: Running. Hardware/OS Type=RS6000/AIX5 Uncompressing /usr/openv/NB-Java.tar.Z file. -----------------------------------------------Installation of pack NB_JA V_7.0 completed Mon Aug 10 13:27:59 BEIDT 2009 Rev. 1.6.4.38. -----------------------------------------------LiveUpdate is not installed, skipping registration step... There are 2 packs available in /data1/vrts: (* denotes installed pack) in NB_CLT_7.0 * NB_JAV_7.0 * Enter pack name (or q) [q]: Exiting NB_update.install 第3章 配置 NBU 3.1 配置 Storage Unit 3.1.1 新建 storage Unit 由于我们此次存储是阵列,所以要创建 选择左边菜单的 Disk 类型的 Storage Unit Storage Unit,点击图标栏的 3.1.2 storage unit 来新建一个 Storage Unit 属性 输入 Storage unit name,选择 Media Server ,指定存储所在的路径,点击 OK Storage Unit LUN02 创建完成 3.2 配置带库 3.2.1 配置设备 打开管理界面,点击 弹出设备配置向导: configure storage devices ,开始配置设备: 选中需要配置的 开始扫描设备: master server , media server 主机名: 查看扫描的设备是否都扫描到了: 下一步: 查看具体的设备 : 选中需要配置的的设备: 开始配置: 自动创建与设备对应的存储单元: Finish 点击完成设备配置: 3.2.2 配置磁带 点击 configure volumes : 弹出磁带配置向导: 选中机械臂,扫描设备: 查看扫描的磁带: 选中清洗带排除在备份区,下一步继续: 下一步完成配置, 如何继续配置其他带库的磁带, 请点击 configure more volumes ,继续配置: 3.3 配置 Deduplication Storage Pool 3.3.1 建立 storage server 点击 configure storage Devices 向导 弹出建立存储池 server 对话框 点击下一步 选择 media server Deduplication Pool Next 下一步 设置存储池的消重的服务器,这里选择 设置存储池的用户名,密码 master Next 下一步, 设置存储的位置, 如果要改变 storage server 的 database路径,请选择 如果要改变网卡,请选择 Next ,下一步 确认配置信息 use atlename path use specific network interface Next 下一步 开始建立 depulication storage server 3.3.2 设置存储池 弹出 disk pool 配置窗口 点击下一步 选择存储池类型 puredisk Next 下一步 选择存储 开始建立存储池。 输入存储池的名字即可。 第4章 NBU灾难恢复 4.1 配置 catalog 备份策略 4.1.1 新建 policy 选择左列中 Policy 右键,选择新建策略,在弹出对话框中输入信息 4.1.2 修改 Attributes 指定 Policy type 和 Policy storage unit, Ploicy type : NBU-catalog 4.1.3 修改 schedule 修改备份的 Schedules,双击 Schedules,修改启动时间、备份周期及数据保存周期 4.1.4 指定 catalog 备份日志存放 配置完成。 设置好后,执行备份。 4.2 Catalog 的灾难恢复 4.2.1 导入 catalog 备份 首先把备份的 catalog img 导入到新装好的 nbu 上, 4.2.2 恢复 catalog 日志文件 执行命令恢复 catalog 日志 /usr/openv/netbackup/bin/admincmd/ bpimport: -drfile <media_id or path> -drfile_dest <fully_qualified_dir_name_on_m aster> [-client <name>] [-server <name>] [-L <output_file> [-en]] [-passwd] [-priority <number>] 例: 备份到磁带: bpimport –drfile – id SY0065 –drfile_dest /usr/openv/cdr/ 备份到存储: bpimport –drfile – id /catalogbak –drfiel_dest /usr/openv/cdr/ 4.2.3 执行恢复 然后用向导开始恢复 指定刚才用命令恢复出来的 通过 catalog 日志,自动去找备份的 catalog catalog img 日志 开始执行恢复 恢复开始 在监视器可以看见恢复的 job 开始在跑 第5章 文件备份与恢复 5.1 Windows 系统的文件备份 5.1.1 打开管理界面 打开管理界面执行命令: jnbSA 5.1.2 新建策略 选择 policy ,右键执行 new policy ,输入策略名 , 点击 OK ,弹出策略属性框 5.1.3 attributes 设置 需要更改的地方如图所示: 备份 windows 系统 ① policy type 选择 MS-Windwos ② Policy storage 选择需要备份存储单元 ③勾掉 Bare Metal Restore 选项 ④选择 apply 5.1.4 Schedules 设置 然后选择 Schedules,时间窗口选项, 选择 NeW Attributes 属性 ①填写 schedule 的 Name ②备份方式:全备份,增量备份,差异备份,用户备份,归档备份 ③发起频率 ④保留周期 选择 OK 添加 Start window 属性,填写备份的时间段。 Exclude date 填写排除的时间 5.1.5 client 设置 然后选择 client 选项, 选择 New ①需要备份的客户端 ②选择客户端对应的操作系统 选择 ok 添加 5.1.6 Backup Seclection 设置 然后选择 Backup Selections 备份项,右键 New 添加需要备份的文件 ①选择对应的操作系统 ②选择文件所在的位置 ③添加的文件列表显示 添加备份的文件后,点击 ok。 Windows 文件备份的策略就制定完成。 系统的文件备份 5.2 Linux/unix 5.2.1 打开管理界面 打开管理界面执行命令: jnbSA 5.2.2 新建策略 选择 policy ,右键执行 new policy ,输入策略名 , 点击 OK ,弹出策略属性框 5.2.3 attributes 属性设置 需要更改的地方如图所示: 备份 linux/unix 系统 ① policy type 选择 Standard ② Policy storage 选择需要备份存储单元 ③勾掉 Bare Metal Restore 选项 ④选择 apply 5.2.4 Schedules 设置 然后选择 Schedules,时间窗口选项, 选择 NeW Attributes 属性 ①填写 schedule 的 Name ②备份方式:全备份,增量备份,差异备份,用户备份,归档备份 ③发起频率 ④保留周期 选择 OK 添加 Start window 属性,填写备份的时间段。 Exclude date 属性,填写排除的时间 5.2.5 client 设置 然后选择 client 选项, 选择 New ①需要备份的客户端 ②选择客户端对应的操作系统 选择 ok 添加 5.2.6 Backup Seclection 设置 然后选择 Backup Selections 备份项,右键 New 添加需要备份的文件 ①填写文件所在的位置 ②添加的文件列表显示 添加备份的文件后,点击 ok。 Linux/unix 文件备份的策略就制定完成。 5.3 文件恢复 5.3.1 打开管理界面 打开管理界面 5.3.2 jnbSA 选择恢复选项 ①点击左边的 Backup,Archive,and Restore ②选择 Restore files ③把 /root/ 改成 / ④选择右上方的小手,弹出选项卡 1 选择 server name 2 选择源客户端即使备份的客户端 3 选择目标客户端即需要恢复的客户端 4 选择策略类型文件的备份 Windows 系统 选择 MS-windows Linux/unix 系统 选择 Standard ⑤选择需要恢复的时间点 ⑥查看备份记录 5.3.3 选择需要恢复的文件 选择完恢复选项后,可以查看到备份过的文件 选择需要恢复的文件,然后点击右下角的 开始恢复 Restore 第6章 Oracle 备份与恢复 6.1 使用模板创建备份脚本 安装完成后,会自动生成备份脚本示例,存放位置如下: FF. Windows c:\Program Files\Veritas\netbackup\dbext\oracle\samples\rman GG.L inux/Unix /usr/openv/netbackup/ext/db_ext/oracle/samples/rman 将脚本模板复制到其它的目录下,修改脚本名称。 1、 建立连接 [root@localhost ~]#su - oracle [oracle@localhost ~]$ cd /usr/openv/netbackup/bin [oracle@localhost bin]$ ./oracle_link 2012 年 08 月 25 日星期六 09:43:28 CST 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: /orcl/oracle Oracle version: 10. 2.0.1.0 Platform type: i686 Linking LIBOBK: ln -s /usr/openv/netbackup/bin/libobk.so /orcl/oracle/lib/libobk.so Done Please check the trace file located in /tmp/make_trace.4459 to make sure the linking process was successful. 2、 创建备份脚本 [root@localhost ~]# mkdir -p /usr/openv/netbackup/script [root@localhost ~]#cd /usr/openv/netbackup/ext/db_ext/oracle/samples/rman [root@localhostrman]# ls cold_database_backup.sh database_restore.sh hot_tablespace_backup.sh cold_duplex_database_backup_full.sh hot_database_backup.sh pit_database_restore.sh [root@localhostrman]# cp hot_database_backup.sh /usr/openv/netbackup/script/ [root@localhostrman]# cd /usr/openv/netbackup/script/ [root@localhost script]# ls hot_database_backup.sh [root@localhost script]#mv hot_database_backup.sh rman.sh [root@localhost script]#chmodo+x rman.sh [root@localhost script]#vi rman.sh 6.2 修改备份脚本 查看环境变量 使用 oracle 用户登录 oracle,查看 oracle 的环境变量 Su –oracle More .profile sqlplus /nolog conn /as sysdba sql> archive log list //查看是否在归档模式,如不在归档模式,请 dba 修改成归档模式 修改参数 红色字体是需要修改的地方,填写实际 oracle_home,SID,USER 6.2.1 全库备份脚本 hot_database_backup.sh #!/bin/sh # $Header: hot_database_backup.sh,v 1.2 2002/08/06 23:51:42 $ ## # --------------------------------------------------------------------------# hot_database_backup.sh # --------------------------------------------------------------------------# This script uses Recovery Manager to take a hot (inconsistent) database # backup. A hot backup is inconsistent because portions of the database are # being modified and written to the disk while the backup is progressing. # You must run your database in ARCHIVELOG mode to make hot backups. It is # assumed that this script will be executed by user root. In order for RMAN # to work properly we switch user (su -) to the oracle dba account before # execution. If this script runs under a user account that has Oracle dba # privilege, it will be executed using this user's account. # --------------------------------------------------------------------------# --------------------------------------------------------------------------# Determine the user which is executing this script. # --------------------------------------------------------------------------CUSER=`id |cut -d"(" -f2 | cut -d ")" -f1` # --------------------------------------------------------------------------# Put output in <this file name>.out. Change as desired. # Note: output directory requires write permission. # --------------------------------------------------------------------------RMAN_LOG_FILE=${0}.out # --------------------------------------------------------------------------- # You may want to delete the output file so that backup information does # not accumulate. If not, delete the following lines. # --------------------------------------------------------------------------if [ -f "$RMAN_LOG_FILE" ] then rm -f "$RMAN_LOG_FILE" fi # ----------------------------------------------------------------# Initialize the log file. # ----------------------------------------------------------------echo >> $RMAN_LOG_FILE chmod 666 $RMAN_LOG_FILE # --------------------------------------------------------------------------# Log the start of this script. # --------------------------------------------------------------------------echo Script $0 >> $RMAN_LOG_FILE echo ==== started on `date` ==== >> $RMAN_LOG_FILE echo >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# Replace /db/oracle/product/ora81, below, with the Oracle home path. # --------------------------------------------------------------------------ORACLE_HOME=/db/oracle/product/ora81 export ORACLE_HOME # --------------------------------------------------------------------------# Replace ora81, below, with the Oracle SID of the target database. # --------------------------------------------------------------------------ORACLE_SID=ora81 export ORACLE_SID # --------------------------------------------------------------------------# Replace ora81, below, with the Oracle DBA user id (account). # --------------------------------------------------------------------------ORACLE_USER=ora81 # --------------------------------------------------------------------------# Set the target connect string. # Replace "sys/manager", below, with the target connect string. # --------------------------------------------------------------------------TARGET_CONNECT_STR=sys/manager # --------------------------------------------------------------------------# Set the Oracle Recovery Manager name. # --------------------------------------------------------------------------RMAN=$ORACLE_HOME/bin/rman # --------------------------------------------------------------------------# Print out the value of the variables set by this script. # --------------------------------------------------------------------------echo >> $RMAN_LOG_FILE echo "RMAN: $RMAN" >> $RMAN_LOG_FILE echo "ORACLE_SID: $ORACLE_SID" >> $RMAN_LOG_FILE echo "ORACLE_USER: $ORACLE_USER" >> $RMAN_LOG_FILE echo "ORACLE_HOME: $ORACLE_HOME" >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# Print out the value of the variables set by bphdb. # --------------------------------------------------------------------------echo >> $RMAN_LOG_FILE echo "NB_ORA_FULL: $NB_ORA_FULL" >> $RMAN_LOG_FILE echo "NB_ORA_INCR: $NB_ORA_INCR" >> $RMAN_LOG_FILE echo "NB_ORA_CINC: $NB_ORA_CINC" >> $RMAN_LOG_FILE echo "NB_ORA_SERV: $NB_ORA_SERV" >> $RMAN_LOG_FILE echo "NB_ORA_POLICY: $NB_ORA_POLICY" >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# NOTE: This script assumes that the database is properly opened. If desired, # this would be the place to verify that. # --------------------------------------------------------------------------echo >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# If this script is executed from a NetBackup schedule, NetBackup # sets an NB_ORA environment variable based on the schedule type. # The NB_ORA variable is then used to dynamically set BACKUP_TYPE # For example, when: # schedule type is # ---------------- # Automatic Full BACKUP_TYPE is -------------INCREMENTAL LEVEL=0 # Automatic Differential Incremental INCREMENTAL LEVEL=1 # Automatic Cumulative Incremental INCREMENTAL LEVEL=1 CUMULATIVE # # For user initiated backups, BACKUP_TYPE defaults to incremental # level 0 (full). To change the default for a user initiated # backup to incremental or incremental cumulative, uncomment # one of the following two lines. # BACKUP_TYPE="INCREMENTAL LEVEL=1" # BACKUP_TYPE="INCREMENTAL LEVEL=1 CUMULATIVE" # # Note that we use incremental level 0 to specify full backups. # That is because, although they are identical in content, only # the incremental level 0 backup can have incremental backups of # level > 0 applied to it. # --------------------------------------------------------------------------if [ "$NB_ORA_FULL" = "1" ] then echo "Full backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=0" elif [ "$NB_ORA_INCR" = "1" ] then echo "Differential incremental backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=1" elif [ "$NB_ORA_CINC" = "1" ] then echo "Cumulative incremental backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=1 CUMULATIVE" elif [ "$BACKUP_TYPE" = "" ] then echo "Default - Full backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=0" fi # --------------------------------------------------------------------------# Call Recovery Manager to initiate the backup. This example does not use a # Recovery Catalog. If you choose to use one, replace the option 'nocatalog' # from the rman command line below with the # 'rcvcat <userid>/<passwd>@<tns alias>' statement. # # Note: Any environment variables needed at run time by RMAN # must be set and exported within the switch user (su) command. # --------------------------------------------------------------------------# Backs up the whole database. This backup is part of the incremental # strategy (this means it can have incremental backups of levels > 0 # applied to it). # # We do not need to explicitly request the control file to be included # in this backup, as it is automatically included each time file 1 of # the system tablespace is backed up (the inference: as it is a whole # database backup, file 1 of the system tablespace will be backed up, # hence the controlfile will also be included automatically). # # Typically, a level 0 backup would be done at least once a week. # # The scenario assumes: # o you are backing your database up to two tape drives # o you want each backup set to include a maximum of 5 files # o you wish to include offline datafiles, and read-only tablespaces, # in the backup # o you want the backup to continue if any files are inaccessible. # o you are not using a Recovery Catalog # o you are explicitly backing up the control file. Since you are # specifying nocatalog, the controlfile backup that occurs # automatically as the result of backing up the system file is # not sufficient; it will not contain records for the backup that # is currently in progress. # o you want to archive the current log, back up all the # archive logs using two channels, putting a maximum of 20 logs # in a backup set, and deleting them once the backup is complete. # # Note that the format string is constructed to guarantee uniqueness and # to enhance NetBackup for Oracle backup and restore performance. # # # NOTE WHEN USING TNS ALIAS: When connecting to a database # using a TNS alias, you must use a send command or a parms operand to # specify environment variables. # through a listener, the environment variables set at the system level are not # visible when RMAN is running. In other words, when accessing a database For more information on the environment # variables, please refer to the NetBackup for Oracle Admin. Guide. # # --------------------------------------------------------------------------CMD_STR=" ORACLE_HOME=$ORACLE_HOME export ORACLE_HOME ORACLE_SID=$ORACLE_SID export ORACLE_SID $RMAN target $TARGET_CONNECT_STR nocatalog msglog $RMAN_LOG_FILE append << EOF RUN { ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE'; Send “ NB_ORA_SERV=vr-master , NB_ORA_CLIENT=oracle ”; BACKUP $BACKUP_TYPE TAG hot_db_bk_level0 FILESPERSET 5 # recommended format FORMAT 'bk_%s_%p_%t' DATABASE; sql 'alter system archive log current'; RELEASE CHANNEL ch00; RELEASE CHANNEL ch01; # backup all archive logs ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE'; Send “ NB_ORA_SERV=backupserver , NB_ORA_CLIENT= 客户机主机名” ; #BACKUP filesperset 20 FORMAT 'al_%s_%p_%t' ARCHIVELOG ALL DELETE INPUT; //备份后删除归档 BACKUP filesperset 20 FORMAT 'al_%s_%p_%t' Archivelog all ; delete noprompt archivelog all completed before "sysdate-15" ; //删除 15 天之前的日志 RELEASE CHANNEL ch00; RELEASE CHANNEL ch01; # # Note: During the process of backing up the database, RMAN also backs up the # control file. This version of the control file does not contain the # information about the current backup because "nocatalog" has been specified. # To include the information about the current backup, the control file should # be backed up as the last step of the RMAN section. # necessary if we were using a recovery catalog. # ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; This step would not be Send “ NB_ORA_SERV=backupserver , NB_ORA_CLIENT= 客户机主机名” ; BACKUP # recommended format FORMAT 'cntrl_%s_%p_%t' CURRENT CONTROLFILE; RELEASE CHANNEL ch00; } EOF " # Initiate the command string if [ "$CUSER" = "root" ] then su - $ORACLE_USER -c "$CMD_STR" >> $RMAN_LOG_FILE RSTAT=$? else /usr/bin/sh -c "$CMD_STR" >> $RMAN_LOG_FILE RSTAT=$? fi # --------------------------------------------------------------------------# Log the completion of this script. # --------------------------------------------------------------------------if [ "$RSTAT" = "0" ] then LOGMSG="ended successfully" else LOGMSG="ended in error" fi echo >> $RMAN_LOG_FILE echo Script $0 >> $RMAN_LOG_FILE echo ==== $LOGMSG on `date` ==== >> $RMAN_LOG_FILE echo >> $RMAN_LOG_FILE exit $RSTAT # 6.2.2 归档备份脚本 #!/bin/sh # $Header: hot_Arch_backup.sh,v 1.2 2002/08/06 23:51:42 $ ## # --------------------------------------------------------------------------# hot_database_backup.sh # --------------------------------------------------------------------------# This script uses Recovery Manager to take a hot (inconsistent) database # backup. A hot backup is inconsistent because portions of the database are # being modified and written to the disk while the backup is progressing. # You must run your database in ARCHIVELOG mode to make hot backups. It is # assumed that this script will be executed by user root. In order for RMAN # to work properly we switch user (su -) to the oracle dba account before # execution. If this script runs under a user account that has Oracle dba # privilege, it will be executed using this user's account. # --------------------------------------------------------------------------# --------------------------------------------------------------------------# Determine the user which is executing this script. # --------------------------------------------------------------------------CUSER=`id |cut -d"(" -f2 | cut -d ")" -f1` # --------------------------------------------------------------------------# Put output in <this file name>.out. Change as desired. # Note: output directory requires write permission. # --------------------------------------------------------------------------RMAN_LOG_FILE=${0}.out # --------------------------------------------------------------------------# You may want to delete the output file so that backup information does # not accumulate. If not, delete the following lines. # --------------------------------------------------------------------------if [ -f "$RMAN_LOG_FILE" ] then rm -f "$RMAN_LOG_FILE" fi # ----------------------------------------------------------------# Initialize the log file. # ----------------------------------------------------------------- echo >> $RMAN_LOG_FILE chmod 666 $RMAN_LOG_FILE # --------------------------------------------------------------------------# Log the start of this script. # --------------------------------------------------------------------------echo Script $0 >> $RMAN_LOG_FILE echo ==== started on `date` ==== >> $RMAN_LOG_FILE echo >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# Replace /db/oracle/product/ora81, below, with the Oracle home path. # --------------------------------------------------------------------------ORACLE_HOME=/db/oracle/product/ora81 export ORACLE_HOME # --------------------------------------------------------------------------# Replace ora81, below, with the Oracle SID of the target database. # --------------------------------------------------------------------------ORACLE_SID=ora81 export ORACLE_SID # --------------------------------------------------------------------------# Replace ora81, below, with the Oracle DBA user id (account). # --------------------------------------------------------------------------ORACLE_USER=ora81 # --------------------------------------------------------------------------# Set the target connect string. # Replace "sys/manager", below, with the target connect string. # --------------------------------------------------------------------------TARGET_CONNECT_STR=sys/manager # --------------------------------------------------------------------------# Set the Oracle Recovery Manager name. # --------------------------------------------------------------------------RMAN=$ORACLE_HOME/bin/rman # --------------------------------------------------------------------------# Print out the value of the variables set by this script. # --------------------------------------------------------------------------echo >> $RMAN_LOG_FILE echo "RMAN: $RMAN" >> $RMAN_LOG_FILE echo "ORACLE_SID: $ORACLE_SID" >> $RMAN_LOG_FILE echo "ORACLE_USER: $ORACLE_USER" >> $RMAN_LOG_FILE echo "ORACLE_HOME: $ORACLE_HOME" >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# Print out the value of the variables set by bphdb. # --------------------------------------------------------------------------echo >> $RMAN_LOG_FILE echo "NB_ORA_FULL: $NB_ORA_FULL" >> $RMAN_LOG_FILE echo "NB_ORA_INCR: $NB_ORA_INCR" >> $RMAN_LOG_FILE echo "NB_ORA_CINC: $NB_ORA_CINC" >> $RMAN_LOG_FILE echo "NB_ORA_SERV: $NB_ORA_SERV" >> $RMAN_LOG_FILE echo "NB_ORA_POLICY: $NB_ORA_POLICY" >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# NOTE: This script assumes that the database is properly opened. If desired, # this would be the place to verify that. # --------------------------------------------------------------------------echo >> $RMAN_LOG_FILE # --------------------------------------------------------------------------# If this script is executed from a NetBackup schedule, NetBackup # sets an NB_ORA environment variable based on the schedule type. # The NB_ORA variable is then used to dynamically set BACKUP_TYPE # For example, when: # schedule type is # ---------------- # Automatic Full BACKUP_TYPE is -------------INCREMENTAL LEVEL=0 # Automatic Differential Incremental INCREMENTAL LEVEL=1 # Automatic Cumulative Incremental INCREMENTAL LEVEL=1 CUMULATIVE # # For user initiated backups, BACKUP_TYPE defaults to incremental # level 0 (full). To change the default for a user initiated # backup to incremental or incremental cumulative, uncomment # one of the following two lines. # BACKUP_TYPE="INCREMENTAL LEVEL=1" # BACKUP_TYPE="INCREMENTAL LEVEL=1 CUMULATIVE" # # Note that we use incremental level 0 to specify full backups. # That is because, although they are identical in content, only # the incremental level 0 backup can have incremental backups of # level > 0 applied to it. # --------------------------------------------------------------------------if [ "$NB_ORA_FULL" = "1" ] then echo "Full backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=0" elif [ "$NB_ORA_INCR" = "1" ] then echo "Differential incremental backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=1" elif [ "$NB_ORA_CINC" = "1" ] then echo "Cumulative incremental backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=1 CUMULATIVE" elif [ "$BACKUP_TYPE" = "" ] then echo "Default - Full backup requested" >> $RMAN_LOG_FILE BACKUP_TYPE="INCREMENTAL LEVEL=0" fi # --------------------------------------------------------------------------# Call Recovery Manager to initiate the backup. This example does not use a # Recovery Catalog. If you choose to use one, replace the option 'nocatalog' # from the rman command line below with the # 'rcvcat <userid>/<passwd>@<tns alias>' statement. # # Note: Any environment variables needed at run time by RMAN # must be set and exported within the switch user (su) command. # --------------------------------------------------------------------------# Backs up the whole database. This backup is part of the incremental # strategy (this means it can have incremental backups of levels > 0 # applied to it). # # We do not need to explicitly request the control file to be included # in this backup, as it is automatically included each time file 1 of # the system tablespace is backed up (the inference: as it is a whole # database backup, file 1 of the system tablespace will be backed up, # hence the controlfile will also be included automatically). # # Typically, a level 0 backup would be done at least once a week. # # The scenario assumes: # o you are backing your database up to two tape drives # o you want each backup set to include a maximum of 5 files # o you wish to include offline datafiles, and read-only tablespaces, # in the backup # o you want the backup to continue if any files are inaccessible. # o you are not using a Recovery Catalog # o you are explicitly backing up the control file. Since you are # specifying nocatalog, the controlfile backup that occurs # automatically as the result of backing up the system file is # not sufficient; it will not contain records for the backup that # is currently in progress. # o you want to archive the current log, back up all the # archive logs using two channels, putting a maximum of 20 logs # in a backup set, and deleting them once the backup is complete. # # Note that the format string is constructed to guarantee uniqueness and # to enhance NetBackup for Oracle backup and restore performance. # # # NOTE WHEN USING TNS ALIAS: When connecting to a database # using a TNS alias, you must use a send command or a parms operand to # specify environment variables. # through a listener, the environment variables set at the system level are not # visible when RMAN is running. # variables, please refer to the NetBackup for Oracle Admin. Guide. In other words, when accessing a database For more information on the environment # # --------------------------------------------------------------------------CMD_STR=" ORACLE_HOME=$ORACLE_HOME export ORACLE_HOME ORACLE_SID=$ORACLE_SID export ORACLE_SID $RMAN target $TARGET_CONNECT_STR append << EOF RUN { sql 'alter system archive log current'; nocatalog msglog $RMAN_LOG_FILE # backup all archive logs ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; ALLOCATE CHANNEL ch01 TYPE 'SBT_TAPE'; Send “ NB_ORA_SERV=backupserver , NB_ORA_CLIENT= 客户机主机名” ; #BACKUP filesperset 20 FORMAT 'al_%s_%p_%t' ARCHIVELOG ALL DELETE INPUT; //备份后删除归档 BACKUP filesperset 20 FORMAT 'al_%s_%p_%t' Archivelog all ; delete noprompt archivelog all completed before "sysdate-15" ; //删除 15 天之前的日志 RELEASE CHANNEL ch00; RELEASE CHANNEL ch01; # # Note: During the process of backing up the database, RMAN also backs up the # control file. This version of the control file does not contain the # information about the current backup because "nocatalog" has been specified. # To include the information about the current backup, the control file should # be backed up as the last step of the RMAN section. This step would not be # necessary if we were using a recovery catalog. # ALLOCATE CHANNEL ch00 TYPE 'SBT_TAPE'; Send “ NB_ORA_SERV=backupserver , NB_ORA_CLIENT= 客户机主机名” ; BACKUP # recommended format FORMAT 'cntrl_%s_%p_%t' CURRENT CONTROLFILE; RELEASE CHANNEL ch00; } EOF " # Initiate the command string if [ "$CUSER" = "root" ] then su - $ORACLE_USER -c "$CMD_STR" >> $RMAN_LOG_FILE RSTAT=$? else /usr/bin/sh -c "$CMD_STR" >> $RMAN_LOG_FILE RSTAT=$? fi # --------------------------------------------------------------------------# Log the completion of this script. # --------------------------------------------------------------------------if [ "$RSTAT" = "0" ] then LOGMSG="ended successfully" else LOGMSG="ended in error" fi echo >> $RMAN_LOG_FILE echo Script $0 >> $RMAN_LOG_FILE echo ==== $LOGMSG on `date` ==== >> $RMAN_LOG_FILE echo >> $RMAN_LOG_FILE exit $RSTAT # 6.3 创建 Policy 6.3.1 新建 policy 选择左列中 Policy 右键,选择新建策略,在弹出对话框中输入信息 6.3.2 修改 Attributes 指定 Policy type 和 Policy storage unit 6.3.3 修改 schedule 创建备份的 Schedules,双击 Schedules,修改启动时间、备份周期及数据保存周期 6.3.4 指定备份的 Client 6.3.5 指定备份脚本 配置完成。 6.4 恢复 Oracle 6.4.1 本机恢复 6.4.1.1 查找备份集 找到需要恢复的备份集,在备份服务器上执行如下命令: bplist -C cy06s -S backupserver -t 4 -R -l / 6.4.1.2 恢复 spfile 启动 RMAN rman target / rman>run { allocate channel c1 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06s'; restore spfile from 'c-s436-p1'; release channel c1; } 6.4.1.3 启动数据库 启动数据库到 nomount 状态: sqlplus /nolog conn /as sysdba sql> startup nomount 6.4.1.4 恢复控制文件 启动 RMAN rman target / rman>run { allocate channel c1 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06s'; restore controlfile from 'contr-s436-p1'; release channel c1; } 6.4.1.5 恢复数据文件 rman>run { allocate channel c1 type 'sbt_tape'; allocate channel c2 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06'; restore database; release channel c1; release channel c2; } 6.4.1.6 日志回滚 rman>run { allocate channel c1 type 'sbt_tape'; allocate channel c2 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06s'; recover database; release channel c1; release channel c2; } 6.4.1.7 启动数据库 alter database open resetlogs; 或者 recover database until cancel using backup controlfile; OPEN 数据库,并重置日志文件 6.4.2 异机恢复 6.4.2.1 创建权限 首先在备份服务器,建立文件允许异机恢复 /usr/openv/netbackup/db/altnames/No.Restrictions 6.4.2.2 创建参数文件 创建一个新的参数文件和原机器的配置一致,可以通过拷贝完成。 按照参数文件中的内容创建相应的目录和权限。 启动数据库到 nomount 状态: sqlplus /nolog conn /as sysdba sql> startup nomount 6.4.2.3 查找备份集 找到需要恢复的备份集,在备份服务器上执行如下命令: bplist -C cy06s -S backupserver -t 4 -R -l / 6.4.2.4 恢复 spfile 启动 RMAN rman target / rman>run { allocate channel c1 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06s'; restore spfile from 'c-s436-p1'; release channel c1; } 6.4.2.5 恢复控制文件 启动 RMAN rman target / rman>run { allocate channel c1 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06s'; restore controlfile from 'contr-s436-p1'; release channel c1; } 6.4.2.6 mount 数据库 rman>Alter database mount; 根据控制文件,建立相关目录:数据文件目录、日志文件 SQL> select file#,name from v$datafile; 可以创建数据文件的路径,也可以重定向数据文件 HH. 无需重定向 rman>run { allocate channel c1 type 'sbt_tape'; allocate channel c2 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06'; restore database; resore archivelog all ; release channel c1; release channel c2; } II. 重定向数据文件 rman>run { allocate channel c1 type 'sbt_tape'; allocate channel c2 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=ycoracle9'; set newname for datafile 1 to '/home7/oracle10/oradata/ora9i/system01.dbf'; set newname for datafile 2 to '/home7/oracle10/oradata/ora9i/undotbs01.dbf'; set newname for datafile 3 to '/home7/oracle10/oradata/ora9i/sysaux01.dbf'; set newname for datafile 4 to '/home7/oracle10/oradata/ora9i/users01.dbf'; set newname for datafile 5 to '/home7/oracle10/oradata/ora9i/tools01.dbf'; set newname for datafile 6 to '/home7/oracle10/oradata/ora9i/cyrc01.dbf'; set newname for datafile 7 to '/home7/oracle10/oradata/ora9i/zyrj01.dbf'; set newname for datafile 8 to '/home7/oracle10/oradata/ora9i/super01.dbf'; set newname for datafile 9 to '/home7/oracle10/oradata/ora9i/super02.dbf'; set newname for datafile 10 to '/home7/oracle10/oradata/ora9i/gengsy01.dbf'; set newname for datafile 11 to '/home7/oracle10/oradata/ora9i/wangyy01.dbf'; set newname for datafile 12 to '/home7/oracle10/oradata/ora9i/tbs_stream01.dbf'; restore database; switch datafile all; release channel c1; release channel c2; } 6.4.2.7 日志回滚 rman>run { allocate channel c1 type 'sbt_tape'; allocate channel c2 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06s'; recover database; release channel c1; release channel c2; } 6.4.2.8 启动数据库 alter database open resetlogs; 或者 recover database until cancel using backup controlfile; OPEN 数据库,并重置日志文件 6.4.3 图形界面恢复 首先恢复控制文件 启动 RMAN rman target / rman>run { allocate channel c1 type 'sbt_tape'; send 'nb_ora_serv=backupserver,nb_ora_client=cy06s'; restore controlfile from 'contr-s436-p1'; release channel c1; } Mount 数据库: 然后打开图形界面 /usr/openv/netbackup/bin/jbpSA 选择属性: 登陆界面 选择数据库恢复,选择 restore 开始恢复: 第7章 MS-Sql 备份与恢复 7.1 确认主机访问 在开始菜单中打开 NetBackup MS SQL Client ,弹出下面窗口, 点击菜单 File 选择 Set SQL Server connection properties 在此菜单中点击 Apply ,查看是否能识别到 SQL Server 的信息,检查成功后点击 Close 7.2 创建备份脚本 7.2.1 全备份脚本 在开始菜单中打开 NetBackup MS SQL Client ,弹出下面窗口, 点击菜单 File 选择 Backup SQL Server objects 选择要备份的数据库文件, 选择 Type of Backup ,选择 Backup script 为 Save,点击 Backup 给备份脚本命名及保存 确认备份信息 7.2.2 增量备份脚本 创建一个增量备份的脚本 给备份脚本命名及保存 7.3 创建 Policy 7.3.1 新建 policy 选择左列中 Policy 右键,选择新建策略,在弹出对话框中输入信息 7.3.2 修改 Attributes 指定 Policy type 和 Policy storage unit Policy type : ms-sql-server 7.3.3 修改 schedule 创建备份的 Schedules,双击 Schedules,修改启动时间、备份周期及数据保存周期 7.3.4 指定备份的 Client 7.3.5 指定备份脚本 配置完成。 7.4 MS-SQL恢复 7.4.1 创建权限 在 Master Server 下创建以下文件允许异地恢复 C:\Program Files\veritas\netbackup\db\altnames 7.4.2 创建脚本 在开始菜单中打开 NetBackup MS SQL Client ,弹出下面窗口,点击 objects 在 SQL Host 里面选择或直接输入要恢复备份的机器主机名 Restore SQL Server 选择要备份的数据库,在 Recovered,点击 Restore Scripting 中选择 Create a move template,在 Recovered 里选择 保存脚本 点击 Yes 编辑脚本 7.4.3 修改脚本 下面是修改前的脚本 # This is a template for the database MOVE command. OPERATION RESTORE OBJECTTYPE DATABASE RESTORETYPE MOVE # Replace the database name in the following line with the name of the database that you # want to move to. Also remove the hash mark <#> which precedes the keyword <DATABASE>. # #DATABASE "Babylon_IV_SudaCad_2007_SDP" (删除此行前面的 # ) # # Replace the file path <D:\MSSQL\Data\Babylon_IV_SudaCad_2007_SDP.mdf> # with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>. # The target of the MOVE keyword must be "Babylon_IV_Data". MOVE #TO "Babylon_IV_Data" "D:\MSSQL\Data\Babylon_IV_SudaCad_2007_SDP.mdf" ( 到其它路径,请修改 删除此行前面的 # ,如要保存 ) # # # Replace the file path <D:\MSSQL\Data\Babylon_IV_SudaCad_2007_SDP_log.ldf> # with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>. # The target of the MOVE keyword must be "Babylon_IV_Log". MOVE #TO "Babylon_IV_Log" "D:\MSSQL\Data\Babylon_IV_SudaCad_2007_SDP_log.ldf" ( 存到其它路径,请修改 删除此行前面的 #,如要保 ) # # The following image is type: Full NBIMAGE "finance_srv_02.MSSQL7.FINANCE_SRV_02.db.Babylon_IV_SudaCad_2007_SDP.~.7.001of00 1.20080812000014..C" SQLHOST "sudatel_server" NBSERVER "KHS_SRV_MST" BROWSECLIENT "FINANCE_SRV_02" MAXTRANSFERSIZE 6 BLOCKSIZE 7 RESTOREOPTION REPLACE RECOVEREDSTA TE RECOVERED NUMBUFS 2 ENDOPER TRUE 修改完成后保存脚本 第8章 虚拟机备份与恢复 如果备份 vmware 的服务器不是 windows,需要额外安装一台 windows 下的 media server 8.1 安装 media server 点击 nbu 安装文件: 执行默认安装: 点击 Netbackup Media server : 输入 master server 名: 开始安装: 完成安装: 点击主机属性, master server: 添加 media server: 设置 media server 设备: 开始扫描设备: 发现带库和机械臂: 下一步: 列出扫描的设备: 勾选驱动器和机械臂: 开始配置 配置机械手: 完成配置: 扫描磁带: 扫描设备: 选择需要配置的磁带: 完成磁带配置: 8.2 配置虚拟机备份 添加虚拟机备份主机: 添加 vc 或者 esx server 主机名: 添加主机名: 添加授权管理账户和密码: 验证成功: 8.3 虚拟机备份 8.3.1 策略建立 建立虚拟机备份策略: 选择相应的备份策略: 备份方式:全备份 选择需要备份的虚拟机: 搜索虚拟机: 发现虚拟机: 选择需要备份虚拟机: 完全备份: 8.3.2 执行备份 手动开始执行备份: 监控器可以看见备份: 备份完成: 8.4 虚拟机恢复 选择恢复界面: 选择备份的虚拟机名称: 选择虚拟机备份类型: 列出虚拟机备份文件: 点击 restore,跳出虚拟机恢复向导,选择自定义恢复: 选择恢复到的 esx server ,恢复的存储: 检查磁盘空间状态: 选择网络: 选择 run pre-recovery check ,检查是否符合恢复条件: 点击 start recovery,开始恢复 查看恢复进度: 恢复成功: 查看 esx server 恢复的虚拟机,虚拟机能够正常启动。 第9章 系统备份与恢复 9.1 建立 BMR主服务器 9.1.1 windows 安装 BMR主服务器 首先执行 bare metal Restore 建立 BMR 数据库 –master server setup 向导: MBR 主服务器就建好了 9.1.2 Linux/Unix 安装 BMR主服务器 在服务器下执行如下命令: /usr/openv/netbackup/bin/bmrsetupmaster Starting the NetBackup Bare Metal Restore daemon. [Info] V-127-41 Setting up BMR Database ... [Info] V-127-38 Initializing BMR database ... [Info] V-127-39 Loading BMR database ... [Info] V-127-42 bmrsetupmaster succeeded. bmr 数据库创建完成。 9.2 配置资源树 9.2.1 windows 配置 9.2.1.1 网路引导资源树 在服务器上执行如下命令 C:\program files\veritas\netbackup\bin\bmrsetupboot 完成后建立资源树,用于通过网络启动服务器 –register 点击 shared resource Tree Administration wizard 打开向导开始建立资源树: 开始建立资源树: 建立快速恢复资源树: 选择 64 位还是 32 位资源树,资源树名,以及保存路径: 这里选择 bmr 启动文件: 在 nbu 安装文件下 开始创建资源树: 把客户端加入到资源树中: 这里选择 nbu 客户端包 开始创建: 资源树创建完成: 打开向导添加驱动,点击 开打向导: 选择驱动文件: driver package wizard : 识别加载的驱动,点击下一步,加载驱动完成: 9.2.1.2 光盘引导资源树 打开资源树配置向导,选择创建 选择刚才建立的资源树: boot cd: 选择 iso 文件的路径: 光盘引导资源树的名: 光盘文件创建完成,拷贝 iso 文件刻成光盘: 9.2.2 Linux/Unix 配置 9.2.2.1 AIX 下创建资源树 tftp 服务和 bootp 服务必须可用。 ,这两项服务在 /etc/inetd.conf 文件中被注释掉。 必须取消对这两项服务的注释,然后刷新 inetd, BMR 引导服务器才能正常运行 在服务器下执行如下命令,如下所示: /usr/openv/netbackup/bin/bmrsetupboot –register 创建资源树 usr/openv/netbackup/bin/bmrsrtadm <nbu_520>:#./bmrsrtadm Select one of the following options: 1. Create a new Shared Resource Tree. 2. Create a new CD image based Shared Resource Tree. 3. Copy an existing Shared Resource Tree to a new location. 4. Import a Shared Resource Tree. 5. Modify an existing Shared Resource Tree. 6. Delete an existing Shared Resource Tree. 7. List Shared Resource Trees available on this server. 8. Quit. Enter your selection (1-8) [1] : 1 Enter the name of the SRT to create : aix5310 Enter the description of the new SRT : aix5310 netboot Enter desired OS level of AIX (5.1, 5.2, 5.3 or 6.1) [5.3] : Enter the desired architecture (32/64) [64] : Enter the directory in which to place the new SRT [/export/srt] : Source of AIX install images [/dev/cd0] : [Info] V-125-202 Installing AIX OS filesets. x ./ x ./bosinst.data x ./image.data x ./lpp_name 开始加载系统文件。 。。。 /opt/openv/srt/srtnet/5310 (放入 5310 的系统盘) installp: ***ATTENTION!!! Software changes processed during this session require any diskless/dataless clients to which this SPOT is currently allocated to be rebooted. Preparing boot files - please stand by... Enter the source of the Symantec NetBackup install images. Specify a device name or an NFS path (host:/path form), [/soft/NetBackup_7.1_CLIENTS] : or a local directory /soft/NetBackup_7.1_CLIENTS/NetBackup_7.1_CLIENTS (指定 nbu client 的安装文件) Symantec Installation Script Copyright 1993 - 2011 Symantec Corporation, All Rights Reserved. Installing NetBackup Client Software Do you wish to continue? [y,n] (y) Do you want to install the NetBackup client software for this client ? [y,n] (y) This package will install RS6000/AIX53 client. This package will install NetBackup client 7.1. Enter the name of the NetBackup server : nbu_520 Would you like to use "nbu_520" as the configured name of the NetBackup client? [y,n ] (y) Installing PBX... Please wait while installation is in progress... Installation completed Successfully Installation log located here: /var/tmp/installpbx-569366-102411134611.log Unpacking SYMCnbclt package. Checking for pre-existing SYMCnbclt package. Installing SYMCnbclt package. Installation of SYMCnbclt was successful. More details regarding SYMCnbclt can be found in file /tmp/install_cltpkg_trace.626778 on nbu_520. Checking network connections. DNS Lookup failed for host nbu_520 error:8! bp.conf: IP_ADDRESS_FAMIL Y = AF_INET: default value, no update needed No [x]inetd process found. File /usr/openv/tmp/install_trace.548904 contains a trace of this install. That file can be deleted after you are sure the install was successful. [Info] V-125-668 SRT "aix5310" has been initialized successfully. -----------------------------------------------------------------------------SRT name: aix5310 Location: aix5310 Description: aix5310 Exclusive use: aix5310 -----------------------------------------------------------------------------You may make modifications to this SRT. Select one of the following options: 1. Install Symantec NetBackup Maintenance Pack. 2. Install Veritas V olume Manager and Veritas File System. 3. Update Veritas Volume Manager and Veritas File System. 4. Install Veritas Security Services. 5. Install maintenance levels (MLs) OR additional filesets. 6. Change SRT description. 7. Change client exclusive use of this SRT. 8. Quit. Enter your selection (1-8) [8] : [Info] V-125-669 SRT "aix5310" has been created successfully. <nbu_520>:#./bmrsrtadm Select one of the following options: 1. Create a new Shared Resource Tree. 2. Create a new CD image based Shared Resource Tree. 3. Copy an existing Shared Resource Tree to a new location. 4. Import a Shared Resource Tree. 5. Modify an existing Shared Resource Tree. 6. Delete an existing Shared Resource Tree. 7. List Shared Resource Trees available on this server. 8. Quit. 选择 1 可以创建 boot cd 引导光盘 9.2.2.2 Linux 下创建资源树 在服务器下执行如下命令,如下所示: 执行命令前,请打开 tftpd , dhcp :/usr/openv/netbackup/bin # ./bmrsetupboot -register [Warning] V-127-64 tftpd service is not active. Please verify TFTPD server is installled and [X]INETD is properly configured. This is required in order to do BMR network boot based client restore. V-128-292 Cannot open "/etc/dhcpd.conf" for input: No such file or directory V-128-577 Error loading "/etc/dhcpd.conf" file. Please be sure the DHCPD server package is correctly installed and configured. [Warning] V-127-65 Error loading the DHCP configuration file. Please be sure the DHCPD server package is correctly installed and configured. This is required in order to do BMR network boot based client restore. [Info] V-127-76 Setting up BMR boot server completed successfully. ./bmrsrtadm Select one of the following options: 1. Create a new Shared Resource Tree. 2. Create a new CD image based Shared Resource Tree. 3. Copy an existing Shared Resource Tree to a new location. 4. Import a Shared Resource Tree. 5. Modify an existing Shared Resource Tree. 6. Delete an existing Shared Resource Tree. 7. List Shared Resource Trees available on this server. 8. Quit. Enter your selection (1-8) [1] : Enter the name of the SRT to create : susei386net Enter the description of the new SRT : suse 10 sp1 Enter the directory in which to place the new SRT [/export/srt] : /usr/openv/srt/srtnet/ Creating repository to stow files from distribution media. The following media is required: SUSE Linux Enterprise Server 10 (x86-64) - disc 1 Please load the media now. Load media from (? for help) [/dev/disk/by-id] : /mnt (放入系统安装光盘) Extracting files ............................................................. ok. The following media is required: Symantec BMR Third-Party Products CD (3PPCD) Please load the media now. Load media from (? for help) [/dev/cdrom] : /mnt (放入第三方安装光盘) Working ... ok. The media repository is now complete. Working ....................................................... ok. Working ....................... ok. Preparing boot files - please stand by... The following media is required: NetBackup Client Please load the media now. Load media from (? for help) [/dev/cdrom] : /soft/NetBackup_7.1_CLIENTS 的安装文件) Mounting media ... ok. The NetBackup Client installation script will run now. Symantec Installation Script Copyright 1993 - 2011 Symantec Corporation, All Rights Reserved. Installing NetBackup Client Software Do you wish to continue? [y,n] (y) Do you want to install the NetBackup client software for this client? [y,n This package will install Linux/SuSE2.6.16 client. ] (y) (指定 nbu 客户端 This package will install NetBackup client 7.1. Enter the name of the NetBackup server : nbu_520 Would you like to use "mdc02" as the configured name of the NetBackup client? [y,n] (y) Installing PBX... Please wait while installation is in progress... Installation completed Successfully Installation log located here: /var/tmp/installpbx-18268-102511101047.log Unpacking SYMCnbclt package. Checking for pre-existing SYMCnbclt package. Installing SYMCnbclt package. Installation of SYMCnbclt was successful. More details regarding SYMCnbclt can be found in file /tmp/install_cltpkg_trace.18190 on mdc02. Checking network connections. DNS Lookup failed for host mdc02 error:-3! bp.conf: IP_ADDRESS_FAMIL Y = AF_INET: default value, no update needed No [x]inetd process found. File /usr/openv/tmp/install_trace.18096 contains a trace of this install. That file can be deleted after you are sure the install was successful. The NetBackup Client installation script has completed. Unmounting media ... ok. [Info] V-125-668 SRT "susei386net" has been initialized successfully. -----------------------------------------------------------------------------SRT name: susei386net Location: /usr/openv/srt/srtnet/susei386net Description: suse 10 sp1 Exclusive use: (none) -----------------------------------------------------------------------------You may make modifications to this SRT. Select one of the following options: 1. Install Symantec NetBackup Maintenance Pack. 2. Install Veritas V olume Manager and Veritas File System. 3. Update Veritas Volume Manager and Veritas File System. 4. Install Veritas Security Services. 5. Install additional patches/drivers. 6. Change SRT description. 7. Change client exclusive use of this SRT. 8. Quit. Enter your selection (1-8) [8] : [Info] V-125-669 SRT "susei386net" has been created successfully. mdc02:/usr/openv/netbackup/bin # mdc02:/usr/openv/netbackup/bin # mdc02:/usr/openv/netbackup/bin # 创建 boot cd 启动光盘: :/usr/openv/netbackup/bin # ./bmrsrtadm Select one of the following options: 1. Create a new Shared Resource Tree. 2. Create a new CD image based Shared Resource Tree. 3. Copy an existing Shared Resource Tree to a new location. 4. Import a Shared Resource Tree. 5. Modify an existing Shared Resource Tree. 6. Delete an existing Shared Resource Tree. 7. List Shared Resource Trees available on this server. 8. Quit. Enter your selection (1-8) [1] : 2 Enter the name of an existing SRT : susei386net (前面创建的资源树的名) Enter the name of the new SRT to create : susei386iso Enter the description of the new SRT [suse 10 sp1] : Enter the directory in which to place the new SRT CD image [/usr/openv/srt/srtnet] /usr/openv/srt/srtiso (存放路径) Warning: Creating ISO-9660:1999 (version 2) filesystem. Warning: ISO-9660 filenames longer than 31 may cause buffer overflows in the OS. [Info] V-125-718 Media image has been successfully created. : 9.3 配置系统备份策略 9.3.1 新建 policy 选择左列中 Policy 右键,选择新建策略,在弹出对话框中输入信息 9.3.2 修改 Attributes 指定 Policy type 和 Policy storage unit, 选择收集 BMR 信息 Ploicy type : windows-----Ms-Windows Unix/linux ---standard 9.3.3 修改 schedule 修改备份的 Schedules,双击 Schedules,修改启动时间、备份周期及数据保存周期 9.3.4 指定备份的 Client 9.3.5 指定备份选项 配置完成。 设置好后,执行备份。 9.3.6 查看备份信息 备份成功后,就可以在 BMR 管理中看见备份的客户端的系统的信息。 9.4 系统恢复 9.4.1 windows BMR恢复 9.4.1.1 本机恢复 打开管理界面 执行恢复,首先选择需要恢复的服务器的主机名 右键需要恢复的客户端 prepare to restore 开始执行恢复,资源树选择光盘引导资源树: 然后看见恢复系统的进程处于等待状态 , 客户端操作 把启动光盘放到需要恢复的服务器光驱,开始启动服务器: 系统开始通过光盘启动 弹出配置界面 ,选择以前这台机器的网卡的配置信息,并填写 成后,点击 contact nbu master 的 ip 地址,填写完 master server: 显示连接上 master server 刚才运行的恢复任务,点击 restore clinet : 查看分区 : 开始执行恢复: 系统恢复完成,进入系统,等待完全恢复后,重启系统: 整个恢复完成,在主服务器的监视器可以看见完成恢复的信息。 恢复成功: 9.4.1.2 异机恢复 异机恢复,在主服务器建立文件,允许异机恢复: install_path\NetBackup\db\altnames\No.Restrictions 找到需要原机器的配置信息,然后右击新建一个配置: 更改恢复到新机器的 ip 地址, mac 地址,路由,分区等信息: 然后执行恢复,光盘引导,与上述配置一样。 9.4.2 aix BMR 恢复 在 bmr 管理界面中找到需要恢复的客户端,右击恢复,选择对应的资源树: 恢复任务开始: 登陆到需要恢复的服务器,开机选择 选择 2, setup Remote IPL 1,到 SMS Menu : 选择对应的网卡: 选择 1, ipv4 模式: 选择 1, BOOTP 选择 1, ip parameters: 编辑 ip 地址, Server ip Adderss 是 boot server 的地址,编辑完成,选择 选择 5, boot options: M 回到主界面 选择 1, install/boot device: 选择 6, network 选择 1, BOOTP : 选择网卡 选择 2, Normal Mode Boot : 选择 1,退出,开始网卡启动: 开始连接,并执行恢复: 开始创建 vg,并开始恢复: 9.4.3 linux BMR 恢复 首先在主服务器运行恢复进程, 然后在需要恢复的服务器上, 重启机器,开始引导: 填写客户端的 ip 地址, boot server 的 ip 地址,回车开始恢复 放入刻录好的启动光盘, 然后 开始加载资源树: 开始恢复: 恢复程序正在恢复根文件系统: 恢复完成,提示重启 重启后文件系统开始自我修复: 第10章 Informix 备份与恢 复 10.1 Informix 配置 Informix 连接 NBU 备份软件链接库 在目录 /usr/openv/netbackup/bin/ 执行 ./Informix_config 确认文件 Informix etc/sm_versions 文件(格式如下) 1|1.1.0|Veritas-NetBackup|1 确认 BAR_BSALIB_PA TH 为空或者是 / usr/openv/netbackup/bin/infxbsa.[so,sl,a] 10.2 Informix 脚本配置 #!/bin/sh # $Revision: 1.3 $ #bcpyrght #************************************************************************** * #* $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $* #************************************************************************** * #ecpyrght # Replace xxxxx below with the extention used for your onconfig file. ONCONFIG=onconfig.xxxxx ( informix 配置文件名) # Replace yyyyy below with the Informix home path. (安装 informix 目录) INFORMIXDIR=/yyyyy/Informix # Replace zzzzz below with the name of the Informix server. INFORMIXSERVER=zzzzz ( informix server 名) # Replace informix_etc below with the name of the NetBackup server policy # to be used to back up the $INFORMIXDIR/etc directory. INFX_ETC_POLICY=informix_etc (备份配置文件的策略名) echo "Started `date`" export ONCONFIG echo "exported ONCONFIG" export INFORMIXDIR echo "exported INFORMIXDIR" export INFORMIXSERVER echo "exported INFORMIXSERVER" echo "INFXBSA_SERVER = $INFXBSA_SERVER" echo "INFXBSA_SCHEDULED = $INFXBSA_SCHEDULED" echo "INFXBSA_USER_INITIATED = $INFXBSA_USER_INITIATED" echo "INFXBSA_FULL = $INFXBSA_FULL" echo "INFXBSA_INCR = $INFXBSA_INCR" echo "INFXBSA_POLICY = $INFXBSA_POLICY" RETURN_STATUS=0 if [ "${INFXBSA_INCR}" = "1" ] then # Netbackup has started an incremental backup. echo "$INFORMIXDIR/bin/onbar -b -w -L 1" $INFORMIXDIR/bin/onbar -b -w -L 1 RETURN_STATUS=$? else echo "$INFORMIXDIR/bin/onbar -b -w -L 0" $INFORMIXDIR/bin/onbar -b -w -L 0 RETURN_STATUS=$? # Initiate a backup of the directory that contains the onconfig, # sqlhosts, oncfg_$INFORMIXSERVER.SERVERNUM, and ixbar.SERVERNUM # files after doing the level 0 backup. echo "bpbackup -p $INFX_ETC_POLICY $INFORMIXDIR/etc" /usr/openv/netbackup/bin/bpbackup -p $INFX_ETC_POLICY $INFORMIXDIR/etc BPBACKUP_STATUS=$? if [ "$BPBACKUP_STATUS" -ne 0 ] then echo "" echo "bpbackup of $INFORMIXDIR/etc returned $BPBACKUP_STATUS" fi fi echo "Finished `date`" echo "exit $RETURN_STATUS" echo "" exit $RETURN_STATUS 10.3 策略制定 10.3.1 数据库备份 打开管理控制台,右键新建策略: 选择 policy type 为: informix-On-BAR 选择对应的磁带库和备份池 点击 apply 制定备份时间 填写时间名 Name 保存周期 Retention 发生频率 Frequency 填写客户端的主机名: 填写脚本的绝对路径,备份策略制定完成。 10.3.2 配置文件备份 新建策略,策略名为脚本中定义的名: # Replace informix_etc below with the name of the NetBackup server policy # to be used to back up the $INFORMIXDIR/etc directory. INFX_ETC_POLICY= informix_etc 新建策略名 informix_etc Policy type :Standard (备份配置文件的策略名) 日程表:备份类型选择 User Backup 填写客户端的主机名 这里的备份内容为空。 10.3.3 日志备份 Informix 日志备份说明 一般情况下我们使用一个数据库备份策略进行 一个文件备份策略来备份 Informix 数据库的备份, Informix 关键文件,数据都备份到磁带库。 这种情况下,当数据库日志满后触发数据库日志备份时,会选择数据库备份 策略来执行, 如果数据库比较繁忙,频繁的日志备份会导致频繁的磁带库的动作,既没有 效率也减少硬件使用寿命。 比较好的解决方法是使用独立的策略备份 Informix 逻辑日志, 将日志备份到 本地的磁盘存储单元,再通过磁盘存储单元的 staging schedule复制到磁带。 1. 创建 Informix-On-Bar 类型的备份策略,使用磁盘存储单元,不需要创建 用户的 schedule, 备份列表为空就可以; 2. 修改 Informix 数据库服务器的 /etc/log_full.sh,指定逻辑日志备份策略名: INFXBSA_LOGICAL_POLICY=Informix-log export INFXBSA_LOGICAL_POLICY 下面是 /etc/log_full.sh 的一个例子: #!/bin/sh ################################################################# ########## # # Licensed Material - Property Of IBM # # "Restricted Materials of IBM" # # IBM Informix Dynamic Server # (c) Copyright IBM Corporation 1996, 2004 All rights reserved. # # Title: log_full.sh # # Description Automates logical log backup using event alarms from the # database server. To install this script, add the following # line to the ONCONFIG file - # ALARMPROGRAM /etc/log_full.sh # where is replaced by the full value of # $INFORMIXDIR # ################################################################# #############/ PROG=`basename $0` USER_LIST=informix BACKUP_CMD="onbar -b -l" EXIT_STATUS=0 EVENT_SEVERITY=$1 EVENT_CLASS=$2 EVENT_MSG="$3" EVENT_ADD_TEXT="$4" EVENT_FILE="$5" INFXBSA_LOGICAL_POLICY=Informix-log export INFXBSA_LOGICAL_POLICY case "$EVENT_CLASS" in 23) # onbar assumes no operator is present, # so all messages are written to the activity # log and there shouldn't be any output, but # send everything to /dev/null just in case $BACKUP_CMD 2>&1 >> /dev/null EXIT_STATUS=$? ;; # One program is shared by all event alarms. If this ever gets expanded to # handle more than just archive events, uncomment the following: *) # EXIT_STATUS=1 ;; esac exit $EXIT_STATUS 3. 修 改 Informix 数 据库 服 务 器 的 ONCONFIG 配 置 文 件, 将 "ALARMPROGRAM" 参数指向 log_full.sh, 例如 : ALARMPROGRAM /home/informix/etc/log_full. 10.4 Informix 恢复 10.4.1 本机恢复 在主服务器上键入 bplist –C client –t 6 –s mm/dd/yyyy HH:MM:SS -e mm/dd/yyyy HH:MM:SS –R /(查看有没有可供恢复的备份 ) 一.恢复最近时间点的备份: a. 以 informix 用户登录测试主机; b. 执行物理恢复 (恢复数据库文件) IBMTEST:/home/informix>onbar c. 执行逻辑恢复 –r -p (恢复日志文件) IBMTEST:/home/informix> onbar –r - l 恢复结束后数据库状态为 fastrecover 状态 执行 onmode –m hunk 变为 po .等没有 io 后执行 onmode –d standard 二,恢复选定时间点的备份: a. 以 informix 用户登录测试主机; b. 执行物理恢复 (恢复数据库文件) IBMTEST:/home/informix>onbar –r -p -t “yyyy -mm- dd hh:mm:ss” c. 执行逻辑恢复 (恢复日志文件) IBMTEST:/home/informix> onbar –r - l 10.4.2 -t “yyyy - mm-dd hh:mm:ss” 异机恢复 前提条件:生产主机和测试主机的 informix 的数据结构应该保持完全一致。 1.在 master server上建立文件,用于异机恢复 : /usr/openv/netbackup/db/altnames/No.Restrictions 2.关闭生产主机和测试主机的数据库,以 informix 用户进入。 IBMTEST:/home/informix> onmode –ky 3. 将 生 产 主 机 上 的 /home/Informix/etc 下 的 四 个 文 件 拷 贝 到 测 试 主 机 的 /home/Informix/etc, 四个文件如下: /home/informix/etc/ixbar.0 (此文件应该与恢复的数据时间保持一致性 ) /home/Informix/etc/union.cfg (此文件中的 IP 改成测试主机的 IP,其余不变) /home/Informix/etc/sqlhosts /home/Informix/etc/oncfg_union.0 4.为了保持随时恢复任何过去某个时间点的数据,应该备份对应时间的 ixbar.0 在 MASTER SERVER 上建立 POLICY 进行备份。 5. 在测试主机 IBMTEST 上更改相应的环境变量: INFXBSA_CLIENT= ( 生产主机的主机名 ) INFXBSA_SERVER= INFXBSA_POLICY= (生产主机备份对应的 POLICY) INFXBSA_SCHED=Default-Application-Backup export INFXBSA_POLICY export INFXBSA_SCHED export INFXBSA_CLIENT export INFXBSA_SERVER 在 测 试 机 上 键 入 bplist –C 源 主 机 名 –t 6 –s mm/dd/yyyy HH:MM:SS mm/dd/yyyy HH:MM:SS 6. 执行异机恢复命令 –R /(查看有没有可供恢复的备份 ) -e 一.恢复最近时间点的备份: a. 以 informix 用户登录测试主机; b. 执行物理恢复 (恢复数据库文件) IBMTEST:/home/informix>onbar c. 执行逻辑恢复 –r -p (恢复日志文件) IBMTEST:/home/informix> onbar –r - l 二,恢复选定时间点的备份: a. 以 informix 用户登录测试主机; b. 执行物理恢复 (恢复数据库文件) IBMTEST:/home/informix>onbar c. 执行逻辑恢复 –r -p -t “yyyy -mm- dd hh:mm:ss” (恢复日志文件) IBMTEST:/home/informix> onbar –r - l -t “yyyy - mm-dd hh:mm:ss” 第11章 DB2 备份与恢复 11.1 参数设置 连接数据库: Windows 将 C:\Program Files\Veritas\NetBackup\DbExt\DB2\db2uext2.exe unix : /usr/openv/netbackup/bin 复制到 D:\SQLLIB\BIN ./db2_config 装完 client 执行命令 /usr/openv/netbackup/bin ./db2_config please specify the DB2 instance home path name:( 主路径名称) 1.主路径名称 Do you have other DB2 instances 2.根据需要添加其他 DB2 实例 将示例 db2.conf 文件从其所在的示例目录位置复制到活动位置。 它在示例目录中的位置如下所示: /usr/openv/netbackup/ext/db_ext/db2/scripts db2.conf 文件的活动位置如下所示: $DB2_Instance_Home/db2.conf 查看参数 JJ. 进入命令中心 , 查看现有数据库 KK. 查询数据目录和数据库名 列出现有实例名: ,使用命令 db2ilist :db2 list db directory LL. 连接数据库: db2 connect to NBU MM. 查看数据库当前的参数 :db2 get db cfg 如果要做在线的备份: 要对两个参数作修改: USEREXIT 和 LOGRETAIN ,将其修改为 使用循环日志模式,修改完参数后,可以变为归档日志模式,启用了 on, 他们默认是 userexit 做数据库日志的 归档 设置参数据 userexit 参数为 ON: db2 update db cfg for db_name using userexit on 设置参数 logretain 为 on: db2 update db cfg for db_name using logretain on 停掉应用使参数生效 :db2 force application all 此时需要做一次离线的全备。否则数据是 backup pending 使数据库能够做到增量备份。必须要修改 trackmod 修改日成文件存放路径 状态的 , 无法联结 为 on 状态,并有一次完全备份 : db2 update db cfg for NBU using NEWLOGPATH D:\DB2LOG 再次查看当前的数据库状态 : db2 get db cfg NBU 备份 DB2 方法之比较 (如果有磁带库,建议采用方法 3 ,如果是备份到磁盘( 1 , 2 方法都可以) off 的,默认 方法 1 :使用 LOGARCHMETH1 = "VENDOR.." 对于日志的备份类似于 参数 ,versions 8.2 and above 必须保证有空闲磁带机, informix NBU 中 DB2 全备份与日志备份策略是关联的, 当日志备份起动时也会发起 DB 的备份最好采用增量方式,恢复时可以直接作 方法 2 :配置备份:使用用户出口程序和 对于日志备份是先生成存于 自动备份到磁带 当日志产生时直接写入磁带 DB 的备份所以对于 无须将日志导入磁盘 rollforward ARCFUNC SAVE( , 但由于在 日志产生自动备份 ) DB2 主机目录上,所以必须有相应的空间,当下一日志产生时日志 , 恢复时可以直接作 方法 3: 使用用户出口程序和 rollforward ARCFUNC 无须将日志导入磁盘 COPY( 日志以文件方式备份,并采用 archive 模式备 份) 对于日志备份当日志产生时自动 COPY 到指定目录,所以必须有空间存放 恢复时得先将日志导入主机磁盘再作 . 再以文件方式备份。 rollforward 11.2 第一种策略 :使用 LOGARCHMETH1 = "VENDOR.." 1. 将 LOGARCHMETH1 Sqllib\bin\>db2 参数 ,versions 8.2 and above 设为 VENDOR: update db cfg VENDOR:C:\progra~1\veritas\netbackup\bin\nbdb2.dll 2. 创建 DB2 数据备份策略 DB2_DB for NBU uing LOGARCHMETH1 Attributes Policy type: DB2 Schedules Name: DBFULL Type of Backup:Automatic Full Backup Schedule: Name: Default-Appplication-Backup-DB Type of Backup: Application Backup Clients: db2 服务器主机名 Backup Selections:db2_backup_nbu_online.cmd 3. 创建 DB2 日志备份策略 Attributes: Policy type: DB2 DB2_LOG Schedules: Name: Default-Application-Backup-LOG Type of backup: Application Backup Schedule: Name: LOGFuLL Type of backup:Automatic Full Backup Clients: DB2 数据库主机 Backup Selections: 注此处为空 4. 配置 db2.conf 参数文件 将示例 文件从其所在的示例文件夹位置复制到活动位置。 db2.conf 从 install_path\NetBackup\dbext\db2\samples\db2.conf Install_path\NetBackup\dbext\db2\db2.conf 修改如下项: DATABASE SAMPLE OBJECTTYPE DATABASE POLICY DB2_DB_Policy SCHEDULE Default-Application-Backup 复制到 ENDOPER DATABASE SAMPLE OBJECTTYPE ARCHIVE POLICY DB2_Log_Policy SCHEDULE User ARCFUNC SAVE #ARCFUNC COPY #ARCDIR /home/db2inst1/arcdir #RETDIR /home/db2inst1/arcdir ENDOPER DATABASE SAMPLE OBJECTTYPE ARCHIVE POLICY DB2_ARCH_Policy SCHEDULE Default-Application-Backup ENDOPER 为下面的配置 : DATABASE NBU OBJECTTYPE DATABASE POLICY DB2_DB SCHEDULE Default-Application-Backup-DB ENDOPER #DATABASE SAMPLE #OBJECTTYPE ARCHIVE #POLICY DB2_Log_Policy #SCHEDULE User #ARCFUNC SAVE #ARCFUNC COPY #ARCDIR /home/db2inst1/arcdir #RETDIR /home/db2inst1/arcdir #ENDOPER DATABASE NBU OBJECTTYPE ARCHIVE POLICY DB2_LOG SCHEDULE Default-Application-Backup-LOG ENDOPER 注意 : 配置中红色部份与策略中对应 5. 创建备份脚本文件 将 备 份 示 例 脚 本 从 install_path\NetBackup\ DbExt\sample\ 复制到 D 盘 db2_backup_db_online.cmd D:\db2_backup_nbu_online.cmd 并修改以下项 : @REM Example: @set db2_nblib=C:\progra~1\veritas\netbackup\bin\nbdb2.dll @set db2_nblib=C:\progra~1\veritas\netbackup\bin\nbdb2.dll @echo db2_nblib = %db2_nblib% @REM Example: @set db2_home=D:\sqllib @set db2_home=D:\sqllib @echo db2_home = %db2_home% @REM Example: @set db2_name=SAMPLE @set db2_name=NBU @echo db2_name = %db2_name% 6. 确认 db2uext2.exe 确认 DB2 安装目径的 bin 下有 db2uext2.exe, 将 Files\Veritas\NetBackup\DbExt\DB2\db2uext2.exe C:\Program 如果没有 D:\SQLLIB\BIN 此情况一般出现在先安装了 NBU 后安装 DB2 11.3 第二种策略 使用用户出口程序和 ARCFUNC SAVE( 1. 将启用的日志记录的用户出口参数 2. 创建 DB2 数据库备份策略 3. 创建 DB2 日志备份策略 Attributes USEREXIT DB2_LOG DB2_LOG 日志产生自动备份 类型: ) 设为 ON DB2 类型 :MS-Windows-NT 复 制 到 Schedule: :此处为空 Backup Selections 4. 配置 db2.conf 参数文件 将示例 文件从其所在的示例文件夹位置复制到活动位置。 db2.conf 从 install_path\NetBackup\dbext\db2\samples\db2.conf Install_path\NetBackup\dbext\db2\db2.conf 修改如下项: DATABASE SAMPLE OBJECTTYPE DATABASE POLICY DB2_DB_Policy SCHEDULE Default-Application-Backup ENDOPER DATABASE SAMPLE OBJECTTYPE ARCHIVE POLICY DB2_Log_Policy SCHEDULE User ARCFUNC SAVE #ARCFUNC COPY 复制到 #ARCDIR /home/db2inst1/arcdir #RETDIR /home/db2inst1/arcdir ENDOPER DATABASE SAMPLE OBJECTTYPE ARCHIVE POLICY DB2_ARCH_Policy SCHEDULE Default-Application-Backup ENDOPER 为下面的配置 : DATABASE NBU OBJECTTYPE DATABASE POLICY DB2_DB SCHEDULE Default-Application-Backup-DB ENDOPER DATABASE NBU OBJECTTYPE ARCHIVE POLICY DB2_LOG SCHEDULE User ARCFUNC SAVE #ARCFUNC COPY #ARCDIR /home/db2inst1/arcdir #RETDIR /home/db2inst1/arcdir ENDOPER #DATABASE NBU #OBJECTTYPE ARCHIVE #POLICY DB2_LOG #SCHEDULE Default-Application-Backup #ENDOPER 注意 : 配置中红色部份与策略中对应 11.4 第三种策略 使用用户出口程序和 ARCFUNC COPY( 1. 将启用的日志记录的用户出口参数 NEWLOGPATH Policy type: DB2 Schedules: DB2_DB 类型: ) 设为 ON, 已更改的至日志文件的路径 USEREXIT 参数设为你的日志文件存放路径例如 2. 创建 DB2 数据库备分策略 Attributes: 日志采用文件备份 DB2 :\DB2LOG\NBU\ DBFULL Schedule: Default-Application-Backup-DB 3. 创建日志归档策略 DB2_LOG Attributes: Policy type:MS-Windows-NT Schedules : Name:USER_ARCHIVE Type of backup:User Archive 类型: MS-Windows-NT Backup Selections: 此处为空 4. 创建 DB2 日志备份策略 DB2_LOG_ARCHIVE 类型 : MS-Windows-NT Schedules:Full Backup Selections: 此处为 db2.conf 中定义的目录 ARCDIR 目录 5. 配置 db2.conf 参数文件 将示例 文件从其所在的示例文件夹位置复制到活动位置。 db2.conf 从 install_path\NetBackup\dbext\db2\samples\db2.conf Install_path\NetBackup\dbext\db2\db2.conf 修改如下项: DATABASE SAMPLE OBJECTTYPE DATABASE POLICY DB2_DB_Policy SCHEDULE Default-Application-Backup ENDOPER DATABASE SAMPLE OBJECTTYPE ARCHIVE POLICY DB2_Log_Policy 复制到 SCHEDULE User ARCFUNC SAVE #ARCFUNC COPY #ARCDIR /home/db2inst1/arcdir #RETDIR /home/db2inst1/arcdir ENDOPER DATABASE SAMPLE OBJECTTYPE ARCHIVE POLICY DB2_ARCH_Policy SCHEDULE Default-Application-Backup ENDOPER 为下面的配置 : DATABASE NBU OBJECTTYPE DATABASE POLICY DB2_DB SCHEDULE Default-Application-Backup-DB ENDOPER DATABASE NBU OBJECTTYPE ARCHIVE POLICY DB2_LOG SCHEDULE USER_ARCHIVE #SCHEDULE User #ARCFUNC SAVE ARCFUNC COPY ARCDIR D:\DB2LOGARC RETDIR D:\DB2LOG\NBU\ \NODE0000 ENDOPER #DATABASE NBU #OBJECTTYPE ARCHIVE #POLICY DB2_LOG #SCHEDULE Default-Application-Backup-LOG #ENDOPER 注意 : 配置中红色部份与策略中对应 # Use ARCDIR 指日志备份目标路径 # Use RETDIR 指 DB2 归档日志源路径,即 db2 cfg 指定的目径 6. 创建备份脚本文件 将 备 份 示 例 脚 db2_backup_db_online.cmd D:\db2_backup_nbu_online.cmd 本 从 复制到 D 盘 install_path\NetBackup\ DbExt\sample\ 并修改以下项 : @REM Example: @set db2_nblib=C:\progra~1\veritas\netbackup\bin\nbdb2.dll @set db2_nblib=C:\progra~1\veritas\netbackup\bin\nbdb2.dll @echo db2_nblib = %db2_nblib% @REM Example: @set db2_home=D:\sqllib @set db2_home=D:\sqllib @echo db2_home = %db2_home% @REM Example: @set db2_name=SAMPLE @set db2_name=NBU @echo db2_name = %db2_name% 7. 确认 db2uext2.exe 确认 DB2 安装目径的 bin 下有 db2uext2.exe, 将 Files\Veritas\NetBackup\DbExt\DB2\db2uext2.exe C:\Program 如果没有 D:\SQLLIB\BIN 此情况一般出现在先安装了 NBU 后安装 DB2 11.5 DB2恢复 windows D:\SQLIB\BIN> db2 restore db db_name load c:\progra~!\veritas\netbackup\bin\nbdb2.dll D:\SQLIB\BIN>db2 rollforward db NBU to end of logs and stop unix db2 restore db db_name load /usr/openv/netbackup/bin/lib db2 rollforward db db_name to end of logs and stop 复 制 到 第12章 Exchange 备份与恢 复 Windows平台下 Exchange 的 Agent 安装将在 Client 只要在 Master Server 上输入正确的 说明 :GRT备份,如果是 Software 安装的过程中同时安装, License 就可以对 Exchange 进行在线备份。 exchange2007/2003 需要安装 api 包, 2010 不需要。 12.1 配置 NBU客户机服务登陆帐户 默认情况下, NetBackup 客户机服务使用本地系统 或恢复,需要将服务帐户更改为另一个有效的 作为登录帐户。要对单个邮箱执行备份 Windows 域帐户。 ▼ 校验或修改 NetBackup 客户机服务的登录帐户 1. 打开 Windows “服务”应用程序。 2. 在 NetBackup 客户机服务 (NetBackup Client Service) 3. 如果未选择“本地系统”帐户作为登录身份 4. 将登录身份 (Log on as) (Log on as) 项上双击。 帐户,请继续执行步骤 6。 帐户更改为希望在该客户机上用于备份和恢复的帐户。 注意要更改该帐户,必须具有管理员组权限。 5. 停止并启动“ NetBackup 客户机服务” 。 6. 关闭“服务”应用程序。 创建用于“ NetBackup 客户机服务”的邮箱 为使 NetBackup 能够访问邮箱和文件夹以执行备份和恢复操作, 户需要与有效的 Exchange 邮箱关联。建议为 NetBackup 客户机服务帐 NetBackup 客户机服务帐户创建一个具有唯 一名称的邮箱。 1. 使用“ Active Directory 用户和计算机” ,创建一个具有唯一名称的邮箱。唯一名 称是指 Exchange 组织内尚不存在的名称。该名称不能是现有名称中包含的一组字符。 例如,如果输入 EXCH1 作为唯一名称,但已经有其他邮箱名称如 EXCH1BACKUP 或 BACKUPEXCH1 ,则单个邮箱的备份或恢复将失败,或两者都失败。 2. 使该帐户成为“域管理”组的成员。 3. 使用“ Exchange 管理委派向导” ,选择 NetBackup 客户机服务帐户并授予 系统管理员访问该帐户的权限。 a. 启动“ Exchange 系统管理器”程序。 Exchange b. 选择适当的“管理组” 。 c. 在“管理组”上右击并选择委派控制 4. 在第一个对话框中,单击下一步 5. 在第二个对话框中,单击添加 。 (Delegate Control) (Next) 。 (Add) 。 6. 在“委派控制”对话框中,在浏览 (Browse) 按钮上单击以选择在步骤 1 中创建的 NetBackup 客户机服务帐户。 a. 从角色 (Role) 列表中选择 Exchange 完全管理员 (Exchange Full Administrator) 。 b. 单击确定 (OK)。 c. 单击下一步 (Next) 。 d. 单击完成 (Finish) 。 7. 仅限“主动 / 主动” 配置 对于集群中的每个 管理器执行以下步骤,为 NetBackup 虚拟服务器, 通过使用 Exchange 系统 客户机服务帐户授予“接收为”和“发送为”高级权 限: a. 选择“虚拟 Exchange 服务器”名称。 b. 在虚拟名称上右击并选择属性 c. 在安全 (Security) 选项卡上单击。 d. 选择“名称”窗格下的 NetBackup e. 在“权限”下,选择接收为 f. (Properties) 客户机服务帐户。 (Receive As) 和发送为 (Send As) 。 单击确定 (OK)。 g. 对集群中的各个虚拟 Exchange 服务器重复以上步骤。 配置 NetBackup 以使用与 NetBackup 客户机服务帐户关联的邮箱 1. 打开“ NetBackup 管理控制台”或“远程管理控制台” 2. 在左窗格中,展开主机属性 3. 单击客户机 (Clients) (Host Properties) 。 。 。 4. 在右窗格中,在要配置的客户机上右击,选择属性 (Properties) 5. 展开 Windows 客户机 (Windows client) 并单击 Exchange 。 6. 在用于邮 (Mailbox 件级别备份和恢 restore) 框中,指定邮箱。邮箱可以指定为: ● Exchange 邮箱名 复的邮箱 for 。 message level backup and ● 完全限定的名称 ● /O=Org_Name/OU=Site_Name/CN=Server_Name/CN=Mailbox_Name ● 邮箱别名 7. 单击确定 (OK)。 12.2 配置 Exchange 备份策略 12.2.1 全库备份 Exchange 全库的备份,只需简单的设置策略,策略设置如下: 1、“ Policy type ”指定为 MS-Exchanger-Server 2、建立一个备份时间表。 。 3、正确指定需要备份的服务器主机名及操作系统类型。 4、备份内容为“ Exchange information Store:\* ” ,即为 Exchange 全库备份。 12.2.2 单邮箱的备份 单邮箱备份的策略与全库备份基本相同,主要区别在选择备份对象。 1、在“ Backup Selection ”页面点击“ New” 2、在“ Directive set 3、在“ Directive ”选择 “ MS_Exchange_Mailbox ” ”选择“ Microsfot 择“ New Stream ”。点击“ OK”即可。 Exchange ”,如果要进行分流备份,可选 12.2.3 GRT备份 12.2.3.1 准备环境 1、准备阶段 GRT必备条件: NBU实施 GRT备份需要两个必要条件, GRT的业务系统需要在 NBU的支持范围之 内,如 AD、Exchange 等,第二个是需要在备份客户端安装 NBU CLIENT和 NFS 客户端,在 Media Server 端安装 NFS SERVER 。 检查客户端服务器和备份服务器如果为 SERVER 2003 SP2系统或者低版本系统, 请先将补丁升级至 SERVER 2003 R2 SP2版本,否则无法开启 GRT功能。 1.1 准备备份账户 NBU作为系统服务安装在操作系统中, 当然客户端 Agent 也是以服务的形式存在 的,那么我们需要为 NBU创建一个具有域管理员权限的账户, 并且设置账户密码 永不过期,谨慎使用 Domain\Administrator 默认的与管理员作为 NBU服务账户, 因为有些时候我们会修改 Administrator 的密码,作为一个比较特殊的账户我们 一般不推荐使用。 1.2 安装 NFS客户端 / 服务端 客户端勾选: Microsoft NFS 服务管理 NFS客户端 RPC端口映射器 RPC外部数据表示 Media 服务器勾选 NFS客户端 RPC端口映射器 RPC外部数据表示 NFS服务器 登录 Media/Master 服务器,停用 SERVER FOR NFS 打开 CMD 运行 sc config NfsSvc start= disabled 将 Portmap 服务设置为自动启动 运行 sc config portmap start= auto 1.3 安装 NBU CLIENT 插入 NBU介质到客户端,即 Exchange 服务器,打开 Brower.exe 进程运行 NBU CLIENT安装进程,安装过程中选择自定义安装,填入具有域管理员权限的 AD账 号,否则会导致备份失败,安装完毕后进入 服务是否已正确的域账号登录 Services.msc 继续检查 NBU客户端 1.4 配置名称解析 NBU备份软件对于解析比较苛刻,当然我们知道添加 host 记录是一个对应解析 的好方法,但是有些软件并不能通过 host 记录来解析服务器 ip 地址,例如 NBU, 这时候我们就需要为服务器配置好 DNS解析了,将需要备份的服务器名称添加到 DNS记录中,并创建其 PTR记录这点非常重要! 12.2.3.2 策略制定 创建策略 右击 Policy 创建一个策略 ① 策略选择 MS-Exchange-Server ② 介质池选择 B2D文件夹, GRT不能直接进入磁带 ③ 启用 GRT恢复 添加右键服务器到策略选择列表中 添加右键数据库至备份选择列表 2.2 验证 GRT备份 Info bpbrm(pid=1632) from client mail: TRV - Starting granular backup processing for (Microsoft Information Store:\First Storage Group). This may take a while.. 出现此信息就说明 GRT备份已经开始。 12.2.4 Exchange 的恢复 12.2.4.1 全库的恢复 1、点击 开始-》程序-》 VERITAS NetBackup -》 Backup ,Archive and Restore ,弹 出恢复界面。点击 File -》 Specify NetBackup Machines and Policy Type 2、正确指定,恢复的主服务器名称。 3、正确指定恢复的 Client 及恢复的策略类型。 4、在 History 选择具体恢复的时间,正确指定恢复的内容,做全库恢复,需指定 进行以前恢复。如有多个 一个 Storage。 Log file Storage Group 进行备份,在恢复的时候需逐个恢复,每次只恢复 5、恢复前,先把 Exchange 存储卸载。 6、点击“ ”弹出恢复窗口。选择恢复到原来的位置。点击“ 恢复 7、开始恢复,弹出对话框,点击“ Y ”查看恢复状态。 Start Restore ”开始 8、恢复进行中。 9、恢复完成。 10、恢复完成后,装入 Exchange 存储。 11、确认存储装入完成。恢复成功。 12.2.4.2 单邮箱的恢复 1、正确选择需要恢复的邮箱,点击“ 2、点击“ Start Restore ”开始恢复。 ”,弹出恢复窗口。 3、点击“ Y”,弹出恢复过程观察窗口。显示恢复 状况。 成功后,可正常浏览邮箱查看邮件恢复 第13章 LotusNotes 备份与 恢复 13.1 Windows环境变量设置 在备份主服务器中选修改 Lotus Notes 服务器的备份属性,运行 jnbSA 打开 NetBackup 备份 管理器, 选择 NetBackup Management 中的 Host properties 下的 Client, 选择其中的 Lotus 服务 器,选择属性,按照以下内容进行修改。 日志时备份服务器预取的日志个数,通常大于 transaction log cache path 选项为备份 domino 交易 1。小于 1 代表不预取日志文件。 项为 Domino 初始化文件及路径位置,本例按图中设置, INI path 选 PATH 设置为 Domino 的安装路径 13.2 Unix&Linux 环境变量设置 在备份主服务器中选修改 Lotus Notes 服务器的备份属性,运行 jnbSA 打开 NetBackup 备份 管理器, 选择 NetBackup Management 中的 Host properties 下的 Client, 选择其中的 Lotus 服务 器,选择属性,按照以下内容进行修改, transaction log cache 路径为备份 domino 交易日志 时备份服务器预取的日志个数,通常大于 1。小于 1 代表不预取日志文件。 Domino 初始化文件及路径位置,本例按图中设置 INI 文件路径为 PATH 设置为 Domino 的安装路径,本例 按照图中设置 13.3 脚本设置 开始设置脚本 默认在 /usr/openv/netbackup/ext/db_ext/db2/scripts db2_backup #!/bin/sh #bcpyrght #*************************************************************************** #* $VRTScprght: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $* #*************************************************************************** #ecpyrght # # These environment variables are initialized by Netbackup (bphdb) # echo "DB2_CLIENT = $DB2_CLIENT" echo "DB2_SERVER = $DB2_SERVER" echo "DB2_POLICY = $DB2_POLICY" echo "DB2_SCHED = $DB2_SCHED" echo "DB2_FULL = $DB2_FULL" # Is 1 if Full backup scheduled echo "DB2_CINC = $DB2_CINC" # Is 1 if Cumulative incremental scheduled echo "DB2_INCR = $DB2_INCR" # Is 1 if Differential incremental scheduled # # Change MY_LIB to the correct NetBackup library name for your host: # Solaris or Linux 32-bit = nbdb2.so # Solaris 64-bit = nbdb2.so64 # HPUX (ia64) = nbdb2.so # AIX or HPUX = nbdb2.sl # AIX or HPUX = nbdb2.sl64 # MY_LIB=/usr/openv/netbackup/bin/nbdb2.lib 根据系统进行改变对应的库文件 # # Change MY_DB2 to the correct DB2 instance name for your database. # MY_DB2=sample 修改需要备份的数据库的名 # # Use the NetBackup schedule type to set DB2 full or incremental options. # if [ "$DB2_FULL" = "1" ] ; then MY_SCHED="" elif [ "$DB2_CINC" = "1" ] ; then MY_SCHED="INCREMENTAL" elif [ "$DB2_INCR" = "1" ] ; then MY_SCHED="INCREMENTAL DELTA" else MY_SCHED="" fi # # Initialize the backup command line. # Customize the number of sessions and buffer options for your environment. # CMD_LINE="db2 BACKUP DA TABASE $MY_DB2 ONLINE $MY_SCHED LOAD $MY_LIB 加入“ ONLINE ”在线备份 OPEN 4 SESSIONS BUF FER 1024" # # Change MY_USER to the proper DB2 user for performing backups # MY_USER=db2inst1 修改成 DB2 的实际用户 echo "Executing: $CMD_LINE" su - $MY_USER -c "$CMD_LINE" RETURN_STATUS=$? # Return 0 for success, non-zero for errors exit $RETURN_STATUS 脚本设置完成。 13.4 策略制定 设置完成后,建立策略打开 master server 管理界面 Policy type 选择 lotus— Notes 其他的设置一样, Backup selection 设置选择为: 一个是数据库的备份,一个是日志的备份如下图: 13.5 LotusNotes 恢复 13.5.1 打开管理界面 打开管理界面 jnbSA 13.5.2 选择恢复选项 ①点击左边的 Backup,Archive,and Restore ②选择 Restore files ③把 /root/ 改成 / ④选择右上方的小手,弹出选项卡 1 选择 server name 2 选择源客户端即使备份的客户端 3 选择目标客户端即需要恢复的客户端 4 选择策略类型 选择 lotus-note ⑤选择需要恢复的时间点 ⑥查看备份记录 13.5.3 选择需要恢复的文件 选择完恢复选项后,可以查看到备份过的文件 选择需要恢复的文件,然后点击右下角的 开始恢复 Restore