《HPUX系统备份及恢复策略.ppt》由会员分享,可在线阅读,更多相关《HPUX系统备份及恢复策略.ppt(68页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、China TCO internal use HP-UX HP-UX系统备份及恢复策略系统备份及恢复策略China TCO internal use用户利益用户利益最大程度减小数据恢复给业务带来的影响;使您的备份与恢复策略更为有效;减少您听到“我们恢复不了您的数据”的机会;提供改进您的备份与恢复流程的建议;图形表达备份与恢复流程;China TCO internal use备份数据策略恢复数据策略灾难恢复流程故障报警备份系统高可用性数据库联机备份备份管理制定完善的备份管理流程制定完善的备份管理流程China TCO internal use数据备份的忠告数据备份的忠告1.选用适当的备份设备和备
2、份软件2.尽可能使用多于一个的物理设备3.经常有规律的作备份4.至少保存两份最新的备份5.定义备份进度:方式、频率、时序和保管6.备份权限的设定7.备份步骤信息的记录8.定时清洁和维护设备9.数据恢复和故障预演China TCO internal usev映像备份映像备份映像备份映像备份备份整个磁盘作为一个映像限制:恢复时要求作为一个映像,不可依据文件类型限制卷的大小适合灾难恢复v基于文件的备份基于文件的备份基于文件的备份基于文件的备份逐个文件的备份支持各种备份方式1.全备分2.增量备份3.差分备份备份和恢复的灵活性更慢,独立于文件存取的速度数据备份的类型数据备份的类型China TCO in
3、ternal uselevel0全备份Full backuplevel2差分备份Differential backuplevel1增量备份Incremental backup备份方式备份方式China TCO internal use恢复过程恢复过程仅需一盘磁盘tape 1+x tapetape 1+(x-1)tapeslevel0全备份Full backuplevel2差分备份Differential backuplevel1增量备份Incremental backupChina TCO internal useBackup and Recovery Procedures1.拜访用户2.现状
4、分析3.制定策略4.用户确认开始结束China TCO internal useStep1拜访用户拜访用户对备份技术进行讲解,主要介绍备份与恢复的重要性和必要性,以及备份与恢复的内容,方法和策略。Backup and Recovery Procedures 1China TCO internal usevObjectives of Backup/RecoveryvScope of Backup/RecoveryvType of Backup SolutionvSystem Backup/Recovery UtilitiesvSystem Recovery ToolsvTypical Syste
5、m Backup SolutionvBackup WindowBackup and Recovery on HP-UX SystemWhy Backup?v Hardware(Disk)Failurev Database/Application Corruptionv Administrator Errorv User Errorv Site Disaster“Therearetwotypeofcomputerusers,thosethathavelostdataandthosethatwill”What should be backed up?v Operating System files
6、 and configuration v Disk layout informationv User profiles and home directoriesv Application and database binaries and filesv The data from the applicationThedataincludes:Type of Backup Solutionv OS/Database Backupv Incremental/Full Backupv Online/Offline Backupv Local/Network BackupChina TCO inter
7、nal useSystem Backup/Recovery UtilitiesStandard UNIX Utilitiestar,cpio,dump/restore,vxdump/vxrestore,dd,mtHP-UX Utilites(HP_UX only)fbackup/frecoverSAMUtilitiesCOPYUTILmake_recoveryChina TCO internal usebackup utilities introducefbackupfbackupRecommendedsystembackuputility.Foreachfiletransferred,the
8、filescontentsandallrelevantinformationnecessarytorestoreittoanequivalentstatearecopiedtooutputdevice,whichcanberawmagnetictapedrive,thestandardoutput,DDS-formattape,rewritablemagneto-opticaldiskorafile.frecoverfrecoverReadsmediawrittenbyfbackup,andcopiesspecifiedfilesfromthismediatospecifiedlocation
9、.vfbackup andfrecover areproprietaryutilitiesusableonlyonHP-UXsystems.vSAMusesfbackup andfrecover asitsbackupprograms.tartarSavesandrestoresfilesonmagnetictape,flexibledisk,orregularfile.cpiocpioSavesandrestoresarchivesoffilesonmagnetictape,otherdevices,oraregularfile,andcopiesfilesfromonedirectoryt
10、oanotherwhilereplicatingthedirectorytreestructure.ddddAll-purposeutilitythatcopiesto/fromrawdevices.Dataconversionispossible.Itisoftenusedtosaveorrestoreinformationdisk-to-disk.Copiesspecifiedinputfiletospecifiedoutput;usually,bothinputandoutputfilesaredevicefiles.China TCO internal usetar-tape arch
11、ivevBackup a directory:#cd /data#tar cvf /dev/rmt/0m .vRestore all files from a tape:#cd /datatar xvf /dev/rmt/0mvRestore one file from a tape:#cd /data#tar xvf /dev/rmt/0m./file1.txtvCreate a index of the file list on the tape:#tar tvf /dev/rmt/0m /tmp/index.txt/data/dataChina TCO internal usetar s
12、yntax$tar key arg.file|-C directoryKeys:cxvfmutrwhCommonkeys:c Createarchive.x Extractarchive.t Listnamesofallfilesinarchive.r Appendfile(s)toendofexistingarchive.If-C directory isspecified,tar willchangetodirectory andcontinuesaveorrestore.China TCO internal use对系统全对系统全备份备份#tarcvf/dev/rmt/0m/备份备份某某
13、目录目录#tarcvf/dev/rmt/0m/tmp改变文件改变文件的的备份路径备份路径#tarcvf/dev/rmt/0m-C/tmp.Note:路径/tmp在磁带上的备份路径变为./#cd/tmp#tarcvf/dev/rmt/0m./*恢复恢复数据数据#tarxvf/dev/rmt/0m(磁带上所有数据)#tarxvf/dev/rmt/0m/tmp(恢复目录/tmp)查看查看磁带磁带上的数据上的数据#tartvf/dev/rmt/0mtar命令应用China TCO internal usedd exampleTocopyanentirediskdrivetoanotheridentic
14、ally-sizeddevice:#dd if=/dev/rdsk/c0t1d0 of=/dev/rdsk/c3t3d0 bs=4096China TCO internal usedd syntax#dd if=input_file of=output_file bs=block_sizeWarning:Datawillbedestroyedontheoutputfilelocation.Ensurethatthecorrectoutputfileisdesignatedtopreventunintentionaldatadestruction.China TCO internal usecp
15、io exampleTousewiththefind commandtobackupallfilesandsub-directoriesofthe/home directory:$find/home-print|cpio-ocB /dev/rmt/0mToprintalistingoffilesstoredonabackupcreatedbycpio:$cpio-itBv /dev/rmt/0mTorestoreafilefromacpio backup:$cpio-icBv/etc/lvmtab /dev/rmt/0mChina TCO internal usecpio syntax$cpi
16、o-o-e extarg achvxABC$cpio-i bodfmrstuvxBPRSU6 pattern$cpio-p-e extarg adlmruvxU directoryCommonoptions:o Copyout(export)specifiedfilestoarchivei Copyin(import)specifiedfilesfromarchivep Duplicatedirectorytree(passthrough)c WriteorreadheaderinformationinASCIIcharacterformatforportabilityd Createdire
17、ctoriesasneededt Printtableofcontentsonly.B Blockinput/outputat5120bytestorecord.Useonlywithdatadirectedtoorfromdevicesthatsupportvariable-lengthrecords.v Printfilecharacteristics(numeric-mode,owner,blocks,date,filename)pattern Onlyfilesthatmatchpattern aresaved/restoreddirectory Destinationdirector
18、ytreeChina TCO internal usefbackup/frecovervBackup a directory:#fbackup-f /dev/rmt/0m-i/datavRestore all files from a tape:#frecover-orf/dev/rmt/0mvRestore one file from a tape:#frecover-oxf /dev/rmt/0m -i /data/file1.txtvCreate a index of the file list on the tape:#frecover-f/dev/rmt/0m-I/tmp/index
19、.txt/data/dataChina TCO internal usefbackup syntax#fbackup-f devicefile-0-9 optionsWhere:-f devicefile Identifiesbackupdevice-0-9 Backuplevel(0=fullbackup;1-9indicatesincremental)Commonoptions:-i filename Informsfbackup toincludefilefilename.-e filename Informsfbackup toexcludefilefilename.-I filena
20、me Createsanindexinfilename.-g filename Thefilename specifiesanASCIIfilewhichcontainsfiletreestoincludeorexclude.China TCO internal usefbackup命令应用一1进入进入单用户单用户#shutdown-y0#/etc/mount-a2系统全系统全备份备份#fbackupf/dev/rmt/0m-0iv/-I/tmp/sysbk.index-f:设备文件名(suchasDDStapedriver)-i:要包含的目录-e:不包含的目录-I:备份内容检索目录-v:备份
21、内容详细列表-0:零级备份#fbackupf/dev/rmt/0m-i/-e/home备份除了目录/home的所有目录3说明说明1)该命令方式对系统当前”mounted“的文件系统进行备份2)备份级别说明备份级别有09个级别,如果当前系统采用零级备份,当下一次采用5级备份时,系统仅将会对有变化的文件进行备份China TCO internal use1#mkdir-p/tmp/fbackupfiles/index#mkdir-p/tmp/fbackupfiles/log2#touch/tmp/fbackupfiles/index/full.date+%y%m%d.%H:%M3进入单用户#shu
22、tdowny0#/etc/mount-a4对系统进行全备份#fbackup0vi/-f/dev/rmt/0m-I/tmp/fbackupfiles/index/full.date+%y%m%d.%H:%M2/tmp/fbackupfiles/log/full.date+%y%m%d.%H:%M5说明通过该方式可以知到系统备份需要的时间fbackup命令应用二China TCO internal usefbackup命令应用三1进入单用户#shutdowny0#/etc/mount-a2对系统进行全备份#fbackup0uv/-f/dev/rmt/0m-g/tmp/fbackupfiles/my
23、graph-I/tmp/fbackupfiles/index/full.date+%y%m%d.%H:%M2/tmp/fbackupfiles/log/full.date+%y%m%d.%H:%M3说明a.文件mygraph:包含需要备份的目录,格式如下:i/users/datai/home/appe/oracle/sqlb.参数u:当备份系统成功时,系统将更新/var/adm/fbackupfiles/dates.China TCO internal usefbackup命令应用四备份远程系统1登录在本地系统时#remshbackup_sysname”fbackupfDDS_sysname:
24、/dev/rmt/0m-0vi/”2登录在远程系统时#fbackupfbackup_sysname:/dev/rmt/0m0vi/China TCO internal usefbackup命令应用五压缩方式备份(不建议使用、影响系统性能)1压缩方式备份#fbackup0vi/dir-f-|compress|ddof=/dev/rmt/0mobs=10k“”:指向标准输出2查看备份内容#ddif=/dev/rmt/0mibs=10k|uncompress|frecoverI-f-China TCO internal usefrecover syntax#frecover-r-hmosvyAFNO
25、X-f device-c config -S skip-E extarg#frecover-x-hmosvyAFNOX-f device-c config-S skip-E extarg-e path-i path -g graph#frecover-I path vy-f device-c config#frecover-V path vy-f device-c configCommonoptions:-r Recoverallfilesonbackuptape.-x Filesidentifiedby-i(include),-e(exclude)org(graphfile)areextra
26、cted/notextracted.-V path Writevolumeheadertopath.-o Recoverfilesregardlessofage.-X Recoverfilesrelativetocurrentworkingdirectory.China TCO internal use恢复磁带机上所有内容:1进入单用户:#shutdown-y0#/etc/mount-a2恢复数据#frecoverrf/dev/rmt/0m恢复磁带上的所有数据-f:设备文件名-r:恢复磁带上的所有数据-I:将磁带上文件索引存到指定的文件中#frecoverI/tmp/index.txt-f/d
27、ev/rmt/0mfrecover命令应用一China TCO internal usefrecover命令应用二恢复某一目录:#frecover-xi/directory#frecoverx-i/dir1-i/dir2#frecover-xoi/dir-o:覆盖/dir下已有的、相同名称的文件#frecover-xvXi/dir-X:按磁带上目录恢复数据#cd/tmp/local;frecoverxvYi/dir-Y:按磁带上文件名恢复数据例如:#cd/tmp/local#frecoverxvF-i/home/filename恢复结果/tmp/local/filename不是/home/fi
28、lenameChina TCO internal usefrecover命令应用三从远程磁带机上恢复数据到本地:#frecoverxi/dirfremote_name:/dev/rmt/0mChina TCO internal usefrecover命令应用四从本地磁带机上恢复数据到远地系统:#remshremote_name”frecoverxi/dir-flocal_name:/dev/rmt/0m”China TCO internal useInternal of fbackup/datarecordrecordrecordrecordrecordrecord.fbackuprdrfba
29、ckuprdrfbackuprdrfbackupwtrfbackupIn-MemoryAreaChina TCO internal useSAM-Backup and RecoveryAutomated Backupsproduces log and index filesE-Mail results to specified userInteractive Backup and Restoreincremental file system backup and restoreChina TCO internal use1.RunSAM.2.SelectSAMareaBackup and Re
30、covery.3.SelectareaAutomated Backups.4.SelectmenuoptionActions.Add an Automated Backup.5.Choosewhetheritisalocalorremotebackup.The“AddanAutomatedBackup”windoworscreendisplays.6.ChooseSelect Backup Scope.The“SelectBackupScope”windoworscreendisplays.7.Specifywhichareincluded files(filestobackup)andwhi
31、chareexcluded files(optionalwhichfilesnottobackup).SelectBackup Scope of:o Specified Files,whichmustbetypedinbyfileordirectorynameexplicitly.o Local File Systems Only(No NFS)o All File Systems(Includes NFS),whichincludesallfilesystemsrecognizedbythesystem,nomatterwhattype.8.ChooseSpecify Backup Devi
32、ce fromoptions.9.Selectthebackupdevicefromlist.Itmaybenecessarytoindicatetapedeviceoptions,also.setup automated backup using SAMChina TCO internal use10.ChooseSelect Backup Time fromoptions.The“SelectBackupTime”windoworscreendisplays,asinthisexample:o Enterthetimeandday(s)forthefullandincremental(if
33、enabled)backupstobeperformed.o ThetimemustbeenteredinHH:MM format.Therefore,2:00isunacceptable,but02:00isacceptable.o Notethatdayisenteredbyeitherdayofweekordayofmonth(whichliststhenumbers1-31forselection).Youcanselectmorethanonedayforthebackuptobeperformed.11.Optionally,selectSet Additional Paramet
34、ers.Specifyemailaddressofusertonotifyofbackups,forexample.12.Whenthe“AddanAutomatedBackup”windoworscreennextdisplays,selectOK,andthe“BackupandRecovery”windoworscreendisplays.Itlistsallconfiguredautomaticbackupsforthesystem,forviewingandverification,asnecessary.setup automated backup using SAMChina T
35、CO internal useSAM备份方法1)备份数据#sam-Select“BackupandRecovery“-Select“InteractiveBackupandRecovery“-Select“BackupDevice“-Select“BackupFilesInteractively“(FromActionmenus)-SelectBackupScope-SelectLocalFileSystemsOnly(noNFS)-Select“OK“2)检查备份的数据1检查文件/var/sam/log/br_log-Fullbackupstartedonhost1:Wedoct1615:1
36、0:09EAT1998(ScheduledBackup)fbackup0uvg/etc/sam/br/graphDCAa04366I/var/sam/log/br_indext.full-c/etc/sam/br/fbackup_configd/var/adm/fbackupfiles/datesf/dev/rmt/c1td0d0BEST2&1Fullbackupcompletedonhost1:WedOct1616:44:01EAT1998Exitcode=0-Notes:ifExitcode=2,thereisproblemonbackupprocedure.2查看磁带上有那些文件#fre
37、coverrNsvf/dev/rmt/0mChina TCO internal usebackup disk using COPYUTIL1.BoottoISL.2.RuntheCopyUtility.ISL ode copyutilODEcopyrightmessageandCOPYUTILcopyrightmessagedisplay.Itthenscansthedevicebussesanddisplaysinformationaboutthestoragedevicesithasdetectedonthesystem.Example:Ty Indx Path Product ID Bu
38、s Size Rev-D 0 2/0/1.0.0 QUANTUMLPS270S disc drive SCSI 258 MB 5909D 1 2/0/1.1.0 SEAGATEST3600N disc drive SCSI 499 MB 9686D 2 2/0/1.3.0 HPC2244 disc drive SCSI 1.0 GB 0B04T 3 2/0/1.5.0 HPC1504X/HPC1521B DDS tape SCSI N/A 1009D 4 2/0/1.6.0 QUANTUMLPS270S disc drive SCSI 258 MB 59093.Runbackup.COPYUT
39、IL backup4.Specifythediskindexnumberfromwhichthebackupwillcome,andthenthetapeindexnumbertowhichthebackupwillgo.Example:TocopydataoffthelastQuantumdiskdrive(diskindex4)ontotheDDStapedrive(tapeindex3).Enter the Disk Index(q/?):4Enter the Tape Index(q/?):35.Followinstructionstoloadthetapeintothetapedri
40、ve,ifnotalreadydone,andenter“y”tocontinue.Thebackupbeginstothetape,withscreenoutputindicatingwhatpercentagehasbeenbackeduptothetape.Thismaytakeanhourormore.6.ExitCOPYUTIL.China TCO internal useCOPYUTIL备份方法1)如何启动“Copyutil“1从CDboot,进入ISLBOOT_ADMINbootscsi.n.m(pathofCDROMdrive-suchasscsi.4.0)2ISLodecop
41、yutilTypehelpforcommandinformation3ISL_CMDcopyutilpleasewaitwhilescandevicebussessTYIndxPathProductIDBusSizeRevD016/5.6.0SEAGATEST31230NdiskdriveSCSI1.0GBHPM4D116/5.5.0SEAGATEST31230NdiskdriveSCSI1.0GBHPM4T216/5.0.0HPC1504X/HPC1521BDDStapeSCSIn/a10092)备份系统硬盘上的所有数据COPYUTILbackupEnterthediskindex(q/?)
42、:0EntertheTapeindex(q/?):2Usedatacompression?(y/n)?YWhenbackupfinished,systemwillshow:DONE!COPYUTILexit3)恢复数据到指定的系统硬盘上COPYUTILrestoreEntertheTapeindex(q/?):2Enterthediskindex(q/?):0Usedatacompression?(y/n)?YAftersystemdisplay:RestoredSuccessful,thatmeansrestoreisfinished!COPYUTILexit4)注意:当用copyutil备
43、份RootDisk到相应的磁带时,该磁带可以作为bootable磁带使用China TCO internal useNeeds for System RecoveryFailed boot/root diskCorrupt OS(ie:non bootable)Backout path from upgradeDisaster RecoveryHP-UX 11.00HP-UX 10.20China TCO internal useSystem Setup for Easier RecoveryHow a system is setup can greatly effect ease and a
44、bility to recover:vSINGLE disk in root Volume Group,mirrored if possible.vDedicated to Operating System.VG00Only need to recover one disk!China TCO internal usePossible Root Disk Layouts/stand48MBprimaryswap=memory/100MBsecondaryswap+dump?/usr400MB/opt200MB/var300MB/tmp100MB/home?Sparespacerestofdis
45、kChina TCO internal useMethods to Recover SystemReinstallation COPYUTILmake_recoveryChina TCO internal useWhat is“make_recovery”?vRestore a non-bootable system with little or no manual interventionvRestore a system after replace the corrupted root diskvClone the software from one system to another-m
46、igration,disaster recoveryvConvert from hfs to vxfs file systemsvModify root file system or primary swap space size An easy to use system administration tool to create a System Recovery Tape.Part of Ignite-UX.Can be used to:China TCO internal useHow to use make_recovery?-backup/opt/ignite/bin/make_r
47、ecovery-AprvC-ddestination-bboot_destination-AIncludetheentirerootdiskvolumegroup-pPreviewmode/createsfilesbutdoesntwritetape-rResumecreationaftereditingfilestoinclude/excludelist-vVerbosemode-dTapedrivedevicefile(defaultis/dev/rmt/0m)-bLocationtoassemblefiles32MBneeded(defaultis/var/tmp)-CCreatesta
48、tusfileforlatercomparisonwithcheck_recoverytoolTypicalUsage:#make_recovery-A-C#make_recovery-A-v-d/dev/rmt/1mChina TCO internal useHow to use make_recovery?-RecoveryInsert the System Recovery Tape into the tape driveboot the systeminterrupt the auto-boot sequence and boot from the tape drive(The tap
49、e drive always is the Alternate Boot Path)Choose no interactive with ISLAllow the recover process to complete.Reboot from the root disk(Primary Boot Path).China TCO internal use1)安装1从“HP-UXApplicationCD-ROM“上安装1)#swinstall2)“Mark”A.1.53HP-UXInstallationUtility(Ignite-uxfor10.20)3)“Analysis”4)“Instal
50、l”2从WebSite下载并安装:1)http:/ TCO internal use备份系统根盘备份系统根盘1创建“最小”OS的bootableDDStape(default设备文件:/dev/rmt/0mn)#make_recovery2创建“最小”OS的bootableDDStape(设备文件:/dev/rmt/c0t1d1BESTn)#make_recoveryd/dev/rmt/c0t1d1BESTn3先预览,再创建bootableDDStape#make_recovery-p#vi/var/opt/ignite/recovery/arch.include#make_recovery-