NBU NetBackup 备份Oracle策略配置Word文档格式.docx
《NBU NetBackup 备份Oracle策略配置Word文档格式.docx》由会员分享,可在线阅读,更多相关《NBU NetBackup 备份Oracle策略配置Word文档格式.docx(19页珍藏版)》请在冰点文库上搜索。
以上界面中的clientname,是指客户端的主机名,必须已在192.168.8.170上的/etc/hosts文件中配置。
5.选择备份脚本。
执行备份策略
手工执行备份策略,验证策略是否配置成功。
在AllPolicies下选中ORACLE_TEST1_80_DB,右键选择ManualBackup,并在ActivityMonitor中查看状态。
当启动job全部为Done时,表明备份成功。
WINS+Oracle
基本配置
在172.16.140.25(主机名XIONGMIAOMIAO)上安装Oracle11gR2的服务端。
1.在C:
\Windows\System32\drivers\etc\hosts文件中配置NBU服务端的IP及主机名。
192.168.8.170yiling-appliance
2.更改oracle的归档模式。
SQL>
archiveloglist;
数据库日志模式非存档模式
自动存档禁用
存档终点USE_DB_RECOVERY_FILE_DEST
最早的联机日志序列10
当前日志序列12
shutdownimmediate;
数据库已经关闭。
已经卸载数据库。
ORACLE例程已经关闭。
startupmount;
ORACLE例程已经启动。
TotalSystemGlobalArea945786880bytes
FixedSize1375368bytes
VariableSize327156600bytes
DatabaseBuffers612368384bytes
RedoBuffers4886528bytes
数据库装载完毕。
alterdatabasearchivelog;
数据库已更改。
ORA-01109:
数据库未打开
startup;
数据库已经打开。
数据库日志模式存档模式
自动存档启用
下一个存档日志序列12
showparameterdb_recovery;
NAMETYPEVALUE
-----------------------------------------------------------------------------
db_recovery_file_deststringF:
\orcl\flash_recovery_area
db_recovery_file_dest_sizebiginteger3852M
创建备份脚本
修改oracle的备份脚本。
从C:
\ProgramFiles\Veritas\NetBackup\DbExt\Oracle\Samples\rman目录下拷贝出hot_database_backup.cmd,放到C:
\ProgramFiles\Veritas\NetBackup\scripts目录下。
并根据实际情况修改脚本(如蓝色部分所示)。
@REM$Header:
hot_database_backup.cmd,v1.42010/08/0417:
55:
57$
@REMbcpyrght
@REM***************************************************************************
@REM*$VRTScprght:
Copyright2013SymantecCorporation,AllRightsReserved$*
@REMecpyrght
@REM
@REM---------------------------------------------------------------------------
@REMhot_database_backup.cmd
@REMThisscriptusesRecoveryManagertotakeahot(inconsistent)database
@REMbackup.Ahotbackupisinconsistentbecauseportionsofthedatabaseare
@REMbeingmodifiedandwrittentothediskwhilethebackupisprogressing.
@REMYoumustrunyourdatabaseinARCHIVELOGmodetomakehotbackups.
@setlocalENABLEEXTENSIONS
@REMNoneedtoechothecommands.
@echooff
@REMPutoutputinthesamefilename,differentextension.
@setRMAN_LOG_FILE="
%~dpn0.out"
@REMYoumaywanttodeletetheoutputfilesothatbackupinformationdoes
@REMnotaccumulate.Ifnot,deletethefollowingcommand.
@ifexist%RMAN_LOG_FILE%del%RMAN_LOG_FILE%
@REMReplaceH:
\oracle\ora102,below,withtheOraclehomepath.
@setORACLE_HOME=F:
\orcl\product\11.2.0\dbhome_1
@REMReplaceora102,below,withtheOracleSID.
@setORACLE_SID=orcl
@REMReplacesys/manager,below,withthetargetconnectstring.
@setTARGET_CONNECT_STR=/
@REMSettheOracleRecoveryManager.
@setRMAN=%ORACLE_HOME%\bin\rman.exe
@REMLogthestartofthisscript.
@for/F"
tokens=1*"
%%pin('
date/T'
)do@setDATE=%%p%%q
@for/F%%pin('
time/T'
)do@setDATE=%DATE%%%p
@echo====startedon%DATE%====>
>
%RMAN_LOG_FILE%
@echoScriptname:
%0>
@REMSeveralRMANcommandsusetimeparametersthatrequireNLS_LANGand
@REMNLS_DATE_FORMATtobeset.Thisexampleusesthestandarddateformat.
@REMReplacebelowwiththedesiredlanguagevalues.
@setNLS_LANG=american
@setNLS_DATE_FORMAT=YYYY-MM-DD:
hh24:
mi:
ss
@REMPrintoutenvironmentvariablessetinthisscript.
@echo#>
@echoRMAN:
%RMAN%>
@echoNLS_LANG:
%NLS_LANG%>
@echoORACLE_HOME:
%ORACLE_HOME%>
@echoORACLE_SID:
%ORACLE_SID%>
@echoNLS_DATE_FORMAT:
%NLS_DATE_FORMAT%>
@echoRMAN_LOG_FILE:
%RMAN_LOG_FILE%>
@REMPrintoutenvironmentvariablessetinbphdb.
@echoNB_ORA_SERV:
%NB_ORA_SERV%>
@echoNB_ORA_FULL:
%NB_ORA_FULL%>
@echoNB_ORA_INCR:
%NB_ORA_INCR%>
@echoNB_ORA_CINC:
%NB_ORA_CINC%>
@REMWeassumethatthedatabaseisproperlyopened.Ifdesired,thiswould
@REMbetheplacetoverifythat.
@REMIfthisscriptisexecutedfromaNetBackupschedule,NetBackup
@REMsetsanNB_ORAenvironmentvariablebasedonthescheduletype.
@REMForexample,when:
@REMscheduletypeisBACKUP_TYPEis
@REM------------------------------
@REMAutomaticFullINCREMENTALLEVEL=0
@REMAutomaticDifferentialIncrementalINCREMENTALLEVEL=1
@REMAutomaticCumulativeIncrementalINCREMENTALLEVEL=1CUMULATIVE
@REMForuserinitiatedbackups,BACKUP_TYPEdefaultstoincremental
@REMlevel0(Full).Tochangethedefaultforauserinitiated
@REMbackuptoincrementalorincrementatlcumulative,uncomment
@REMoneofthefollowingtwolines.
@REM@setBACKUP_TYPE="
INCREMENTALLEVEL=1"
INCREMENTALLEVEL=1CUMULATIVE"
@REMNotethatweuseincrementallevel0tospecifyfullbackups.
@REMThatisbecause,althoughtheyareidenticalincontent,only
@REMtheincrementallevel0backupcanhaveincrementalbackupsof
@REMlevel>
0appliedtoit.
@REMWhatkindofbackupwillweperform.
@if"
%NB_ORA_FULL%"
EQU"
1"
@setBACKUP_TYPE=INCREMENTALLevel=0
%NB_ORA_INCR%"
@setBACKUP_TYPE=INCREMENTALLevel=1
%NB_ORA_CINC%"
@setBACKUP_TYPE=INCREMENTALLevel=1CUMULATIVE
@ifNOTDEFINEDBACKUP_TYPE@setBACKUP_TYPE=INCREMENTALLevel=0
@REMCallRecoveryManagertoinitiatethebackup.Thisexampledoesnotusea
@REMRecoveryCatalog.Ifyouchoosetouseone,removetheoption,nocatalog,
@REMfromthermancommandlinebelowandadda
@REM'
catalog<
userid>
/<
passwd>
@<
netservicename>
'
statement.
@REMNOTEWHENUSINGNETSERVICENAME:
Whenconnectingtoadatabase
@REMusinganetservicename,youmustuseasendcommandoraparmsoperandto
@REMspecifyenvironmentvariables.Inotherwords,whenaccessingadatabase
@REMthroughalistener,theenvironmentvariablessetatthesystemlevelarenot
@REMvisiblewhenRMANisrunning.Formoreinformationontheenvironment
@REMvariables,pleaserefertotheNetBackupforOracleAdmin.Guide.
@REMIfyouaregettinganerrorthattheinputlineistoolong,youwillneed
@REMtoputtheRMANrunblockinaseparatefile.Thenusethe"
cmdfile"
@REMoptionofRMAN.Formoreinformationonthe"
optionsplease
@REMrefertotheRMANdocumentation.
@(
echoRUN{
echoALLOCATECHANNELch00TYPE'
echoALLOCATECHANNELch01TYPE'
echoSEND'
NB_ORA_POL