Chinaunix首页 | 论坛 | 博客
  • 博客访问: 719060
  • 博文数量: 191
  • 博客积分: 10987
  • 博客等级: 上将
  • 技术积分: 1925
  • 用 户 组: 普通用户
  • 注册时间: 2009-04-22 09:52
文章分类

全部博文(191)

文章存档

2014年(10)

2011年(11)

2010年(38)

2009年(132)

分类: Oracle

2014-05-21 10:46:15

OS: Solaris 10 SPARC 64bit
GI: 11.2.0.4.2
DB: 11.2.0.4.2
OCR存储方式: ASM
DB存储方式: ASM

 1, 新的存储设备划分LUN并且做映射后,在OS通过"format"可以看到新的磁盘,修改磁盘属主及权限;

点击(此处)折叠或打开

  1. chown grid:asmadmin /dev/rdsk/c9t600601601DC0310064D1C64F2FDBE311d0s6
  2. chown grid:asmadmin /dev/rdsk/c9t600601601DC0310066D1C64F2FDBE311d0s6
  3. chown grid:asmadmin /dev/rdsk/c9t600601601DC0310068D1C64F2FDBE311d0s6
  4. chown grid:asmadmin /dev/rdsk/c9t600601601DC031006AD1C64F2FDBE311d0s6
  5. chown grid:asmadmin /dev/rdsk/c9t600601601DC031006CD1C64F2FDBE311d0s6
  6. chown grid:asmadmin /dev/rdsk/c9t600601601DC031006ED1C64F2FDBE311d0s6
  7. chown grid:asmadmin /dev/rdsk/c9t600601601DC0310070D1C64F2FDBE311d0s6
  8. chown grid:asmadmin /dev/rdsk/c9t600601601DC03100C2A66C942FDBE311d0s6
  9. chown grid:asmadmin /dev/rdsk/c9t600601601DC03100C4A66C942FDBE311d0s6
  10. chown grid:asmadmin /dev/rdsk/c9t600601601DC03100C6A66C942FDBE311d0s6

  11. chmod 660 /dev/rdsk/c9t600601601DC0310064D1C64F2FDBE311d0s6
  12. chmod 660 /dev/rdsk/c9t600601601DC0310066D1C64F2FDBE311d0s6
  13. chmod 660 /dev/rdsk/c9t600601601DC0310068D1C64F2FDBE311d0s6
  14. chmod 660 /dev/rdsk/c9t600601601DC031006AD1C64F2FDBE311d0s6
  15. chmod 660 /dev/rdsk/c9t600601601DC031006CD1C64F2FDBE311d0s6
  16. chmod 660 /dev/rdsk/c9t600601601DC031006ED1C64F2FDBE311d0s6
  17. chmod 660 /dev/rdsk/c9t600601601DC0310070D1C64F2FDBE311d0s6
  18. chmod 660 /dev/rdsk/c9t600601601DC03100C2A66C942FDBE311d0s6
  19. chmod 660 /dev/rdsk/c9t600601601DC03100C4A66C942FDBE311d0s6
  20. chmod 660 /dev/rdsk/c9t600601601DC03100C6A66C942FDBE311d0s6

2,通过ASM磁盘的Rebalance迁移+DATA磁盘组,每添加或删除一块磁盘后查看v$asm_disk,检查磁盘的MOUNT_STATUS和HEADER_STATUS,以及v$asm_operation来确认Rebalance已经完成,再进行下一项操作;

点击(此处)折叠或打开

  1. SQL> ALTER DISKGROUP data DROP DISK 'DATA_0000' ADD DISK '/dev/rdsk/c9t600601601DC0310064D1C64F2FDBE311d0s6' REBALANCE POWER 5;

  2. Diskgroup altered.

  3. SQL> ALTER DISKGROUP data DROP DISK 'DATA_0001' ADD DISK '/dev/rdsk/c9t600601601DC0310066D1C64F2FDBE311d0s6' REBALANCE POWER 5;

  4. Diskgroup altered.

  5. SQL> ALTER DISKGROUP data DROP DISK 'DATA_0002' ADD DISK '/dev/rdsk/c9t600601601DC0310068D1C64F2FDBE311d0s6' REBALANCE POWER 5;

  6. Diskgroup altered.

  7. SQL> ALTER DISKGROUP data DROP DISK 'DATA_0003' ADD DISK '/dev/rdsk/c9t600601601DC031006AD1C64F2FDBE311d0s6' REBALANCE POWER 5;

  8. Diskgroup altered.

  9. SQL> ALTER DISKGROUP data DROP DISK 'DATA_0004' ADD DISK '/dev/rdsk/c9t600601601DC031006CD1C64F2FDBE311d0s6' REBALANCE POWER 5;

  10. Diskgroup altered.

