《Oracle热备-ORACLE OCP认证考试.docx》由会员分享,可在线阅读,更多相关《Oracle热备-ORACLE OCP认证考试.docx(4页珍藏版)》请在第一文库网上搜索。
1、Orac1e热备一、数据库要处于归档模式Su-orac1e.oraenvordsq1p1us/assysdbase1ect1og_modefromv$database;sq1se1ect1ojnodefromvSdatabase;1ogjodeARCHIVE1OG这里已经处于归档模式,如果是Ne)ARCH1VE1OG,需要修改为归档模式正常关闭数据库,启动数据库到mount状态,修改归档模式,修改完成后,使数据库处于open状态shutdownimmediate;startupmount;a1terdatabasearchive1og;a1terdatabaseopen;通过Sq1deVe1o
2、Per查看,这时已经处于归档模式一、修改Ord库为归档模式1、查看数据库实例是否处于归档模式通过Sq1PI1is、p1sqkSq1deVeIoPer均可se1ect1og_modefromv$database;如果显示NOARCHIVE1OG,则为非归档模式,非归档模式恢复的数据有线,一般生产环境均为归档模式e1ectfirnBIB2、修改数据库实例为归档模式,正常关闭数据库,启动数据库到mount状态,修改归档模式,修改完成后,使数据库处于open状态shutdownimmediate;startupmount;a1terdatabasearchive1og;a1terdatabaseope
3、n;通过SqIdeVe1OPer查看,这时已经处于归档模式二、在rman下修改默认存放路径Su-orac1e.oraenvorc1rmantarget/showa11;rmansh*a11;usingtargetdatabasecontro1fi1eInsteadofrecoverycata1ogPMANconfigurationparametersfordatabasewithdb.uque-nameORC1are:COWFIGUReRETENTIONPO1ICYTOREDUNDANCY1:defau1tICONFIGUREBACKUPOPTIMIZATIONOFF;*defau1tCONG
4、URECONTRO1FI1ECONFIGURECONTRO1FI1EAUTOBACKUPFORMATFORDCVICETYPSOXSKTO%F;*defau1tCONFIGUREDGVICETYPCDISKPARA11E1ISM1BACKUPTYPETOBACKUPSET;defau1tCOWFIGUREDATAFI1EBACKUPCOPIESFORDEVICETYPGDISKTO1;*defau1tCONFIGUREARCHIVE1OGBACKUPCOPIESPORDEVICETYPEDISKTO1;defau1tCONFIGUREMAXSETSIZETOUN1IMITED;*defau1t
5、CONFIGUREENCRYPTIONFORDATABASEOFT;#defau1tcowfigureEmzryptiona1gorithmAESI28;*defau1tCONFIGURECCWPRESSIOMA1GORXTW,BASXCASOFRE1EASEDEFAU1TOPTIMIZEFOR1OADTRUE;”defau1t:UOWF1GURERMANOUTPUTTOKEEPFOR7DAYS;defau1tCONFIGUREARCHIVE1OGDE1ETIONPO1ICYTOWDNE;defau1tCONFIGUREsnapshotCONTRO1FI1EMWETO,u01apporac1e
6、prodctA9.3.0/dbhcme_2/dbs/snapcf_orc1.f,;#defau1t这时看到默认的存储路径是DISK,修改为SBTCONFIGUREDEFAU1TDEVICETYPETOSBT;RMANCONFIGUREOEFAU1TDEVICETYPETOSbt;newrmanconfigurationparameters:CONFIGUREDEFAU1TDaICETYPETOSBTeTAPE,;newrmanconfigurationparametersaresuccessfu11ystoredssh2AES256.CTR3740行,127,1irWX大可敏字三、通过rman
7、进行热备份backupdatabase;如果是文件系统或者真实环境的磁带机,这时候备份已经成功了maubackupdatabase;Startingbackupat07-jn-23a11ocatedchanne1:ora_sbt_tapej1channe1ORAeSBJTAPe:sD268deviceypes-TAPEchanne10RA-S-TAP-i:orac1esecureBaCkUPchanne1ORA-SBTeTAPEJ1:startingfu11datafi1ebackupsexchanne1OftAwSBTTAPtJ.:specifyingdatafi1es)inbackupse
8、tpputdatafi1efi1enunber-00003me-DATAORC1DATAFi1Eundotbs1.288,1138838773inputdatafi1efi1enunber-OOOO1e-DATA0RC10ATAFi1Esyset.289.1138838779IInputdatafi1efi1enutber-00002name-+DATAbRC1DATAFX1Esysau.290.1138838795inputdatafi1efi1enunber00004nae+DATA/ORC1/DATAF11E/users.291.1138838797channe1ORA-SBTeTAPE
9、J1:startingpiece1at07-JUN-23channe1ORA_5BT.APCJ1:finishedpiece1at07-JUN-23p1chind1三、在ObtoO1下配置电子标记su-obtoo1Ismfmkfsdbmkfssexamp1e四、在rman下配置通道Su-orac1e.oraenvordrmantarget/CONFIGUREchanne1devicetypesbtparms,ENV=(OB-MEDIA-FAMI1Y=db);CONFIGUREchanne1devicetypesbtparmsENV=(OB_MEDIA_FAMI1Y=sexamp1e),;这里需
10、要注意大小写RMANCONFIGUREchanne11devicetypesbtparms,env.(obediaJari1y),;newrmanconfigurationparameters:CoWFIGURECHANNE11DEVICETYPESBT-TAPCPARMSENV-(B-MEDIA.FAMI1Y-db);newrmanconfigurationparametersaresuccessfu11ystored叫anCONFIGUREchanne12devicetypesbtparms,ENV(OBJ4EDIAeFAHI1Y-Sexamp1e),;newrmanconfigurati
11、onparameters:CONFIGURECHANNE12DCVICSTYPESBT-TAPCPAwHS,ENV-(B-MEDIAtoFMI1Y-Samp1),;newrmanconfigurationparameersaresuccessfu11ystoredRMAshowa11;这里看到两个通道建立完成RMANshowa11;rmanconf1gMrat1onparametersfordatabasewithdb.uniquenameORC1are:CONFIGUREReTEMT工ONPO1ICYTOREDUNDANCY1:defau1tCONFIGUREBACKUPOPTIMIZATI
12、ONOFF;defau1tCONFIGUREOeFAU1TDEVICETYPETOSBT-TAPE,;CONFIGURECONTRO1FI1EATOBACKUPON;#defau1tCONFIGURECONTRO1FI1EAUTOBACKUPFORMATFORDEVICETYPESBT.TAPETO%F:夕defau1tCONFIGURECONTRO1FI1EA1rToBACKUPFORHATFORDEVICETYPEDISKTO3;defau1tCONFIGUREDCVICETYPESOT-TAP,PARA11E1ISM2BACKUPTYPETOBACKUPST;CONFIGUREDGVXC
13、ETYPEDISKPARA11E1ISM1BACKUPTYPETOBACKUPSCT;defau1tCONFIGUREDATAFI1EBACKUPCOPIESFOROEVICETYPESBTjrAPfTO1;defau1tCONFIGUREDATAFX1CBACKuPCOPIESFORDEVICETYPEDISKTO1;defau1tCONFIGUREARCHIVE1OGBACKUPCOPIESFOAOGVICETYPEST-TAPETO1;,defau1tCONFIGUREAPCHIVE1OGBACKUPCOPIESFQRDEVICETYPEDISKTQ1;#defau1tCONFIGURE
14、HAXSSIETOUN1IMITED;*defau1tCONFIGUREENCRYPTIONFORDATABASEOFF:*defau1tCONFIGUREENCRYPTIONA1GORITHMAES128;defau1tCONFIGURECCWPftESSXONA1GORITHMBASIC,ASOFRE1EASE,DEFAU1T,OPTIMIZEFOR1OADTRUE;defau1tCONFIGURERMANOUTPUTTOKEEPFOR7DAYS;defau1tCONFIGUREARCHIVE1OGDE1ETIONPO1ICYTOWNG;#defau1tconfiguresnapshotcowTRO1Fi1Enameto,u01apocac1eroducxA9.3.0dboe-2dbssnapcf-orc1.f,defau1tssh2:AES-256-CTR40.740ft127j1wc大号;字五、增量备份,生产环境里很少做f