Hi, In this topic we will drop and recreate the existing disc group named RECO and then, add disk to increase the storage space
[root@testdb01 ~]# cat /etc/oracle-release
Oracle Linux Server release 6.10
[root@testdb01 ~]#
[root@testdb01 ~]# lsblk /dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
├─sdf1 8:81 0 2T 0 part
├─sdf2 8:82 0 50G 0 part
└─sdf3 8:83 0 974G 0 part
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm
listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
RECO02
[root@testdb01 ~]#
[root@testdb01 ~]# blkid | grep asm :( display ASM disk & OS Disk partition exp below)
/dev/sdc1: LABEL="DATA001" TYPE="oracleasm"
lsblk
kfod
$ kfod op=DISKS label=TRUE disks=ALL name=TRUE (Identify ASM Disks Labels)
$ kfod op=DISKS disks=ALL name=TRUE (Identify ASM Disks Labels)
$ kfod op=groups (Check DiskGroup Redundancy)
[root@testdb01 ~]# oracleasm querydisk /dev/sdf1
Device "/dev/sdf1" is marked an ASM disk with the label "DATADISK2"
[root@testdb01 ~]# oracleasm querydisk /dev/sdf2
Device "/dev/sdf2" is marked an ASM disk with the label "RECO01"
[root@testdb01 ~]# oracleasm querydisk /dev/sdf3
Device "/dev/sdf3" is marked an ASM disk with the label "RECO02"
[root@testdb01 ~]#
################################################################################################################
################################################################################################################
[grid@testdb01 ~]$ . grid.env
[grid@testdb01 ~]$
[grid@testdb01 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
MOUNTED EXTERN N 512 4096 1048576 1048578 1048463 0 1048463 0 N RECO/
[grid@testdb01 ~]$
--------------------------------------------------------
if executed directly on any one RAC node without unmounting from other node you will face the below error
[grid@testdb01 ~]$ sqlplus / as sysasm
SQL> DROP DISKGROUP RECO INCLUDING CONTENTS;
DROP DISKGROUP RECO INCLUDING CONTENTS
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15073: diskgroup RECO is mounted by another ASM instance
SQL>
to fix it you need to follow the below sequence..........
-------------
[root@testdb02 ~]# su - grid
[grid@testdb02 ~]$ . grid.env
[grid@testdb02 ~]$ sqlplus / as sysasm
SQL> !asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
MOUNTED EXTERN N 512 4096 1048576 1048578 1048463 0 1048463 0 N RECO/
SQL> alter
diskgroup RECO dismount;
Diskgroup altered.
SQL> !asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
[grid@testdb02 ~]$
[grid@testdb01 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
MOUNTED EXTERN N 512 4096 1048576 1048578 1048463 0 1048463 0 N RECO/
[grid@testdb01 ~]$
[root@testdb01 ~]# oracleasm querydisk /dev/sdf2
Device "/dev/sdf2" is marked an ASM disk with the label "RECO01"
[root@testdb01 ~]# oracleasm querydisk /dev/sdf3
Device "/dev/sdf3" is marked an ASM disk with the label "RECO02"
[root@testdb01 ~]#
[grid@testdb01 ~]$ sqlplus / as sysasm
SQL> !asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
MOUNTED EXTERN N 512 4096 1048576 1048578 1048463 0 1048463 0 N RECO/
SQL> DROP DISKGROUP RECO INCLUDING CONTENTS;
Diskgroup dropped.
SQL>
SQL> !asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
SQL>
[root@testdb01 ~]# oracleasm querydisk /dev/sdf3
Device "/dev/sdf3" is marked an ASM disk with the label "RECO02"
[root@testdb01 ~]# oracleasm querydisk /dev/sdf2
Device "/dev/sdf2" is marked an ASM disk with the label "RECO01"
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
RECO02
[root@testdb01 ~]# oracleasm
deletedisk RECO01
Clearing disk header: done
Dropping disk: done
[root@testdb01 ~]# oracleasm
deletedisk RECO02
Clearing disk header: done
Dropping disk: done
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
[root@testdb01 ~]#
Verify the same from node 2 :
[root@testdb02 ~]# oracleasm listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
RECO02
[root@testdb02 ~]# oracleasm
scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Cleaning disk "RECO01"
Cleaning disk "RECO02"
Scanning system for ASM disks...
[root@testdb02 ~]#
################################################################################################################
################################################################################################################
Identify disk partition with asm disk created
[root@testdb02 ~]# blkid | grep asm
/dev/sde1: LABEL="ASMDATAE" TYPE="oracleasm"
[root@testdb01 ~]# lsblk
/dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
├─sdf1 8:81 0 2T 0 part
├─sdf2 8:82 0 50G 0 part
└─sdf3 8:83 0 974G 0 part
[root@testdb01 ~]# oracleasm
querydisk /dev/sdf1
Device "/dev/sdf1" is marked an ASM disk with the label "DATADISK2"
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm
querydisk /dev/sdf2
Device "/dev/sdf2" is not marked as an ASM disk
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm
querydisk /dev/sdf3
Device "/dev/sdf3" is not marked as an ASM disk
[root@testdb01 ~]#
[root@testdb01 ~]# fdisk
/dev/sdf
WARNING: The size of this disk is 3.3 TB (3298534883328 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): d
Partition number (1-4): 2
Command (m for help): d
Partition number (1-4): 3
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@testdb01 ~]#
------------------------
[root@testdb01 ~]# partx
-a /dev/sdf
BLKPG: Device or resource busy
error adding partition 1
[root@testdb01 ~]#
[root@testdb01 ~]# lsblk
/dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
├─sdf1 8:81 0 2T 0 part
├─sdf2 8:82 0 50G 0 part
└─sdf3 8:83 0 974G 0 part
[root@testdb01 ~]#
[root@testdb02 ~]# lsblk
/dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
├─sdf1 8:81 0 2T 0 part
├─sdf2 8:82 0 50G 0 part
└─sdf3 8:83 0 974G 0 part
[root@testdb02 ~]#
if partprobe/partx does not remove sdf2,sdf3 then hard reboot server
after reboot of both RAC nodes
[root@testdb01 ~]# lsblk
/dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
└─sdf1 8:81 0 2T 0 part
[root@testdb01 ~]#
Verify the same from node 2 :
[root@testdb02 ~]# lsblk
/dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
└─sdf1 8:81 0 2T 0 part
[root@testdb02 ~]#
################################################################################################################
################################################################################################################
################################################################################################################
Create new partition sdf2 :
################################################################################################################
[root@testdb01 ~]# lsblk
/dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
└─sdf1 8:81 0 2T 0 part
[root@testdb01 ~]#
[root@testdb01 ~]# fdisk
/dev/sdf
WARNING: The size of this disk is 3.3 TB (3298534883328 bytes).
DOS partition table format can not be used on drives for volumes
larger than (2199023255040 bytes) for 512-byte sectors. Use parted(1) and GUID
partition table format (GPT).
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p
Disk /dev/sdf: 3298.5 GB, 3298534883328 bytes
255 heads, 63 sectors/track, 401024 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6c754109
Device Boot Start End Blocks Id System
/dev/sdf1 1 267349 2147480811 83 Linux
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (267350-401024, default 267350):
Using default value 267350
Last cylinder, +cylinders or +size{K,M,G} (267350-401024, default 401024): +50G
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 3
First cylinder (273878-401024, default 273878):
Using default value 273878
Last cylinder, +cylinders or +size{K,M,G} (273878-401024, default 401024):
Using default value 401024
Command (m for help): p
Disk /dev/sdf: 3298.5 GB, 3298534883328 bytes
255 heads, 63 sectors/track, 401024 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6c754109
Device Boot Start End Blocks Id System
/dev/sdf1 1 267349 2147480811 83 Linux
/dev/sdf2 267350 273877 52436160 83 Linux
/dev/sdf3 6528 133675 1021308277+ 83 Linux
Partition table entries are not in disk order
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@testdb01 ~]#
[root@testdb01 ~]# partx
-a /dev/sdf
[root@testdb01 ~]# partprobe /dev/sdf
[root@testdb01 ~]# reboot
[root@testdb01 ~]# lsblk
-a /dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
├─sdf1 8:81 0 2T 0 part
├─sdf2 8:82 0 50G 0 part
└─sdf3 8:83 0 974G 0 part
[root@testdb01 ~]#
Verify the same from node 2 :
[root@testdb02 ~]# partx
-a /dev/sdf
[root@testdb02 ~]# partprobe /dev/sdf
[root@testdb02 ~]# reboot
[root@testdb02 ~]# lsblk
-a /dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
├─sdf1 8:81 0 2T 0 part
├─sdf2 8:82 0 50G 0 part
└─sdf3 8:83 0 974G 0 part
[root@testdb02 ~]#
################################################################################################################
################################################################################################################
Create new oracle asm disks on node1:
################################################################################################################
[root@testdb01 ~]# lsblk
-a /dev/sdf
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdf 8:80 0 3T 0 disk
├─sdf1 8:81 0 2T 0 part
├─sdf2 8:82 0 50G 0 part
└─sdf3 8:83 0 974G 0 part
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm querydisk /dev/sdf2
Device "/dev/sdf2" is not marked as an ASM disk
[root@testdb01 ~]# oracleasm querydisk /dev/sdf3
Device "/dev/sdf3" is not marked as an ASM disk
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm
createdisk RECO01 /dev/sdf2
Writing disk header: done
Instantiating disk: done
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm
listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
[root@testdb01 ~]#
Identify disk partition with asm disk created
[root@testdb02 ~]# blkid | grep asm
/dev/sdf2: LABEL="RECO01" TYPE="oracleasm"
Verify the same from node 2 :
[root@testdb02 ~]# oracleasm listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
[root@testdb02 ~]# oracleasm
scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "RECO01"
[root@testdb02 ~]#
[root@testdb02 ~]#
[root@testdb02 ~]# oracleasm listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
[root@testdb02 ~]#
################################################################################################################
Now create asm disk group named RECO from ASMCA
enable GUI by login direct with grid user in mobaterm (X11-forwarding)
[grid@testdb01 ~]$ .
grid.env
[grid@testdb01 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
[grid@testdb01 ~]$
xeyes, xclock, oclock, xcalc, xgc, xedit, xlogo, xman
[grid@testdb01 ~]$ asmca
[grid@testdb01 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
MOUNTED EXTERN N 512 4096 1048576 51207 51111 0 51111 0 N RECO/
[grid@testdb01 ~]$
Verify the same from node 2 :
[grid@testdb02 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
MOUNTED EXTERN N 512 4096 1048576 51207 51111 0 51111 0 N RECO/
[grid@testdb02 ~]$
SQL> Query to Verify ASM Disks and Disk Groups and Disks Space:
set linesize 200;
SELECT
SUBSTR(dg.name,1,16) AS diskgroup, SUBSTR(d.name,1,16) AS asmdisk,dg.TYPE,
dg.STATE,d.mount_status,
d.state,d.TOTAL_MB AS per_disk,dg.TOTAL_MB, SUBSTR(d.failgroup,1,16) AS
failgroup
FROM
V$ASM_DISKGROUP dg, V$ASM_DISK d WHERE dg.group_number = d.group_number;
################################################################################################################
################################################################################################################
Adding Disk to RECO disk Group:
################################################################################################################
[root@testdb01 ~]# oracleasm
querydisk /dev/sdf3
Device "/dev/sdf3" is not marked as an ASM disk
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm
createdisk RECO02 /dev/sdf3
Writing disk header: done
Instantiating disk: done
[root@testdb01 ~]#
[root@testdb01 ~]# oracleasm
listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
RECO02
[root@testdb01 ~]#
Verify the same from node 2 :
[root@testdb02 ~]# oracleasm
listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
[root@testdb02 ~]#
[root@testdb02 ~]#
[root@testdb02 ~]# oracleasm
scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
Instantiating disk "RECO02"
[root@testdb02 ~]#
[root@testdb02 ~]# oracleasm
listdisks
DATADISK1
DATADISK2
DATADISK3
OCRDISK1
RECO01
RECO02
[root@testdb02 ~]#
[root@testdb02 ~]# su - grid
[grid@testdb02 ~]$ . grid.env
[grid@testdb02 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 3422189 2497779 0 2497779 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 30725 26113 0 26113 0 Y OCR/
MOUNTED EXTERN N 512 4096 1048576 1048578 1048463 0 1048463 0 N RECO/
[grid@testdb02 ~]$
ASMCA disk add error
The size of the disks selected is not the same as to allow for an equal number of 1MB AU size blocks
below is the current size of disk all disk under DATA is 307199 and new disk provided by OS admin size is 307196 which was giving error while adding
Sol:
--verify the current disks size in ASM
set linesize 200;
select dg.name group_name,
dg.type,
dg.compatibility,
d.name disk_name,
d.total_mb
from v$asm_diskgroup dg, v$asm_disk d
where dg.group_number=d.group_number
order by d.disk_number;
-- reduce current disk size to as per next attaching disk value i.e (from 307199m to 307196m)
-- wait for rebalancing it takes some time to update disk (approx. 1hr not sure)
alter diskgroup data resize all size 307196m;
Thanks for Reading
Regards,
Mohammed Areefuddin.
Suggested Topics :
Linux | DATABASE | RMAN | RAC | EBS |
R1229 M7 Clone | ||||
RAC DataGuard | Pluggable DB Clone | |||
appsutil for DB | ||||
JDK JRE upgrade | ||||
Add EBS Node | ||||
No comments:
Post a Comment