《HPUX系统备份及恢复策略.pptx》由会员分享,可在线阅读,更多相关《HPUX系统备份及恢复策略.pptx(68页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、China TCO internal use HP-UX HP-UX系统备份及恢复策略系统备份及恢复策略HPUX系统备份及恢复策略共68页,您现在浏览的是第1页!China TCO internal use用户利益用户利益最大程度减小数据恢复给业务带来的影响;使您的备份与恢复策略更为有效;减少您听到“我们恢复不了您的数据”的机会;提供改进您的备份与恢复流程的建议;图形表达备份与恢复流程;HPUX系统备份及恢复策略共68页,您现在浏览的是第2页!China TCO internal use备份数据策略恢复数据策略灾难恢复流程故障报警备份系统高可用性数据库联机备份备份管理制定完善的备份管理流程制定
2、完善的备份管理流程HPUX系统备份及恢复策略共68页,您现在浏览的是第3页!China TCO internal usev映像备份映像备份映像备份映像备份备份整个磁盘作为一个映像限制:恢复时要求作为一个映像,不可依据文件类型限制卷的大小适合灾难恢复v基于文件的备份基于文件的备份基于文件的备份基于文件的备份逐个文件的备份支持各种备份方式1.全备分2.增量备份3.差分备份备份和恢复的灵活性更慢,独立于文件存取的速度数据备份的类型数据备份的类型HPUX系统备份及恢复策略共68页,您现在浏览的是第4页!China TCO internal use恢复过程恢复过程仅需一盘磁盘tape 1+x tapet
3、ape 1+(x-1)tapeslevel0全备份Full backuplevel2差分备份Differential backuplevel1增量备份Incremental backupHPUX系统备份及恢复策略共68页,您现在浏览的是第5页!China TCO internal useStep1拜访用户拜访用户对备份技术进行讲解,主要介绍备份与恢复的重要性和必要性,以及备份与恢复的内容,方法和策略。Backup and Recovery Procedures 1HPUX系统备份及恢复策略共68页,您现在浏览的是第6页!Why Backup?v Hardware(Disk)Failurev D
4、atabase/Application Corruptionv Administrator Errorv User Errorv Site Disaster“Therearetwotypeofputerusers,thosethathavelostdataandthosethatwill”HPUX系统备份及恢复策略共68页,您现在浏览的是第7页!Type of Backup Solutionv OS/Database Backupv Incremental/Full Backupv Online/Offline Backupv Local/Network BackupHPUX系统备份及恢复策略
5、共68页,您现在浏览的是第8页!China TCO internal usebackup utilities introducefbackupfbackupRemendedsystembackuputility.Foreachfiletransferred,thefilescontentsandallrelevantinformationnecessarytorestoreittoanequivalentstatearecopiedtooutputdevice,whichcanberawmagnetictapedrive,thestandardoutput,DDS-formattape,rew
6、ritablemagneto-opticaldiskorafile.frecoverfrecoverReadsmediawrittenbyfbackup,andcopiesspecifiedfilesfromthismediatospecifiedlocation.vfbackup andfrecover areproprietaryutilitiesusableonlyonHP-UXsystems.vSAMusesfbackup andfrecover asitsbackupprograms.tartarSavesandrestoresfilesonmagnetictape,flexible
7、disk,orregularfile.cpiocpioSavesandrestoresarchivesoffilesonmagnetictape,otherdevices,oraregularfile,andcopiesfilesfromonedirectorytoanotherwhilereplicatingthedirectorytreestructure.ddddAll-purposeutilitythatcopiesto/fromrawdevices.Dataconversionispossible.Itisoftenusedtosaveorrestoreinformationdisk
8、-to-disk.Copiesspecifiedinputfiletospecifiedoutput;usually,bothinputandoutputfilesaredevicefiles.HPUX系统备份及恢复策略共68页,您现在浏览的是第9页!China TCO internal usetar syntax$tar key arg.file|-C directoryKeys:cxvfmutrwhCommonkeys:c Createarchive.x Extractarchive.t Listnamesofallfilesinarchive.r Appendfile(s)toendof
9、existingarchive.If-C directory isspecified,tar willchangetodirectory andcontinuesaveorrestore.HPUX系统备份及恢复策略共68页,您现在浏览的是第10页!China TCO internal usedd exampleTocopyanentirediskdrivetoanotheridentically-sizeddevice:#dd if=/dev/rdsk/c0t1d0 of=/dev/rdsk/c3t3d0 bs=4096HPUX系统备份及恢复策略共68页,您现在浏览的是第11页!China T
10、CO internal usecpio exampleTousewiththefind mandtobackupallfilesandsub-directoriesofthe/home directory:$find/home-print|cpio-ocB /dev/rmt/0mToprintalistingoffilesstoredonabackupcreatedbycpio:$cpio-itBv /dev/rmt/0mTorestoreafilefromacpio backup:$cpio-icBv/etc/lvmtab /dev/rmt/0mHPUX系统备份及恢复策略共68页,您现在浏览
11、的是第12页!China 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/ind
12、ex.txt/data/dataHPUX系统备份及恢复策略共68页,您现在浏览的是第13页!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:备份内容详细列表-0:零级备份#fbackupf/dev/rmt/0m-i/-e/home备份除了目录/home的所有目录3说明说明1)该
13、命令方式对系统当前”mounted“的文件系统进行备份2)备份级别说明备份级别有09个级别,如果当前系统采用零级备份,当下一次采用5级备份时,系统仅将会对有变化的文件进行备份HPUX系统备份及恢复策略共68页,您现在浏览的是第14页!China TCO internal usefbackup命令应用三1进入单用户#shutdowny0#/etc/mount-a2对系统进行全备份#fbackup0uv/-f/dev/rmt/0m-g/tmp/fbackupfiles/mygraph-I/tmp/fbackupfiles/index/full.date+%y%m%d.%H:%M2/tmp/fbac
14、kupfiles/log/full.date+%y%m%d.%H:%M3说明a.文件mygraph:包含需要备份的目录,格式如下:i/users/datai/home/appe/oracle/sqlb.参数u:当备份系统成功时,系统将更新/var/adm/fbackupfiles/dates.HPUX系统备份及恢复策略共68页,您现在浏览的是第15页!China TCO internal usefbackup命令应用五压缩方式备份(不建议使用、影响系统性能)1压缩方式备份#fbackup0vi/dir-f-|press|ddof=/dev/rmt/0mobs=10k“”:指向标准输出2查看备份
15、内容#ddif=/dev/rmt/0mibs=10k|unpress|frecoverI-f-HPUX系统备份及恢复策略共68页,您现在浏览的是第16页!China TCO internal use恢复磁带机上所有内容:1进入单用户:#shutdown-y0#/etc/mount-a2恢复数据#frecoverrf/dev/rmt/0m恢复磁带上的所有数据-f:设备文件名-r:恢复磁带上的所有数据-I:将磁带上文件索引存到指定的文件中#frecoverI/tmp/index.txt-f/dev/rmt/0mfrecover命令应用一HPUX系统备份及恢复策略共68页,您现在浏览的是第17页!C
16、hina TCO internal usefrecover命令应用三从远程磁带机上恢复数据到本地:#frecoverxi/dirfremote_name:/dev/rmt/0mHPUX系统备份及恢复策略共68页,您现在浏览的是第18页!China TCO internal useInternal of fbackup/datarecordrecordrecordrecordrecordrecord.fbackuprdrfbackuprdrfbackuprdrfbackupwtrfbackupIn-MemoryAreaHPUX系统备份及恢复策略共68页,您现在浏览的是第19页!China TCO
17、 internal use1.RunSAM.2.SelectSAMareaBackup and Recovery.3.SelectareaAutomated Backups.4.SelectmenuoptionActions.Add an Automated Backup.5.Choosewhetheritisalocalorremotebackup.The“AddanAutomatedBackup”windoworscreendisplays.6.ChooseSelect Backup Scope.The“SelectBackupScope”windoworscreendisplays.7.
18、Specifywhichareincluded files(filestobackup)andwhichareexcluded files(optionalwhichfilesnottobackup).SelectBackup Scope of:o Specified Files,whichmustbetypedinbyfileordirectorynameexplicitly.o Local File Systems Only(No NFS)o All File Systems(Includes NFS),whichincludesallfilesystemsrecognizedbythes
19、ystem,nomatterwhattype.8.ChooseSpecify Backup Device fromoptions.9.Selectthebackupdevicefromlist.Itmaybenecessarytoindicatetapedeviceoptions,also.setup automated backup using SAMHPUX系统备份及恢复策略共68页,您现在浏览的是第20页!China TCO internal useSAM备份方法1)备份数据#sam-Select“BackupandRecovery“-Select“InteractiveBackupan
20、dRecovery“-Select“BackupDevice“-Select“BackupFilesInteractively“(FromActionmenus)-SelectBackupScope-SelectLocalFileSystemsOnly(noNFS)-Select“OK“2)检查备份的数据1检查文件/var/sam/log/br_log-Fullbackupstartedonhost1:Wedoct1615:10:09EAT1998(ScheduledBackup)fbackup0uvg/etc/sam/br/graphDCAa04366I/var/sam/log/br_ind
21、ext.full-c/etc/sam/br/fbackup_configd/var/adm/fbackupfiles/datesf/dev/rmt/c1td0d0BEST2&1Fullbackuppletedonhost1:WedOct1616:44:01EAT1998Exitcode=0-Notes:ifExitcode=2,thereisproblemonbackupprocedure.2查看磁带上有那些文件#frecoverrNsvf/dev/rmt/0mHPUX系统备份及恢复策略共68页,您现在浏览的是第21页!China TCO internal useCOPYUTIL备份方法1)如
22、何启动“Copyutil“1从CDboot,进入ISLBOOT_ADMINbootscsi.n.m(pathofCDROMdrive-suchasscsi.4.0)2ISLodecopyutilTypehelpformandinformation3ISL_CMDcopyutilpleasewaitwhilescandevicebussessTYIndxPathProductIDBusSizeRevD016/5.6.0SEAGATEST31230NdiskdriveSCSI1.0GBHPM4D116/5.5.0SEAGATEST31230NdiskdriveSCSI1.0GBHPM4T216/5
23、.0.0HPC1504X/HPC1521BDDStapeSCSIn/a10092)备份系统硬盘上的所有数据COPYUTILbackupEnterthediskindex(q/?):0EntertheTapeindex(q/?):2Usedatapression?(y/n)?YWhenbackupfinished,systemwillshow:DONE!COPYUTILexit3)恢复数据到指定的系统硬盘上COPYUTILrestoreEntertheTapeindex(q/?):2Enterthediskindex(q/?):0Usedatapression?(y/n)?YAftersyste
24、mdisplay:RestoredSuccessful,thatmeansrestoreisfinished!COPYUTILexit4)注意:当用copyutil备份RootDisk到相应的磁带时,该磁带可以作为bootable磁带使用HPUX系统备份及恢复策略共68页,您现在浏览的是第22页!China TCO internal useSystem Setup for Easier RecoveryHow a system is setup can greatly effect ease and ability to recover:vSINGLE disk in root Volume
25、Group,mirrored if possible.vDedicated to Operating System.VG00Only need to recover one disk!HPUX系统备份及恢复策略共68页,您现在浏览的是第23页!China TCO internal useMethods to Recover SystemReinstallation COPYUTILmake_recoveryHPUX系统备份及恢复策略共68页,您现在浏览的是第24页!China TCO internal useHow to use make_recovery?-backup/opt/ignite
26、/bin/make_recovery-AprvC-ddestination-bboot_destination-AIncludetheentirerootdiskvolumegroup-pPreviewmode/createsfilesbutdoesntwritetape-rResumecreationaftereditingfilestoinclude/excludelist-vVerbosemode-dTapedrivedevicefile(defaultis/dev/rmt/0m)-bLocationtoassemblefiles32MBneeded(defaultis/var/tmp)
27、-CCreatestatusfileforlaterparisonwithcheck_recoverytoolTypicalUsage:#make_recovery-A-C#make_recovery-A-v-d/dev/rmt/1mHPUX系统备份及恢复策略共68页,您现在浏览的是第25页!China TCO internal use1)安装1从“HP-UXApplicationCD-ROM“上安装1)#swinstall2)“Mark”A.1.53HP-UXInstallationUtility(Ignite-uxfor10.20)3)“Analysis”4)“Install”2从WebS
28、ite下载并安装:1).software.hp./Select:“Network&Systemadministration”Download:“ignite-ux_10.20.tar”(10.20为OS版本)2)从硬盘上安装:#cd/tmp#tarxvf/dev/rmt/0m./ignite-ux_10.20.tar#swinstalls/tmp/ignite-ux_10.20.tar3)从磁带上安装:#ddif=/tmp/ignite-ux_10.20.tarof=/dev/rmt/0mbk=2#swinstalls/dev/rmt/0m2)make_recovery语法#/opt/igni
29、te/binmake_recovery-AprvC-ddestination-bboot_destination-A:指定要备份整个Rootdisk/VolumeGroup-p:预览备份过程,并不创建BootableDDSTapea.确认/var/opt/ignite/recovery/mkrec.append文件b.创建/var/opt/ignite/recovery/arch.include文件-r:使用p选项后,可以用该选项创建BootableDDSTapea.该选项可以识别/var/opt/ignite/recovery/arch.include文件-v:用于显示备份过程的提示信息-d
30、:指定DDS的设备文件名(default:/dev/rmt/0mn)-b:指定系统备份过程中,用到的临时文件(default:/var/tmp/uxinstlf.recovery)该文件大小为32M,对系统进行make_recovery时,要注意/var文件系统的大小,当/var文件系统大小不足时,可用如下命令对系统进行备份:#make_recoveryA-C-b/tmp/uxinstlf.recovery-C:创建反映系统当前状态的文件:/var/opt/ignite/recovery/makrec.last如果该文件存在,那么可以用check_recovery命令注意:make_recov
31、ery备份的磁带是bootable磁带,用它可以安装OS。make_recovery应用应用HPUX系统备份及恢复策略共68页,您现在浏览的是第26页!China TCO internal use(1)系统文件系统:Filesystemkbytesusedavail%usedMountedon/dev/vg01/osdepot262144025308388487297%/osdepot/dev/vg01/lvol14803415869637361014%/var/dev/vg01/lvol73789652975214354787%/usr/dev/vg01/lvol65886432455402
32、8423846%/opt/dev/vg00/lvol3107669385775832540%/dev/vg00/lvol167733124094855020%/stand/dev/vg00/lvol43059719275180%/tmp/dev/vg00/lvol5198611416164588%/home(2)分析:amake_recovery:vg00:/stand,/sbin,/dev,/etc,/tmp,/homevg01:partsof/optand/var(seeCore-OSlist)/usr/bin,/usr/lib/usr/obam,/usr/sam,/usr/share,/
33、usr/ccs,/usr/conf,/usr/lbin,/usr/contrib,/usr/local,/usr/newconfigbmake_recovery-A:vg00:备份RootVolumeGroup上的所有数据vg01:备份non-RootvolumeGroup上的所有数据只有当/usr位于non-rootvolumegroup时,该non-rootvolumegroup上的所有数据也将被备份到磁带上。make_recovery实例分析HPUX系统备份及恢复策略共68页,您现在浏览的是第27页!China TCO internal use交互式恢复系统数据交互式恢复系统数据1在磁带
34、机中,插入系统恢复带2Boot系统3中断Boot流程,进入Boot_admin提示下4Boot_adminbo8/16.0.08/16.0.0:磁带机的hardwarepath5不选取“non-interactive”6选取a.InstallHP-UXb.AdvancedInstallationc.配置或改变如下选项:disks,filesystems,hostname,IPddress,timezone,rootpassword,DNSserver,andgateway7选取installcontinue,直到系统恢复完毕HPUX系统备份及恢复策略共68页,您现在浏览的是第28页!China
35、 TCO internal useTypical System Backup SolutionDataofDBMSHP-UXOSPlatformApplicationSystemSystemRecoveryTools:make_recovery,copyutilfbackup/frecover,tarDatabaseAdministrationTools:(PleasecontactDatabaseVendorforassistant)HPUX系统备份及恢复策略共68页,您现在浏览的是第29页!China TCO internal useBackup Window Specifies the
36、time available for Backup-more applicable for offline backup where application is taken down to perform backupTimes specified can be:zDaily backup Database data/transaction log backup,etc.zWeekly backupDatabase data dump,etc.zMonthlyOS backup update,etc.HPUX系统备份及恢复策略共68页,您现在浏览的是第30页!China TCO intern
37、al useStep 3 制定策略制定策略根据对用户当前的备份与恢复的状况和实际需求,为用户制定相应的备份与恢复策略,并参考相应的文档资料模板,提交给用户正式的报告。Backup and Recovery Procedures 3HPUX系统备份及恢复策略共68页,您现在浏览的是第31页!China TCO internal use这部分内容主要包括一些HP-UX用到的文件系统,如/,/opt,/var,/tmp,/usr,/home,/stand通常这些文件系统位于vg00中。备份的方法:(1)fbackup:#fbackup0vi/-f/dev/rmt/0m-I/tmp/fbackupfi
38、les/index/full.date+%y%m%d.%H:%M2/tmp/fbackupfiles/log/full.date+%y%m%d.%H:%M(2)make_recovery:#make_recoveryC-A-b/tmp/oslif.recHP-UX Core-OS备份策略HPUX系统备份及恢复策略共68页,您现在浏览的是第32页!China TCO internal use逻辑卷备份策略逻辑卷备份策略备份的方法:(1)fbackup:#fbackup0uv/-f/dev/rmt/0m-g/tmp/fbackupfiles/mygraph-I/tmp/fbackupfiles/i
39、ndex/full.date+%y%m%d.%H:%M2/tmp/fbackupfiles/log/full.date+%y%m%d.%H:%M(2)tar#tarcvf/dev/rmt/0m/oracle/app/home/oracleHPUX系统备份及恢复策略共68页,您现在浏览的是第33页!China TCO internal use3 TapesWeek 1:Full backup+4 partialWeek 2:Full backup+4 partialWeek 3:Full backup+4 partial6 TapesFriday 1:Full backupMonday:Part
40、ial backupTuesday:Partial backupWednesday:Partial backupThursday:Partial backupFriday 2:Full backup10 TapesMonday:Partial backupTuesday:Partial backupWednesday:Partial backupFriday 1:Full backupFriday 2:Full backupFriday 3:Full backupThursday:Partial backupMonth 1:Backup(Friday 4)Month 2:BackupMonth
41、 3:Backup磁带轮换策略举例磁带轮换策略举例HPUX系统备份及恢复策略共68页,您现在浏览的是第34页!China TCO internal useBackup and Recovery Procedures 4Step 4 用户确认用户确认和用户一起讨论”备份与恢复策略”,并对用户提出的问题进行解答.最后方案得到用户的确认。HPUX系统备份及恢复策略共68页,您现在浏览的是第35页!China TCO internal use数据备份的忠告数据备份的忠告1.选用适当的备份设备和备份软件2.尽可能使用多于一个的物理设备3.经常有规律的作备份4.至少保存两份最新的备份5.定义备份进度:方式
42、、频率、时序和保管6.备份权限的设定7.备份步骤信息的记录8.定时清洁和维护设备9.数据恢复和故障预演HPUX系统备份及恢复策略共68页,您现在浏览的是第36页!China TCO internal uselevel0全备份Full backuplevel2差分备份Differential backuplevel1增量备份Incremental backup备份方式备份方式HPUX系统备份及恢复策略共68页,您现在浏览的是第37页!China TCO internal useBackup and Recovery Procedures1.拜访用户2.现状分析3.制定策略4.用户确认开始结束HP
43、UX系统备份及恢复策略共68页,您现在浏览的是第38页!China TCO internal usevObjectives of Backup/RecoveryvScope of Backup/RecoveryvType of Backup SolutionvSystem Backup/Recovery UtilitiesvSystem Recovery ToolsvTypical System Backup SolutionvBackup WindowBackup and Recovery on HP-UX SystemHPUX系统备份及恢复策略共68页,您现在浏览的是第39页!What s
44、hould be backed up?v Operating System files and configuration v Disk layout informationv User profiles and home directoriesv Application and database binaries and filesv The data from the applicationThedataincludes:HPUX系统备份及恢复策略共68页,您现在浏览的是第40页!China TCO internal useSystem Backup/Recovery UtilitiesS
45、tandard UNIX Utilitiestar,cpio,dump/restore,vxdump/vxrestore,dd,mtHP-UX Utilites(HP_UX only)fbackup/frecoverSAMUtilitiesCOPYUTILmake_recoveryHPUX系统备份及恢复策略共68页,您现在浏览的是第41页!China TCO internal usetar-tape archivevBackup a directory:#cd /data#tar cvf /dev/rmt/0m .vRestore all files from a tape:#cd /data
46、tar 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/dataHPUX系统备份及恢复策略共68页,您现在浏览的是第42页!China TCO internal use对系统全备份对系统全备份#tarcvf/dev/rmt/0m/备份某目录备份某目录#tarcvf/dev/rmt/0m/tmp改变文件的备
47、份路径改变文件的备份路径#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命令应用HPUX系统备份及恢复策略共68页,您现在浏览的是第43页!China TCO internal usedd syntax#dd if=input_file of=output_file bs=block_
48、sizeWarning:Datawillbedestroyedontheoutputfilelocation.Ensurethatthecorrectoutputfileisdesignatedtopreventunintentionaldatadestruction.HPUX系统备份及恢复策略共68页,您现在浏览的是第44页!China TCO internal usecpio syntax$cpio-o-e extarg achvxABC$cpio-i bodfmrstuvxBPRSU6 pattern$cpio-p-e extarg adlmruvxU directoryCommonop
49、tions:o Copyout(export)specifiedfilestoarchivei Copyin(import)specifiedfilesfromarchivep Duplicatedirectorytree(passthrough)c WriteorreadheaderinformationinASCIIcharacterformatforportabilityd Createdirectoriesasneededt Printtableofcontentsonly.B Blockinput/outputat5120bytestorecord.Useonlywithdatadi
50、rectedtoorfromdevicesthatsupportvariable-lengthrecords.v Printfilecharacteristics(numeric-mode,owner,blocks,date,filename)pattern Onlyfilesthatmatchpattern aresaved/restoreddirectory DestinationdirectorytreeHPUX系统备份及恢复策略共68页,您现在浏览的是第45页!China TCO internal usefbackup syntax#fbackup-f devicefile-0-9 o