3,迁移+FRA磁盘组

点击(此处)折叠或打开

  1. SQL> ALTER DISKGROUP fra DROP DISK 'FRA_0000' ADD DISK '/dev/rdsk/c9t600601601DC031006ED1C64F2FDBE311d0s6' REBALANCE POWER 5;

  2. Diskgroup altered.

  3. SQL> ALTER DISKGROUP fra DROP DISK 'FRA_0001' ADD DISK '/dev/rdsk/c9t600601601DC0310070D1C64F2FDBE311d0s6' REBALANCE POWER 5;

  4. Diskgroup altered.

4,迁移OCR;
    在集群其中一个节点手动备份OCR

点击(此处)折叠或打开

  1. -bash-3.2# pwd
  2. /u01/app/11.2.0/grid/bin
  3. -bash-3.2# ./ocrconfig -manualbackup

  4. nnmdb-node01 2014/05/16 12:59:12 /u01/app/11.2.0/grid/cdata/nnmdb-cluster/backup_20140516_125912.ocr
  5. -bash-3.2# ./ocrconfig -showbackup manual

  6. nnmdb-node01 2014/05/16 12:59:12 /u01/app/11.2.0/grid/cdata/nnmdb-cluster/backup_20140516_125912.ocr
     在其一个节点使用新磁盘创建OCR磁盘组+OCRV

点击(此处)折叠或打开

  1. SQL> CREATE DISKGROUP OCRV NORMAL REDUNDANCY
  2.   2 FAILGROUP ocrv_0000 DISK '/dev/rdsk/c9t600601601DC03100C2A66C942FDBE311d0s6'
  3.   3 FAILGROUP ocrv_0001 DISK '/dev/rdsk/c9t600601601DC03100C4A66C942FDBE311d0s6'
  4.   4 QUORUM FAILGROUP ocrv_0002 DISK '/dev/rdsk/c9t600601601DC03100C6A66C942FDBE311d0s6'
  5.   5 ATTRIBUTE 'COMPATIBLE.ASM'='11.2.0.0.0';

  6. Diskgroup created.
     在另外一个节点的ASM实例手动挂载+OCRV磁盘组,确保+OCRV在所有节点都是MOUNT状态

点击(此处)折叠或打开

  1. SQL> ALTER DISKGROUP ocrv MOUNT;

  2. Diskgroup altered.
     迁移OCR文件,在其中一个节点执行

点击(此处)折叠或打开

  1. -bash-3.2# ./ocrconfig -add +OCRV
  2. -bash-3.2# ./ocrcheck
  3. Status of Oracle Cluster Registry is as follows :
  4.          Version : 3
  5.          Total space (kbytes) : 262120
  6.          Used space (kbytes) : 3512
  7.          Available space (kbytes) : 258608
  8.          ID : 526301015
  9.          Device/File Name : +OCR
  10.                                     Device/File integrity check succeeded
  11.          Device/File Name : +OCRV
  12.                                     Device/File integrity check succeeded

  13.                                     Device/File not configured

  14.                                     Device/File not configured

  15.                                     Device/File not configured

  16.          Cluster registry integrity check succeeded

  17.          Logical corruption check succeeded

  18. -bash-3.2# ./ocrconfig -delete +OCR
  19. -bash-3.2# ./ocrcheck
  20. Status of Oracle Cluster Registry is as follows :
  21.          Version : 3
  22.          Total space (kbytes) : 262120
  23.          Used space (kbytes) : 3512
  24.          Available space (kbytes) : 258608
  25.          ID : 526301015
  26.          Device/File Name : +OCRV
  27.                                     Device/File integrity check succeeded

  28.                                     Device/File not configured

  29.                                     Device/File not configured

  30.                                     Device/File not configured

  31.                                     Device/File not configured

  32.          Cluster registry integrity check succeeded

  33.          Logical corruption check succeeded

  34. -bash-3.2#
     注意:如果现有的环境只存在一个OCR文件,不支持“ocrconfig -replace ... -replacement ...”命令替换老的OCR文件

