1、NetBackup 恢复手册Strategic Services for Storage and Storage ManagementXX基金NetBackup恢复手册PRESENTED BY:VERITAS Enterprise Consulting Services1600 Plymouth StreetMountain View, CA 9404322 Feb 2004目录1.文件本机恢复测试 32.本地恢复操作系统测试 53.文件异机恢复测试 64.oracle 数据库文件毁坏恢复测试 85.oracle数据库控制文件毁坏恢复测试 176.SQL database恢复测试 197.BM
2、R AIX恢复测试 208.BMR Windows恢复测试 229.Vault的全备份恢复测试 2410.Vault的全备份和增量备份恢复测试 261.文件本机恢复测试对每台安装NetBackup Client的机器都进行一次备份和恢复测试,备份一个小目录,恢复到本机a.准备工作为每台安装了NetBackup Client的机器建立一个备份/usr/openv的测试备份策略,备份都通过网络写到shwp0007上的带库中,挑选若干盘磁带放在test_pool中。确认该机器/tmp目录下有400MB以上的空间。确认网络正常确认NetBackup Master server正常运行b.测试方法立刻启
3、动备份策略,确认备份进程正常mount磁带,写磁带并以状态0结束在恢复GUI中找到刚才备份的数据,恢复该目录到/tmp目录下,在UNIX下用chkum比较两个二进制文件的校验值。直接用vi(或diff)来比较两个文本文件是否一致。c.清理工作删除建立的测试备份策略,删除test_pool,删除/tmp下恢复出的数据d.出错处理方法根据NetBackup Trouble shooting文档资料对错误状态进行分析,纠正错误配置后重新进行测试测试结果:主机名passfail2.本地恢复操作系统测试对测试机进行一次全备份和恢复测试,备份全部操作系统,恢复到本机a.准备工作为这台测试机建立一个备份AL
4、L_LOCAL_DRIVES和system_state:/的测试备份策略,备份都通过网络写到shwp0007上的带库中,挑选若干盘磁带放在test_pool中。确认网络正常确认NetBackup Master server正常运行b.测试方法立刻启动备份策略,确认备份进程正常mount磁带,写磁带并以状态0结束在恢复GUI中找到刚才备份的数据,恢复覆盖整个操作系统。c.清理工作删除建立的测试备份策略,删除test_poold.出错处理方法根据NetBackup Trouble shooting文档资料对错误状态进行分析,纠正错误配置后重新进行测试测试结果:主机名passfail3.文件异机恢复
5、测试对每台安装NetBackup Client的机器都进行一次备份和恢复测试,备份一个小目录,恢复到shwp0007本机a.准备工作为每台安装了NetBackup Client的机器建立一个备份/usr/openv的测试备份策略,备份都通过网络写到shwp0007的带库中,挑选若干盘磁带放在test_pool中。确认该机器/tmp目录下有400MB以上的空间。确认网络正常确认NetBackup Master server正常运行b.测试方法在jfkdb2中的/usr/openv/netbackup/db目录下建altnames目录,然后创建空文件No.Restrictions.立刻启动备份策略
6、,确认备份进程正常mount磁带,写磁带并以状态0结束在恢复GUI中找到刚才备份的数据,恢复该目录到jfkdb2的/tmp目录下,在UNIX下用chkum比较两个二进制文件的校验值。直接用vi(或diff)来比较两个文本文件是否一致。c.清理工作删除建立的测试备份策略,删除test_pool,删除jfkdb2的/tmp下恢复出的数据d.出错处理方法根据NetBackup Trouble shooting文档资料对错误状态进行分析,纠正错误配置后重新进行测试测试结果:主机名passfail4.oracle 数据库文件毁坏恢复测试在测试机上对Oracle数据库进行一次备份和恢复测试,备份全数据库,
7、恢复数据库a.准备工作1.为测试机安装Oracle数据库2.为测试机安装NetBackup客户端和数据库agent,link该测试数据库3.为该测试机建立一个备份数据库的测试备份策略,挑选磁带放在test_pool中。配置rman备份脚本4.确认网络正常5.确认NetBackup Master server正常运行b.测试方法1在数据库中创建一张表,写些数据2立刻启动备份策略,确认备份进程正常mount磁带,写磁带并以状态0结束,查看rman脚本的日志确认备份成功3关闭数据库shutdown immediate4将当前的几个datafile的裸设备dd掉5将数据库置于mount状态startu
8、p mount6通过手工执行rman恢复数据,查看刚才的表中数据还在c.清理工作删除建立的测试备份策略,删除test_poold.出错处理方法根据NetBackup Trouble shooting文档资料和查阅oracle Metalink对错误状态进行分析,纠正错误配置后重新进行测试RMAN备份脚本# -# hot_database_backup.sh# -# This script uses Recovery Manager to take a hot (inconsistent) database# backup. A hot backup is inconsistent becaus
9、e 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
10、oracle dba account before# execution. If this script runs under a user account that has Oracle dba# privilege, it will be executed using this users account.# -# -# Determine the user which is executing this script.# -CUSER=id |cut -d( -f2 | cut -d ) -f1# -# Put output in .out. Change as desired.# No
11、te: 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 thenrm -f $RMAN_LOG_FILEfi# -# Initialize the log file.# -echo $RMAN_LOG_FILEc
12、hmod 666 $RMAN_LOG_FILE# -# Log the start of this script.# -echo Script $0 $RMAN_LOG_FILEecho = started on date = $RMAN_LOG_FILEecho $RMAN_LOG_FILE# -# Replace /db/oracle/product/ora81, below, with the Oracle home path.# -ORACLE_HOME=/db/oracle/product/ora81export ORACLE_HOME# -# Replace ora81, belo
13、w, with the Oracle SID of the target database.# -ORACLE_SID=ora81export 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# -#
14、 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_FILEecho RMAN: $RMAN $RMAN_LOG_FILEecho ORACLE_SID: $ORACLE_SID $RMAN_LOG_FILEecho ORACLE_USER: $ORACLE_USER $RMAN_LOG_FILEecho ORACLE_HOME: $ORACLE_HOME
15、$RMAN_LOG_FILE# -# Print out the value of the variables set by bphdb.# -echo $RMAN_LOG_FILEecho NB_ORA_FULL: $NB_ORA_FULL $RMAN_LOG_FILEecho NB_ORA_INCR: $NB_ORA_INCR $RMAN_LOG_FILEecho NB_ORA_CINC: $NB_ORA_CINC $RMAN_LOG_FILEecho NB_ORA_SERV: $NB_ORA_SERV $RMAN_LOG_FILEecho NB_ORA_POLICY: $NB_ORA_P
16、OLICY $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.# Th
17、e NB_ORA variable is then used to dynamically set BACKUP_TYPE# For example, when:# schedule type is BACKUP_TYPE is# - -# Automatic Full INCREMENTAL LEVEL=0# Automatic Differential Incremental INCREMENTAL LEVEL=1# Automatic Cumulative Incremental INCREMENTAL LEVEL=1 CUMULATIVE# For user initiated bac
18、kups, 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 incrementa
19、l 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 thenecho Full backup requested $RMAN_LOG_FILEBACKUP_TYPE=INCREMENTAL LEVEL=0elif $NB_ORA_INC
20、R = 1 thenecho Differential incremental backup requested $RMAN_LOG_FILEBACKUP_TYPE=INCREMENTAL LEVEL=1elif $NB_ORA_CINC = 1 thenecho Cumulative incremental backup requested $RMAN_LOG_FILEBACKUP_TYPE=INCREMENTAL LEVEL=1 CUMULATIVEelif $BACKUP_TYPE = thenecho Default - Full backup requested $RMAN_LOG_
21、FILEBACKUP_TYPE=INCREMENTAL LEVEL=0fi# -# 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 / statement.# Note: Any environment variables needed at run
22、 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,
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1