Youcanperformfullorpartial,offline oronlinebackupswith Oracle.Onceyou identifywhichdatabaseto backup,Oraclelocatesallnecessary filesandsends themtotheTivoliStorageManagerserverthrough DataProtectionforOracle.Asa result, DataProtectionforOracleprovidesaninterface betweenOracleMedia ManagementAPIcallsandTivoliStorageManagerAPIroutines.
Invoking RMAN
InvokeRMAN tobackupand restoreanOracledatabase.Inthisexample,the catalog databasecontainsa registeredtargetdatabase.InvokeRMANwiththis command:
$> rman target xxx/yyy@target rcvcat aaa/bbb@catalog
cmdfile bkdb.scr msglog bkdb.log
ThisstartsRMANinthesequenceshown.
target xxx/yyy@target: connect to target database
using user xxx and password yyy with connect string target rcvcat aaa/bbb@catalog: connect to catalog database
using user aaa and password bbb with connect string catalog cmdfile bkdb.scr: run bkdb.scr script
msglog bkdb.log: log the output messages in bkdb.log
Note: Intheaboveexample,RMANcreatesa logfile(bkdb.log)inthecurrent workingdirectory.Ifan erroroccurs, youwillseetheerrorstackinthelog file.
Attention: Forbackupandrestoreoperationsina Linuxenvironment,Oracle recommends thattheOracleLD_ASSUME_KERNELvariablebe setfortheOracle user.For example:
LD_ASSUME_KERNEL=2.4.21; export LD_ASSUME_KERNEL
Scripts
Data Protectionfor Oracledoesnotrecognizeenvironmentvariablesspecifiedin an RMANscript.Theonlyenvironment variableDataProtectionforOracleVersion 5.4.1recognizeswithin anRMANscriptisthefullyqualifiedpathnametothe tdpo.optfile.Therefore,existingRMAN scriptsmayneedtobe editedtouse TDPO_OPTFILE=fully qualifiedpathandfile nameofoptionsfilevariable inplaceof otherenvironmentvariables.TheTDPO_OPTFILEvariablemustbespecified in upper casecharactersonly.
Example
ThisbackupscriptallocatestwoparallelconnectionstotheTivoliStorageManager server.TheTivoliStorageManagerserverviewstheseconnectionsastwoseparate sessions:
run {
allocate channel t1 type ’sbt_tape’ parms
’ENV=(TDPO_OPTFILE=/ora91/scripts/tdpo.opt)’;
allocate channel t2 type ’sbt_tape’ parms
’ENV=(TDPO_OPTFILE=/ora91/scripts/tdpo.opt)’;
backup
filesperset 5
format ’df_%t_%s_%p’
(database);
}
Note: TobackuptoTivoliStorageManager usingData ProtectionforOracle,you mustspecifytype’sbt_tape’intheRMAN scriptorwithin theglobal RMANconfigurationsettings.
ThisrestorescriptallocatesoneparallelconnectiontotheTivoliStorageManager server:
run {
allocate channel t1 type ’sbt_tape’ parms
’ENV=(TDPO_OPTFILE=/home/oracle/tdpo.opt)’;
restore database;
recover database;
alter database open;
}
Notes:
1. Theallocatechannel entryisdividedontwolinesaftertheparms optionto accommodatepageformatting.
2. TheOracle databasemustbe inmountmodefortherestoretosucceed.
Using the Duplex Copy function
Data ProtectionforOraclesupportstheOracle ServerDuplexbackupfeature.This feature allowsyouto makeuptofourexactduplicatecopiesof abackupthatcan be storedondifferentbackupmedia.Adifferentmanagementclassisrequiredfor eachbackupcopy.By default,theprimary managementclassisthedefault
management classonthepolicydomaindefinedfortheDataProtectionforOracle node.
Note: ItmaybenecessarytodefinetheOracleparametervalue
(BACKUP_TAPE_IO_SLAVES=TRUE)intheinit.orafileofthetarget
databaseforData ProtectionforOracle tousetheduplexcopyfeature. Refer toyourOracle documentationregardingtheuseofthis Oracleparameter.
For example,tocreatefourbackupcopies:
1. SpecifythefollowingoptionintheRMANbackupscript:
set duplex 4
2. Definethefollowingoptionsinthetdpo.optfile:
v tdpo_mgmt_class_2 v tdpo_mgmt_class_3 v tdpo_mgmt_class_4
3. RuntheRMANbackupscript.
Thefollowingbackupbehavioroccurs:
v Thefirstbackupcopyisboundtothedefaultmanagementclasstowhichthe nodeisregistered.
v Thesecondbackupcopyisbound tothemanagement classdefinedbythe tdpo_mgmt_class_2option.
v
Thethirdbackupcopyisboundtothemanagementclass definedbythe tdpo_mgmt_class_3option.
v
Thefourthbackupcopyisboundtothemanagementclassdefinedbythe tdpo_mgmt_class_4option.
Considerations
Theduplexcopyfeature doesnotuseincludestatements.Itonlyusesthe managementclassesspecifiedinthetdpo.optfile.
Youwillreceiveanerrormessageifyouspecifyset duplex4intheRMAN backupscriptanddonotdefineasufficientnumber oftdpo_mgmt_class optionsin thetdpo.optfile.
Inordertoplaceduplicatecopiesondifferentmedia:
– Makesurethestoragepoolinformationfor eachbackupcopygroup within themanagement classesisnotthesame.
– Makesurebackupsfromthesedifferentstoragepoolsare notmigrated tothe samestoragepoolata latertime.
Beawarethatduplicatedatawillbesentacrossthenetwork.
Beawarethatif youspecifysetduplex4 andallocateonechannelintheRMAN backupscript,RMAN willstart foursessionstotheTivoliStorageManager server.Likewise, ifyouspecifysetduplex4 andallocatetwochannelsinthe RMANbackupscript,RMANwillstart eightsessionstotheTivoliStorage Managerserver.
Theduplexcopyfeature sendsthebackupcopiessimultaneously.Ifthebackup destinationistape,thenumberofsessionswillbe multiplesoftheduplex value.Asaresult,makesureRMAN doesnotstart moresessionsthanthe maximummountpoints allowedbytheTivoliStorageManagerserver.The nodedefinitionoptionontheTivoliStorageManagerserver(maxnummp) determinesthemaximumnumberofmountpoints aclientnode isallowedto useontheTivoliStorageManagerserverduringa backupoperation.Youcan viewthemaximummountpoints allowedbytheTivoliStorageManagerserver foraparticularnode byenteringthequerynodecommandfromaTivoli StorageManagerAdministrativeClientprompt:
q node f=d
SeetheappropriateTivoliStorageManagerAdministrator’s Referenceformore informationregardingthisoption.
ItishighlyrecommendedthatyoureviewyourcurrentOracle documentation regardingtheduplexbackupfunction.
Removing old backups
Data ProtectionforOracleusestheTivoliStorageManager backuprepository.Each database backupcreates anew objectwith auniquename.Sincetheseobjectshave uniquenames,theyalwaysremainactiveandnever expire.Thisallowsthe
DatabaseAdministrator(DBA)tocontrolandcoordinatecopiesremovedfromthe TivoliStorageManager serverwith RMAN.
Note: Makesuretousethesametdpo.optfilethatwas usedfor theoriginal backup.ThisenablesthebackupobjectstobefoundontheTivoliStorage Managerserver.
Example
Toremoveanoldbackup, issuethiscommandfromtheRMAN prompt:
run {
allocate channel for delete type ’sbt_tape’ parms
’ENV=(TDPO_OPTFILE=/orc91/scripts/tdpo.opt)’;
change backupset backupset number delete;
}
See theOracle RMANmanualformoreinformationonthechangecommandand itsoptions.
Management class options affecting object removal
The TivoliStorageManager administratormust specifybackdelete=yeswhen registering yournodeinorderforyoutobeable todeletebackupobjects.Youcan useparametersinthemanagement classdefinitiontocontrolwhentheinactive objectexpiresontheTivoliStorageManagerserver.Forthebackupcopygroup, use:
v
verdeleted=0 v retonly=0
Thesesettingserasetheinactiveobjectsfromtheserverafterthenextinventory expiration. However,be awarethatabackupobjectismarkedforimmediate expirationwhenbackdelete=yesandyoudeleteitthroughRMANusingtheData ProtectionforOracleinterface orwiththetdposyncutility.Alsonotethateven when backdelete=noisspecified,theobjectismarkedinactive.Theverdeleted=0 and retonly=0settingswillremovetheseinactiveobjectsfromtheTivoliStorage Manager serverwhenthenext inventoryexpirationoccurs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|