点击(此处)折叠或打开

  1. -bash-3.2# ./ocrconfig -replace '+OCR' -replacement '+OCRV'
  2. PROT-28: Cannot delete or replace the only configured Oracle Cluster Registry location

5, 迁移Vote disk

点击(此处)折叠或打开

  1. -bash-3.2# ./crsctl query css votedisk
  2. ## STATE File Universal Id File Name Disk group
  3. -- ----- ----------------- --------- ---------
  4.  1. ONLINE 3a480248ccbd4fafbf9cd195101034df (/dev/rdsk/c9t6006016042303500B467DF7789C3E311d0s6) [OCR]
  5.  2. ONLINE 85a593e0a5d54fedbf627cbb3aa29f03 (/dev/rdsk/c9t6006016042303500B667DF7789C3E311d0s6) [OCR]
  6.  3. ONLINE 920777d8795b4f58bfff0b6e0b0017e8 (/dev/rdsk/c9t6006016042303500B867DF7789C3E311d0s6) [OCR]
  7. Located 3 voting disk(s).
  8. -bash-3.2#
  9. -bash-3.2# ./crsctl replace votedisk +OCRV
  10. Successful addition of voting disk 242611d97d8b4fb4bf3e1739476e157b.
  11. Successful addition of voting disk a2bc139413fc4f45bf3c4fb76763d03d.
  12. Successful addition of voting disk 2abe81f543ab4fdbbff70a50326f0cec.
  13. Successful deletion of voting disk 3a480248ccbd4fafbf9cd195101034df.
  14. Successful deletion of voting disk 85a593e0a5d54fedbf627cbb3aa29f03.
  15. Successful deletion of voting disk 920777d8795b4f58bfff0b6e0b0017e8.
  16. Successfully replaced voting disk group with +OCRV.
  17. CRS-4266: Voting file(s) successfully replaced
  18. -bash-3.2#
  19. -bash-3.2# ./crsctl query css votedisk
  20. ## STATE File Universal Id File Name Disk group
  21. -- ----- ----------------- --------- ---------
  22.  1. ONLINE 242611d97d8b4fb4bf3e1739476e157b (/dev/rdsk/c9t600601601DC03100C6A66C942FDBE311d0s6) [OCRV]
  23.  2. ONLINE a2bc139413fc4f45bf3c4fb76763d03d (/dev/rdsk/c9t600601601DC03100C2A66C942FDBE311d0s6) [OCRV]
  24.  3. ONLINE 2abe81f543ab4fdbbff70a50326f0cec (/dev/rdsk/c9t600601601DC03100C4A66C942FDBE311d0s6) [OCRV]
  25. Located 3 voting disk(s).

6,迁移ASM实例SPFILE
     在其中一个节点ASM实例的+OCRV磁盘组上创建SPFILE,重启各节点的ASM实例

点击(此处)折叠或打开

  1. SQL> create pfile='/tmp/pfile' from spfile;

  2. File created.
  3. SQL> !more /tmp/pfile
  4. +ASM1.asm_diskgroups='DATA','FRA'#Manual Mount
  5. +ASM2.asm_diskgroups='DATA','FRA'#Manual Mount
  6. *.asm_power_limit=1
  7. *.diagnostic_dest='/u01/app/grid'
  8. *.instance_type='asm'
  9. *.large_pool_size=12M
  10. *.remote_login_passwordfile='EXCLUSIVE'

  11. SQL> create spfile='+OCRV' from pfile='/tmp/pfile';

  12. File created.

7,删除旧的OCR磁盘组
     将+OCR磁盘组从集群资源中移除

点击(此处)折叠或打开

  1. -bash-3.2# ./srvctl stop diskgroup -g ocr -n nnmdb-node01
  2. -bash-3.2# ./srvctl stop diskgroup -g ocr -n nnmdb-node02
  3. -bash-3.2# ./srvctl remove diskgroup -g ocr -f
     在两个节点的ASM实例分别DISMOUNT磁盘组

点击(此处)折叠或打开

  1. SQL> ALTER DISKGROUP ocr DISMOUNT FORCE;

  2. Diskgroup altered.
     在其中一个节点删除磁盘组

点击(此处)折叠或打开

  1. SQL> DROP DISKGROUP ocr FORCE INCLUDING CONTENTS;

  2. Diskgroup dropped.
     存储迁移全部完成,旧的磁盘/LUN可以从服务器物理移除。

阅读(1098) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~