Thứ Tư, 29 tháng 8, 2018

Chuyển OCR, Voting disk ASM trong Oracle Clusterware 11g

I. TAO DISKGROUP CRS_NEW


1. Yêu cu disk

-- B 69 Cylinders     đu tiên trong solaris vì ghi vào b li
Total disk cylinders available: 2728 + 2 (reserved cylinders)

Part      Tag    Flag     Cylinders        Size            Blocks
  0       root    wm       0 -   34      131.25MB    (35/0/0)     268800
  1       swap    wu      35 -   69      131.25MB    (35/0/0)     268800
  2     backup    wu       0 - 2727        9.99GB    (2728/0/0) 20951040
  3 unassigned    wm       0               0         (0/0/0)           0
  4 unassigned    wm       0               0         (0/0/0)           0
  5 unassigned    wm       0               0         (0/0/0)           0
  6        usr    wm      70 - 2727        9.73GB    (2658/0/0) 20413440
  7 unassigned    wm       0               0         (0/0/0)           0


2. Gán quyn trn c 2 node

# chown -R oracle:asmadmin /dev/rdsk/c6t60060E801663D800000163D80000002Dd0s6;chmod  660 /dev/rdsk/c6t60060E801663D800000163D80000002Dd0s6;ls -lL /dev/rdsk/c6t60060E801663D800000163D80000002Dd0s6
crw-rw----   1 oracle   asmadmin 118, 368 Oct 17 16:19 /dev/rdsk/c6t60060E801663D800000163D80000002Dd0s6
        
# chown -R oracle:asmadmin /dev/rdsk/c6t60060E801663D800000163D80000002Ed0s6;chmod  660 /dev/rdsk/c6t60060E801663D800000163D80000002Ed0s6;ls -lL /dev/rdsk/c6t60060E801663D800000163D80000002Ed0s6
crw-rw----   1 oracle   asmadmin 118, 368 Oct 17 16:19 /dev/rdsk/c6t60060E801663D800000163D80000002Ed0s6
         
# chown -R oracle:asmadmin /dev/rdsk/c6t60060E801663D800000163D80000002Fd0s6; chmod  660 /dev/rdsk/c6t60060E801663D800000163D80000002Fd0s6;ls -lL /dev/rdsk/c6t60060E801663D800000163D80000002Fd0s6
crw-rw----   1 oracle   asmadmin 118, 368 Oct 17 16:19 /dev/rdsk/c6t60060E801663D800000163D80000002Fd0s6


3. Tao diskgroup

VNC
# . grid
# env |grep ORA
# asmca

Hoặc dùng câu lệnh:

CREATE DISKGROUP CRS2 NORMAL REDUNDANCY disk 
 '/dev/rdsk/c15t60060E80212E360050602E36000000A4d0s6' name CRS1,
'/dev/rdsk/c15t60060E80212E360050602E36000000A5d0s6' name CRS2,
'/dev/rdsk/c15t60060E80212E360050602E36000000A6d0s6' name CRS3
ATTRIBUTE 'compatible.asm' = '11.2';

Note

- Nếu quên  'compatible.asm' = '11.2' thì nó sẽ mặc định là 10.2 --> Phải tạo lại.

- Nếu tạo diskgroup như này thì bị lỗi chuyển votedisk (chuyển OCR OK):

CREATE DISKGROUP CRS NORMAL REDUNDANCY
FAILGROUP failgrp1 DISK
 '/dev/rdsk/c15t60060E80212E360050602E36000000A4d0s6' name CRS1,
'/dev/rdsk/c15t60060E80212E360050602E36000000A5d0s6' name CRS2
FAILGROUP failgrp2 DISK
'/dev/rdsk/c15t60060E80212E360050602E36000000A6d0s6' name CRS3
ATTRIBUTE 'compatible.asm' = '11.2';


4.Check

$ asmcmd lsdg
$ asmcmd lsdsk


II. Chuyển phân vùng cho OCR từ diskgroup +CRS sang +CRS_NEW 


-- Kiểm tra vị trí OCR hiện tại

root@db1 # export GRID_HOME=/u01/grid
root@db1 # $GRID_HOME/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       3316
         Available space (kbytes) :     258804
         ID                       : 2002922109
         Device/File Name         :       +CRS
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

         Cluster registry integrity check succeeded

