NBU 配置ORACLE备份
- 安装NBU客户端
- 配置Netbackup
- 创建备份脚本
- 编辑备份脚本
- 备份脚本需要替换的内容
- 创建策略
- 脚本赋权
安装NBU客户端
./install
配置Netbackup
#su – oracle#cd /usr/openv/netbackup/bin/#./oracle_linkTue Mar 13 09:54:51 CST 2018All Oracle instances should be shutdown before running this script.Please log into the Unix system as the Oracle owner for running this scriptDo you want to continue? (y/n) yLIBOBK path: /usr/openv/netbackup/binORACLE_HOME: /oracle/app/oracle/product/11.2.0/db_1Oracle version: 11.2.0.4.0Platform type: x86_64Linking LIBOBK:Moving libobk.so to libobk.so.backln -s /usr/openv/netbackup/bin/libobk.so64 /oracle/XXXXXXX/lib/libobk.soDonePlease check the trace file located in /tmp/make_trace.11011to make sure the linking process was successful.
创建备份脚本
#mkdir /usr/openv/netbackup/scripts#cd /usr/openv/netbackup/#chmod –R 777 scripts#cd scripts#cp /usr/openv/netbackup/ext/db_ext/oracle/samples/rman/hot_database_backup.sh ./(或是从现在已经在备份的数据库客户端上FTP脚本到新客户端上)
编辑备份脚本
#vi hot_database_backup.sh
备份脚本需要替换的内容
ORACLE_HOME=/db/oracle/product/ora102ORACLE_SID=ora102ORACLE_USER=ora102$RMAN target $TARGET_CONNECT_STR nocatalog msglog $RMAN_LOG_FILE append << EOFRUN {ALLOCATE CHANNEL ch00 TYPE \'SBT_TAPE\';ALLOCATE CHANNEL ch01 TYPE \'SBT_TAPE\';SEND\'NB_ORA_POLICY=oracle11g04-database-ora_full,NB_ORA_CLIENT=oracle11g04\'; //使用实际的数据库备份策略名称和客户端名称BACKUP$BACKUP_TYPESKIP INACCESSIBLETAG hot_db_bk_level0FILESPERSET 20# recommended formatFORMAT \'bk_%s_%p_%t\'DATABASE;sql \'alter system archive log current\';RELEASE CHANNEL ch00;RELEASE CHANNEL ch01;# backup all archive logsALLOCATE CHANNEL ch00 TYPE \'SBT_TAPE\';ALLOCATE CHANNEL ch01 TYPE \'SBT_TAPE\';SEND\'NB_ORA_POLICY=oracle11g04-database-ora_arch,NB_ORA_CLIENT=oracle11g04\'; //使用实际的归档备份策略名称和客户端名称BACKUPfilesperset 20FORMAT \'al_%s_%p_%t\'ARCHIVELOG ALL skip inaccessible DELETE INPUT; //备份完归档后删除RELEASE CHANNEL ch00;RELEASE CHANNEL ch01;
创建策略
在NETBACKUP ADMINISTRATOR CONSOLE里新建策略,注意策略名称使用脚本里指定的名称,以及在TAB (BACKUP SELECTION)里指定脚本的绝对路径:
脚本赋权