欢迎来到天天文库
浏览记录
ID:47283536
大小:88.81 KB
页数:13页
时间:2019-08-23
《NBUORACLERAC恢复备份恢复测试》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、附件一、Oracle备份测试脚本I>RACOracle备份脚本(对nbu模板作出修改的部分已红色标识)#!/bin/sh#$Header:hot_database_backup.sh,v1.22002/08/0623:51:42$#bcpyrght#*$VRTScprght:Copyright1993-2007SymantecCorporation,AllRightsReserved$*ftecpyrght###hot_database_backup・sh##ThisscriptusesRecoveryManagertotak
2、eahot(inconsistent)database#backup・Ahotbackupisinconsistentbecauseportionsofthedatabaseare#beingmodifiedandwrittentothediskwhilethebackupisprogressing.#YoumustrunyourdatabaseinARCHIVELOGmodetomakehotbackups・Itis#assumedthatthisscriptwillbeexecutedbyuserroot・Inorderf
3、orRMAN#toworkproperlyweswitchuser(su-)totheoracledbaaccountbefore#execution.IfthisscriptrunsunderauseraccountthathasOracledba#privilege,itwillbeexecutedusingthisuser"saccount.###Determinetheuserwhichisexecutingthisscript.#CUSER=id
4、cut-d"("~f2
5、cut-d”)"-fl##Putoutputi
6、n・out.Changeasdesired・#Note:outputdirectoryrequireswritepermission.#RMAN_L0G_FILE=${0}.out##Youmaywanttodeletetheoutputfilesothatbackupinformationdoes#notaccumulate.Ifnot,deletethefollowinglines.#辻[-f〃$RMANL0G_FILE〃]themrm-fZ/$RMANLOGPILE"fi##Initializ
7、ethelogfile.echo»$RMAN_LOG_FILEchmod666$RMAN_LOG_FILE##Logthestartofthisscript.#echoScript$0»$RMANLOGFILEecho====startedondate====>>$RMAN_L0GFILEecho»$RMANLOGFILE#Replace/db/oracle/product/ora81,below,withtheOraclehomepath.#0RACLE_H0ME=/oracle/product/db/10.2export0
8、RACLE_H0ME##Replaceora81,below,withtheOracleSIDofthetargetdatabase.#ORACLE_SID二gzyxlexportORACLESTD##Replaceora81,below,withtheOracleDBAuserid(account)・#ORx^CLE_USER=orac1e##Setthetargetconnectstring.#Replace,,sys/manager,,>below,withthetargetconnectstring.#TARGET_C
9、ONNECT_STR二/##SettheOracleRecoveryManagername.#RMAN=$ORACLE_HOME/bin/rman##Printoutthevalueofthevariablessetbythisscript.#echo»$RMAN_LOG_FILEecho〃RMAN:$RMAN〃»$RMAN_LOG_FILEecho〃ORACLE_SID:$ORACLE_SID〃»$RMAN_LOG_FILEecho"ORACLEJSER:$ORACLE_USER〃»$RMAN_LOG_FILEecho/ZO
10、RACLE_HOME:$ORACLE_HOME〃»$RMAN_LOG_FILE##Printoutthevalueofthevariablessetbybphdb.#»$RMAN_LOGFILE»$RMANLOGFILE»$RMANLOGFILE»$RMANLOGFILEec
此文档下载收益归作者所有