--Thêm + CRS_NEW datagroup làm vị trí CRS_NEW mới và xác minh trạng thái: thuc hien CHI TREN 1 NODE

root@db1  # $GRID_HOME/bin/ocrconfig -add +CRS_NEW
root@db1  # $GRID_HOME/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
     Version                  :          3
     Total space (kbytes)     :     262120
     Used space (kbytes)      :       3664
     Available space (kbytes) :     258456
     ID                       :  630679368
     Device/File Name         :      +CRS
                                    Device/File integrity check succeeded
     Device/File Name         :       +CRS_NEW
                                    Device/File integrity check succeeded

-- Xóa vị trí OCR cũ: thuc hien CHI TREN 1 NODE

# $GRID_HOME/bin/ocrconfig -delete +CRS
# $GRID_HOME/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
     Version                  :          3
     Total space (kbytes)     :     262120
     Used space (kbytes)      :       3664
     Available space (kbytes) :     258456
     ID                       :  630679368
     Device/File Name         :       +CRS_NEW
                                    Device/File integrity check succeeded

III. Chuyển các voting disk vào một nhóm đĩa ASM mới


- Kiểm tra trạng thái hiện tại:

# $GRID_HOME/bin/crsctl   query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   43c494c88aad4f76bf5cf37ed6196a71 (/dev/rdsk/c6t60060E8004A53B000000A53B00000002d0s6) [CRS]
 2. ONLINE   152e4218b35f4f97bf20b262bdb8b70c (/dev/rdsk/c6t60060E8004A53B000000A53B00000003d0s6) [CRS]
 3. ONLINE   3cfaf90fe4914f7dbfd52e16b33f7fa2 (/dev/rdsk/c6t60060E8004A53B000000A53B00000004d0s6) [CRS]
Located 3 voting disk(s).

--Đặt lại vị trí cho Voting Disks: thuc hien CHI TREN 1 NODE

$GRID_HOME/bin/crsctl  replace votedisk +CRS_NEW
Successful addition of voting disk 0850980df1024fcfbfc077b9c6935a17.
Successful addition of voting disk 0ca6719843734f16bfb62f22f94f399c.
Successful addition of voting disk 4383a5ad43324fa2bff759ce20ba0c3f.
Successful deletion of voting disk 10c81d1ce5a14fb6bf35cbb22fff3ebf.:1
Successful deletion of voting disk 98010612be6b4fc9bf3bc1b186d8758d.
Successful deletion of voting disk 9688bec3914d4f70bfc959664ddd8584.
Successfully replaced voting disk group with +CRS_NEW.
CRS-4266: Voting file(s) successfully replaced

-- Kiểm tra

#  $GRID_HOME/bin/crsctl   query css votedisk
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   b0e94e5d83054fe9bf58b6b98bfacd65 (/dev/asmdisk5_udev_sdf1) [CRS_NEW]
 2. ONLINE   88c2a08b4c8c4f85bf0109e0990388e4 (/dev/asmdisk6_udev_sdg1) [CRS_NEW]
 3. ONLINE   1108f9a41e814fb2bfed879ff0039dd0 (/dev/asmdisk7_udev_sdh1) [CRS_NEW]

--+Check alert_+ASM1.log, alert_+ASM2.log

NOTE: Creating voting files in diskgroup CRS_NEW
Mon Oct 17 22:15:21 2016
NOTE: Voting File refresh pending for group 4/0x48e0be8d (CRS_NEW)
NOTE: Attempting voting file creation in diskgroup CRS_NEW
NOTE: voting file allocation on grp 4 disk CRS_NEW_0000
NOTE: voting file allocation on grp 4 disk CRS_NEW_0001
NOTE: voting file allocation on grp 4 disk CRS_NEW_0002
Mon Oct 17 22:15:23 2016
NOTE: Deleting voting files in diskgroup CRS
NOTE: Voting File refresh pending for group 1/0x20c0b393 (CRS)
NOTE: Attempting voting file refresh on diskgroup CRS
NOTE: Attempting voting file refresh on diskgroup CRS_NEW
NOTE: Voting file relocation is required in diskgroup CRS_NEW
NOTE: Attempting voting file relocation on diskgroup CRS_NEW

ĐỌC NHIỀU

Trần Văn Bình - Oracle Database Master