《Oracle将数据文件从文件系统迁移至ASM-ORACLE OCP认证考试.docx》由会员分享,可在线阅读,更多相关《Oracle将数据文件从文件系统迁移至ASM-ORACLE OCP认证考试.docx(10页珍藏版)》请在第一文库网上搜索。
1、Orac1e将数据从文件系统迁移至ASM一、要迁移的文件类型有三个,分别是:1、数据文件2、日志文件3、控制文件二、通过查询找到控制文件Su-orac1e.oraenvorc1sq1p1us/assysdbase1ect*fromv$contro1fi1e;se1ect*fromv$datafi1e;这里可以看到,contro1fi1e以及表空间文件的路径均在文件系统上SnHbXaaO一般会先迁移日志文件,如果日志文件不存在了,那只能reset1ogs了,换化身。1、日志.R1物01X乌礴!H1痴列行3.用时OoO9ICMHFITU*D1SWtKUITTtSB1oaSnI1MimKSIOCXI
2、ITDISTATUSIfST.CHAaiF11eTJgIKT.CHMK1BS1mIjTDaICCtfJD11141242MOOOSUIWIu1CnVK2318OOe“第第23138116-5月showparameterdb-recovery_fi1eVA1UENAMETYPEdbjecveryf1e1deststringdb-recovery-f11e_des.s1zebigIntegerSQ1a1tersystemsetdb_recoveryf11e1dest-Tra2;a1tersystemsetdbrecvery-f11e1dest-fra,ERROAatHne1:u01apporac1
3、efast.recovery,area46000MORA-O2097:parametercannotbemodifiedbecausespecifiedva1ueisInva1idORA-01261:Parameterdb-recoveryfi1e-dest(destinationstringcannotbetrans1atedora-01262:satfai1edonafi1edestinationdirectory1iux-x8664Error:2:nosuchfi1eordirectorysq1a1tersystem$exdbrcovery.f11dsx-,fra,;a1ersystem
4、sedb-recovery-f11e_des,fra,ERRORat1ine1:ora-02097:parametercannotbemodifiedbecausespecifiedva1ueUInva1idora-01261:parameterdb_recovery_fi1e-destdesr1ru1onstringCannoKbetrans1atedORA-O1262:Statfai1edonafi1edestinationdirectory1inux-x86.64Error:2:nosuchfi1eordirectorySQ1a1tersystemsetdb.recovery-f11e1
5、dest-+fra,;systema1tered.3、建立1号日志组a1terdatabaseadd1ogfi1egroup1size200M;4、手工进行切换CURRENT状态的日志组a1tersystemswitch1ogfi1e;se1ectresetIogS.change#,CheCkPOinJChange#,currenjscnfromv$database;*MBRMANrmanbackupascopydatabaseformat+data;Startingbackupat077UN-23us1ngtargetdatabasecontro1fi1eInsteadofrecoveryc
6、ata1oga11ocatedchanne1:ora_disk_1channe1ORA_DISK_1:SID-752devicetype-DISKchanne1ORA_DISK_1:startingdaaf11ecopyinputdatafi1efi1enumber=00003name=u01apporac1eoradataRC1undotbs01.dbfoutputfi1ename-+DATAORC1DATAFI1Eundotbs1.288.1138838773tag-TAG202306070006URECID-ISTAMP-1138838776channe1ocDisj.:datafi1e
7、copycomp1exe,e1apsedtime:00:00:07channe1oradisk_1:startingdatafi1ecopyinputdatafi1efi1enumber00001name-u01apporac1eoradaaRC1syse01.dbfoutputfi1ename-+DATAORC1DATAFI1sysem.289.1138838779ag-TAG20230607T000611RECID-2STMP-1138838786channe1ora_disk_1:datafi1ecopycomp1ete,e1apsedtime:00:00:15channe1ORA_di
8、sk_1:startingdatafi1eCoPyInputdatafi1efi1enumber-00002name-u1apporac1eoradaaRC1sysau01.dbfoutputfi1ename=+DATA0RC1DATAFI1Esysau.290.1138838795aq=TAG20230607T000611RKID=3STA1P=1138838796channe1ORA_DISK_1:datafi1ecopycomp1ete,e1apsedtime:00:00:03channe1ORA-DISK_1:startingdatafi1eCOPy1nputdatafefi1enum
9、ber=00004name=u01apporac1eoradaaRC1users01.dbfoutputfi1ename=+DATAORC1DATAFI1Eusers.291.1138838797tag=TAG202306070006URECID4STAMP=II38838797channe1ORA_DISK_1:datafi1ecopycomp1exe,e1apsedtime:00:00:01Finishedbackupat07-JUN-23StartingContro1Fi1eandSPFI1EAirtobackupat07-JUN-23piecehand1e-+FRA/1istcopy;
10、switchdatabasetocopy;这时数据文件全部迁移到了ASM中了三、迁移控制文件,可以重建控制文件在mount状态下执行,指定一下控制文件的路径a1tersystemsetControIJiIes=+data1+fra,scope=spfi1e;在原数据库上生成出控制文件,在mount状态下导出控制文件脚本在rman下执行a1terdatabasebackupcontro1fi1etotraceas7homeorac1econtro1asm.sq;RMANswitchdatabasetocopy;datafi1e1datafi1e2datafi1e3datafi1e4switchedswitchedswitchedswitcheddatafi1edatafi1edatafi1edatafi1eATATATATIIIIFFFFem.u.cbss.2tdOysRMAN编辑控制文件脚本homeorac1econtro1asm.sq1Eorac1eOdb$catcontro1asm.sq1CREATECONTRO1FI1EREUSEDATABASEORC1NORESET1OGSNOARCHIVE1OGMAX1OGFI1ES16MAX1OGMEMBERS3MAXDATAFI1ESIOOMAXINS