




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、oracle RAC更换存储迁移数据oracle RAC更换存储迁移数据我们利用ASM rebalanee特性实现更换存储迁移数据的需求 基本零宕机时间(操作步骤总结)1)保证新存储和RAC当前节点间的可用性;2)新存储划分LUN可以重新规划存储方案;3)迁移OCR和表决盘4)给现有ASM磁盘组添加ASM磁盘(新存储分配的),充分利用ASM REBALANCE 技术5)删除原存储的ASM磁盘6)观察期1当前存储信息以下ASM磁盘组、OCR VOTE言息:ASM磁盘组:ASMCMD> IsdgStateTypeRebalSectorBlockAUTotal_MBFree_MB Req_mi
2、r_free_MBUsable_file_MBOffli ne_disksVot ing_filesNameMOUNTED NORMAL N512409610485763071982307109129815353960NBACK/MOUNTED NORMAL N51240961048576409597615617596335684640950NDATA/MOUNTED NORMAL N51240961048576102396101470326505720NOCR/当前ASM有 BACK DATA OCRE个磁盘组,总大小7TB,磁盘组主要存放数据文 件和归档日志文件,CO敢件,以下是各磁盘组磁
3、盘信息:SQL> select NAME,PATH,total_mb,free_mb from v$asm_disk;NAMEPATHTOTAL MBFREE MB广州远佳信息科技有限公司32621202720259400:2006438789+OCR Device/FileDevice/File notDevice/File notDevice/File notDevice/File notBACK_VOL1ORCL:BACK_VOL11023994390436DATA_VOL1ORCL:DATA_VOL11023994390450DATA_VOL2ORCL:DATA_VOL21023
4、994390447DATA_VOL3ORCL:DATA_VOL31023994390426DATA_VOL4ORCL:DATA_VOL410239941023697DATA_VOL5ORCL:DATA_VOL510239941023698DATA_VOL6ORCL:DATA_VOL610239941023696OCR_VOL1ORCL:OCR_VOCR_VOL2ORCL:OCR_VOL23137631077OCR_VOL3ORCL:OCR_VOL3396443931810 rows selected.OCR&VOTS息:gridoracle1 bin$ ./o
5、crcheckStatus of Oracle Cluster Registry is as follows :Versio nTotal space (kbytes)Used space (kbytes)Available space (kbytes): IDDevice/File Namein tegrity check succeededcon figuredcon figuredcon figured con figuredCluster registry in tegrity check succeededLogical corrupti on check bypassed due
6、to non-privileged广州远佳信息科技有限公司广州远佳信息科技有限公司user由于OCR和VOTEDISH都和ASM放在同一个存储上,所以 OCR和VOTEDIS也需要迁移到新的存储上。2新存储磁盘分区要求:(由存储工程师操作)2.1. 共享存储,两台服务器都可以看到新存储分配的磁盘空间2.2. 如之前ASM磁盘组所有存储分区大小,个数保持一致。3划分后磁盘分区rootoracle1 sbi n# fdisk -lDisk /dev/cciss/cOdO: 1000.1 GB, 1000171331584 bytes255 heads, 63 sectors/track, 1215
7、97 cyli ndersUnits = cylinders of 16065 * 512 = 8225280 bytes广州远佳信息科技有限公司广州远佳信息科技有限公司Device BootStart/dev/cciss/c0d0p1 * 9183 Lin ux/dev/cciss/c0d0p28e Li nux LVMEndBlocks Id System113104314121597976623480Disk /dev/sda: 1073.7 GB, 1073741824000 bytes255 heads, 63 sectors/track, 130541 cyli ndersUnit
8、s = cylinders of 16065 * 512 = 8225280 bytesDeviceBootStart/dev/sda1LinuxEnd1Blocks Id System130541104857055183Disk /dev/sdb: 1073.7 GB, 1073741824000 bytes255 heads, 63 sectors/track, 130541 cyli ndersUnits = cylinders of 16065 * 512 = 8225280 bytesDeviceBootStart/dev/sdb1LinuxEnd1Blocks Id System1
9、30541104857055183Disk /dev/sdc: 1073.7 GB, 1073741824000 bytes255 heads, 63 sectors/track, 130541 cyli nders广州远佳信息科技有限公司DeviceBootStart/dev/sdclLinuxEnd1Blocks Id System130541104857055183Disk /dev/sdd: 1073.7 GB, 1073741824000 bytes255 heads, 63 sectors/track, 130541 cyli ndersUnits = cylinders of 1
10、6065 * 512 = 8225280 bytesDeviceBootStart/dev/sdd1LinuxEnd1Blocks Id System130541104857055183Disk /dev/sde: 1073.7 GB, 1073741824000 bytes255 heads, 63 sectors/track, 130541 cyli ndersUnits = cylinders of 16065 * 512 = 8225280 bytesDeviceBootStart/dev/sde1LinuxEnd1Blocks Id System130541104857055183D
11、isk /dev/sdf: 1073.7 GB, 1073741824000 bytes255 heads, 63 sectors/track, 130541 cyli ndersUnits = cylinders of 16065 * 512 = 8225280 bytesDeviceBootStart/dev/sdf1LinuxEnd1Blocks Id System130541104857055183Disk /dev/sdg: 1073.7 GB, 1073741824000 bytes255 heads, 63 sectors/track, 130541 cyli ndersUnit
12、s = cylinders of 16065 * 512 = 8225280 bytesDeviceBootStart/dev/sdg1LinuxEnd1Blocks Id System130541104857055183Disk /dev/sdh: 107.3 GB, 107374182400 bytes广州远佳信息科技有限公司255 heads, 63 sectors/track, 13054 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDeviceBootStartEndBlocksIdSystem/dev/sdh
13、11400032129968+83Lin ux/dev/sdh2400180003213000083Lin ux/dev/sdh38001130544059625583LinuxWARNING: The size of this disk is2.9 TB (2919504019456 bytes). DOS partiti on table format can not be used on drives for volumes larger than 2.2 TB (2199023255040 bytes). Use parted(1) and GUID partiti on table
14、format (GPT).Disk /dev/sdi: 2919.5 GB, 2919504019456 bytes255 heads, 63 sectors/track, 354942 cyli ndersUn its = cyli nders of 16065 * 512 = 8225280 bytesDeviceBootStartEndBlocksIdSystem/dev/sdi111300001044224968+83Linux/dev/sdi21300012673491103255842+83 LinuxDisk /dev/sdj:1073.7 GB,1073741824000byt
15、es新加盘255 heads, 63 sectors/track, 130541 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdj does n't contain a valid partiti on tableDisk /dev/sdk: 1073.7 GB, 1073741824000 bytes 255 heads, 63 sectors/track, 130541 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytes
16、Disk /dev/sdk does n't contain a valid partiti on tableDisk /dev/sdl: 1073.7 GB, 1073741824000 bytes 255 heads, 63 sectors/track, 130541 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdl does n't contain a valid partiti on tableDisk /dev/sdm: 1073.7 GB, 1073741824000 b
17、ytes 255 heads, 63 sectors/track, 130541 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdm does n't contain a valid partiti on tableDisk /dev/sd n: 1073.7 GB, 1073741824000 bytes 255 heads, 63 sectors/track, 130541 cyli nders Units = cylinders of 16065 * 512 = 8225280 byte
18、sDisk /dev/sd n does n't contain a validpartiti on tableDisk /dev/sdo: 1073.7 GB, 1073741824000 bytes 255 heads, 63 sectors/track, 130541 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdo does n't conain a valid partiti on tableDisk /dev/sdp: 1073.7 GB, 1073741824000 b
19、ytes 255 heads, 63 sectors/track, 130541 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdp does n't contain a valid partiti on tableDisk /dev/sdq: 107.3 GB, 107374182400 bytes255 heads, 63 sectors/track, 13054 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDisk
20、 /dev/sdq does n't contain a valid partiti on tableDisk /dev/sdr: 2919.5 GB, 2919504019456 bytes 255 heads, 63 sectors/track, 354942 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDisk /dev/sdr does n't contain a valid partiti on tableDisk /dev/sds: 322.1 GB, 322122547200 bytes25
21、5 heads, 63 sectors/track, 39162 cyli nders Units = cylinders of 16065 * 512 = 8225280 bytesDeviceLinux LVMDisk /dev/sdt: 322.1 GB, 322122547200 bytes255 heads, 63 sectors/track, 39162 cyli ndersUn its = cyli nders of 16065 * 512 = 8225280 bytesDeviceBootStartEndBlocks Id System/dev/sdt1139162314568
22、733+ 8eLi nux LVM4配置ASM新磁盘/etc/i ni t.d/oracleasm createdisk DATA_VOL01 /dev/sdj1/etc/i ni t.d/oracleasm createdisk DATA_VOL02 /dev/sdk1/etc/i ni t.d/oracleasm createdisk DATA_VOL03 /dev/sdl1/etc/i ni t.d/oracleasm createdisk DATA_VOL04 /dev/sdm1/etc/i ni t.d/oracleasm createdisk DATA_VOL05 /dev/sd
23、n1/etc/i ni t.d/oracleasm createdisk DATA_VOL06 /dev/sdo1/etc/i ni t.d/oracleasm createdisk BACK_VOL01 /dev/sdp1/etc/i ni t.d/oracleasm createdisk OCR_VOL4 /dev/sdq1/etc/i ni t.d/oracleasm createdisk OCR_VOL5 /dev/sdq2/etc/i ni t.d/oracleasm createdisk OCR_VOL6 /dev/sdq35创建新的OCRNE磁盘组su - gridsqlplus
24、 / as sysasmCREATE DISKGROUP OCRNEW NORMAL REDUNDANCYDISK 'ORCL:OCR_VOL4' NAME VOL4DISK 'ORCL:OCR_VOL5' NAME VOL5DISK 'ORCL:OCR_VOL6' NAME VOL6 ATTRIBUTE 'compatible.asm'='11.2'6添力卩OCR信息至U OCRNEWrootoracle1 bin# ./ocrco nfig -add+OCRNEWrootoracle1 bin# ./ocrch
25、eck -configOracle Cluster Registry configuration is :Device/File Name:+OCRDevice/File Name:+OCRNEWrootoracle1 bin# more /etc/oracle/ocr.loc#Device/file getti ng replaced by device +OCRNEWocrc onfigo c=+OCRocrmirrorco nfigoc=+OCRNEWrootoracle1 bin #可以看到OCRNE磁盘组已经成功添加到0C磁盘信息中迁移vote文件当前votedisk 信息File
26、NameDiskgridoracle1 $ crsctl query css votedisk # STATE File Universal Id group1. ONLINE14f694d9d4414f9ebf85d3ce6b9aef0b(ORCL:OCR_VOL1) OCR2. ONLINE9f9ee7281c954f8abfcc6e88c33257ac(ORCL:OCR_VOL2) OCR3. ONLINE38114fd602194fa9bf4d05655b3d89b7(ORCL:OCR_VOL3) OCRLocated 3 vot ing disk(s).gridoracle1 $ c
27、rsctl replace votedisk +OCRNEWSuccessful addition of voti ng disk 00634ef593ee4f92bf48e8c089cb5565.Successful addition of voti ng disk 232159722de04f67bf03a78b757e3bec.Successful addition of voti ng disk a340d5b23aac4f6fbf9f7b1d59088fa5.Successful deletion of voti ng disk 14f694d9d4414f9ebf85d3ce6b9
28、aef0b.Successful deletion of voti ng disk 9f9ee7281c954f8abfcc6e88c33257ac.Successful deletion of vot ing disk 38114fd602194fa9bf4d05655b3d89b7. Successfully replaced voti ng disk group with +OCRNEW.CRS-4266: Vot ing file(s) successfully replaced7 创建 ASM实例 spfile 到 OCR_NEW创建ASM实例spfile 到新创建的OCR_NEAS
29、M磁盘组上(在一个节点grid用户 登录ASM实例执行)SQL> create pfile='/home/grid/asmpfile.ora' from spfile;File created.SQL> create spfile='+OCRNEW from pfile='/home/grid/asmpfile.ora'File created.8删除ASM磁盘组OCRrootoracle1 bin# ./ocrconfig -delete +OCR查看OCF和VOTE新状态与位置rootoracle1 bin# ./ocrcheck &am
30、p;& ./crsctl query css votediskStatus of Oracle Cluster Registry is as follows :Versio n:3Total space (kbytes):262120Used space (kbytes):2768Device/File Name:+OCRNEWDevice/File in tegrity check succeededDevice/File not con figuredDevice/File not con figuredDevice/File not con figuredDevice/File
31、not con figuredCluster registry in tegrity check succeededLogical corrupti on check succeeded# STATE File Universal IdFile NameDiskgroup1. ONLINE 00634ef593ee4f92bf48e8c089cb5565 (ORCL:OCR_VOL4)OCRNEW2. ONLINE 232159722de04f67bf03a78b757e3bec (ORCL:OCR_VOL5)OCRNEW3. ONLINE a340d5b23aac4f6fbf9f7b1d59
32、088fa5 (ORCL:OCR_VOL6)OCRNEWLocated 3 vot ing disk(s).SYS+ASM1> alter diskgroup OCR dismou nt;Diskgroup altered.SYS+ASM2> drop diskgroup OCR in cludi ng co nte nts;Diskgroup dropped.SYS+ASM2> SQL> selectGROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBIL ITY from v$asm_
33、diskgroup;GROUP_NUMBERNAMESTATETYPETOTAL_MB FREE_MB V COMPATIBILITY1广州远佳信息科技有限公司BACKMOUNTEDNORMAL30719823070675 N .02DATAMOUNTEDNORMAL40959761561759 N .03OCRNEWMOUNTEDNORMAL102396101470 N .0SYS+ASM2> SQL> selectGROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,
34、 name,path, failgroup from v$asm_disk order by GROUP_NUMBER;GROUP_NUMBER DISK_NUMBER STATEREDUNDA TOTAL_MB FREE_MBNAMEPATHFAILGROUP00NORMALUNKNOWN00ORCL:OCR_VOL101NORMALUNKNOWN00ORCL:OCR_VOL202NORMALUNKNOWN00ORCL:OCR_VOL311NORMALUNKNOWN10239941023559ORCL:DATA_VOL501023559ORCL:DATA_VOL4DATA_VOL5DATA_
35、VOL51NORMAL UNKNOWN 1023994DATA_VOL4DATA_VOL41 2NORMAL UNKNOWN10239941023557DATA_VOL6ORCL:DATA_VOL6DATA_VOL622NORMAL UNKNOWN1023994390447DATA_VOL2ORCL:DATA_VOL2DATA_VOL221DATA_VOL12 NORMAL UNKNOWN BACK_VOL1BACK_VOL12 NORMAL UNKNOWN DATA_VOL3DATA_VOL33NORMAL UNKNOWNVOL41023994102399431376VOL4390436OR
36、CL:BACK VOL1390426ORCL:DATA VOL331075ORCL:OCR VOL4GROUP NUMBER DISK NUMBER STATEREDUNDA TOTAL MB NAMEFREE MBPATHFAILGROUP31NORMAL UNKNOWN31376VOL5VOL532NORMAL UNKNOWN39644VOL6VOL613 rows selected.至此整个OCR&VOTIN迁移过程结束31077ORCL:OCR_VOL539318ORCL:OCR_VOL69.这里可以重启下集群crs测试OCR&VOT是否迁移成功,当然你也可以选择 不重
37、启,个人建议重启测试下。查看OCR&VOT位置及ASM实例spfile 位置rootoracle1 bin# ./ocrcheck && ./crsctl query css votedisk Status of Oracle Cluster Registry is as follows :Versio nTotal space (kbytes) Used space (kbytes) Available space (kbytes): ID2621202768259352:20064387893in tegrity check succeededDevice/File
38、 not con figuredDevice/File not con figuredDevice/File not con figuredDevice/File not con figuredCluster registry in tegrity check succeededLogical corrupti on check succeeded# STATE File Universal IdFile NameDiskgroup1. ONLINE 00634ef593ee4f92bf48e8c089cb5565 (ORCL:OCR_VOL4) OCRNEW2. ONLINE 2321597
39、22de04f67bf03a78b757e3bec (ORCL:OCR_VOL5) OCRNEW3. ONLINE a340d5b23aac4f6fbf9f7b1d59088fa5 (ORCL:OCR_VOL6) OCRNEWLocated 3 vot ing disk(s).SQL> show parameter spfile;NAMETYPEVALUEspfilestri ng+OCRNEW/oracle-cluster/asmparameterfile/registry.253.845691887SQL>10迁移数据磁盘组数据SQL>alter diskgroup DA
40、TAadd disk 'ORCL:DATA_VOL01rebalanee power 11;Diskgroup altered.SQL>alter diskgroup DATAadd disk 'ORCL:DATA_VOL02rebalanee power 11;Diskgroup altered.'ORCL:DATA VOL04tebalaneeDATAadd disk11;powerSQL>alter diskgroupDiskgroup altered.SQL>alter diskgroupDiskgroup altered.SQL>alt
41、er diskgroupSQL>alter diskgroupDiskgroup altered.back add diskback add disk BACKadd disk'ORCL:DATA VOL05tebalanee'ORCL:DATA_VOL06rebala nee 'ORCL:BACK VOL01rebalaneepowerpower power11;11;11;由于指定rebalanee power 11, ASM会自动均衡ASM磁盘组DATA里面存放的数据在各ASM磁盘的分布 当rebalanee结束后,查询V$ASM_OPERATlOJ图,将不
42、会返回信息 SQL> seleet * from V$ASM_OPERATION;no rows seleeted 11删除数据磁盘组上的旧磁盘alter diskgroup data drop disk 'BACK_VOL1' rebala nee power 11;alter diskgroup data drop disk 'DATA_VOL2' rebala nee power 11;alter diskgroup data drop disk 'DATA_VOL3' rebala nee power 11;alter diskgr
43、oup baek drop disk 'DATA_VOL4' rebala nee power 11;alter diskgroup baek drop disk 'DATA_VOL5' rebala nee power 11;alter diskgroup baek drop disk 'DATA_VOL6' rebala nee power 11;ASM不但向磁盘组中加入新磁盘时会做 rebalanee,在删除ASM磁盘时也会 rebalanee,将该磁盘上的数据rebalanee到其他该磁盘组的磁盘中。按照此方法删除ASMH盘后,ASM的所
44、有数据都已经存放在新的存储上。09:40:38 SQL> seleet a.NAME GROUP_NAME,a.TOTAL_MB,a.FREE_MB GROUP_FREE_MB,b.OS_MB,b.FREE_MB,b. name,b.path from v$asm_diskgroup a,v$asm_disk b where a.GROUP_NUMBER=b.GROUP_NUMBER;GROUP_NAMETOTAL_MBGROUP_FREE_MB OS_MB FREE_MBNAMEPATHBACK3071982307086810239941023622DATA_VOL05ORCL:DATA_VOL05BACK3071982307086810239941023624DATA_VOL06ORCL:DATA_VOL06OCRNEW1023961014703137631075广州远佳信息科技有限公司VOL4
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025至2030年低温干燥鱼粉项目投资价值分析报告
- 2025年成套实木家具项目可行性研究报告
- 2025年多功能电煎扒炉项目可行性研究报告
- 会员促销活动方案策划书3
- 2025年烯丙雌甾醇项目投资可行性研究分析报告-20241226-214759
- Revision 1(教学设计)-2024-2025学年人教新起点版英语三年级上册
- 求一个数是另一个数的几倍(教学设计)-2024-2025学年三年级上册数学人教版
- 2024-2025年中国办公软件未来趋势预测分析及投资规划研究建议报告
- Unit 5 What does he do(教学设计)-2024-2025学年人教PEP版英语六年级上册
- 2025年度企业内部数据安全保密协议范本
- 2024年晋中职业技术学院单招职业技能测试题库完整参考答案
- DL-T5493-2014电力工程基桩检测技术规程
- 2024年03月广东佛山市禅城区教育系统招考聘用中小学教师120人笔试历年典型题及考点剖析附带答案含详解
- DZ/T 0452.3-2023 稀土矿石化学分析方法 第3部分:锂、铍、钪、锰、钴、镍、铜、锌、镓、铷、铌、钼、铟、铯、钽、钨、铊、铅、铋、钍、铀及15个稀土元素含量的测定 ICP-MS法(正式版)
- 2024年江苏淮阴城市产业投资集团有限公司招聘笔试冲刺题(带答案解析)
- 2024年太仓高新控股有限公司招聘笔试冲刺题(带答案解析)
- 人教版七年级地理下册《全册完整》
- 10kv高压送电专项方案
- 煤炭供应链管理与协同创新
- 健康生活方式与健康促进的科学研究
- 脑卒中患者便秘护理措施课件
评论
0/150
提交评论