資源描述:
《NBUORACLERAC恢復(fù)備份恢復(fù)測試》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、附件一、Oracle備份測試腳本I>RACOracle備份腳本(對nbu模板作出修改的部分已紅色標(biāo)識)#!/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