add asm disk when difference in mpath

Select dg.group_number, dg.name, dg.type Redundancy, dk.OS_MB, dk.name Disk_Name
From v$asm_diskgroup dg, v$asm_disk dk
Where dg.group_number=dk.group_number and dg.name='DBDATA' order by dk.name ;

oracleasm querydisk -d ASMDISK01

set pages 50000 lines 120
col path for a30
select disk_number,
mount_status,
header_status,
mode_status,
state,path
from v$asm_disk ;

set pages 50000 lines 120
select path,redundancy,total_mb,free_mb,failgroup
from v$asm_disk
where mount_status='CACHED' and header_status='MEMBER' and
mode_status='ONLINE' and state='NORMAL'
order by path;

-- Check ASM diskgroup built on raw devices
set pages 50000 lines 120
col path for a15
select a.path,b.NAME from v$asm_disk a, v$asm_diskgroup b
where a.GROUP_NUMBER=b.GROUP_NUMBER and
a.path like '%raw%' ;

check how the different disks of the diskgroups are utilized
select
        instname,
        dbname,
        group_number,
        failgroup,
        disk_number,
        reads,
        writes
from v$asm_disk_iostat
order by 1,2,3,4,5,6
/

/etc/init.d/oracleasm createdisk DBDATA63 /dev/mapper/mpath85p1

/etc/init.d/oracleasm scandisks

/etc/init.d/oracleasm listdisks


alter diskgroup DBDATA add disk 'ORCL:DBDATA72';


Disk Group Information

set pages 40000 lines 120
col NAME for a15
select GROUP_NUMBER DG#, name, ALLOCATION_UNIT_SIZE AU_SZ, STATE,
TYPE, TOTAL_MB, FREE_MB, OFFLINE_DISKS from v$asm_diskgroup;
DG# NAME  AU_SZ   STATE    TYPE   TOTAL_MB FREE_MB OFFLINE_DISKS
--- ----- ------- -------- ------ ------   ------- -------------
 1  DATA2 4194304 MOUNTED  NORMAL 40952    4168    0
 2  DATA  1048576 MOUNTED  NORMAL 30717    25667   0
ASM Disk Information

set pages 40000 lines 120
col PATH for a30
select DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,
PATH FROM V$ASM_DISK;

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE    PATH
----------- ------- ------------ ------- -------- -------------
0           CLOSED  MEMBER       ONLINE  NORMAL   ORCL:DISK001A
3           CLOSED  MEMBER       ONLINE  NORMAL   ORCL:DISK003B
1           CACHED  MEMBER       ONLINE  NORMAL   ORCL:DISK001B
2           CACHED  MEMBER       ONLINE  NORMAL   ORCL:DISK002A
3           CACHED  MEMBER       ONLINE  NORMAL   ORCL:DISK002B
Combined ASM Disk and ASM Diskgroup information

The following query combines ASM disk and diskgroup information. You can edit this query to suit your needs easily. If you use ASM files instead of disks you have to use v$asm_file instead of v$asm_disk. If you use ASM files you have to add v$asm_file to the query.

col PATH for a15
col DG_NAME for a15
col DG_STATE for a10
col FAILGROUP for a10

select dg.name dg_name, dg.state dg_state, dg.type, d.disk_number dsk_no,
d.path, d.mount_status, d.FAILGROUP, d.state
from v$asm_diskgroup dg, v$asm_disk d
where dg.group_number=d.group_number
order by dg_name, dsk_no;
DG_NAME  DG_STATE TYPE   DSK_NO PATH          MOUNT_S FAILGROUP  STATE
-------- -------- ------ ------ ------------- ------- ---------- --------
DATA     MOUNTED  NORMAL 1      ORCL:DISK001B CACHED  DISK001B   NORMAL
DATA     MOUNTED  NORMAL 2      ORCL:DISK002A CACHED  DISK002A   NORMAL
DATA     MOUNTED  NORMAL 3      ORCL:DISK002B CACHED  DISK002B   NORMAL
DATA2    MOUNTED  NORMAL 1      ORCL:DISK003A CACHED  DISK003A   NORMAL
DATA2    MOUNTED  NORMAL 2      ORCL:DISK003B CACHED  DISK003B   NORMAL

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

when there is differnce is mpath like below :-

node 1 :-

 brw-rw---- 1 root disk 253, 183 Apr 12 20:27 mpath85
0 brw-rw---- 1 root disk 253, 184 Apr 12 20:31 mpath86
0 brw-rw---- 1 root disk 253, 185 Apr 12 20:32 mpath87
0 brw-rw---- 1 root disk 253, 186 Apr 12 20:32 mpath88
0 brw-rw---- 1 root disk 253, 187 Apr 12 20:32 mpath89
0 brw-rw---- 1 root disk 253, 188 Apr 12 20:34 mpath85p1
0 brw-rw---- 1 root disk 253, 189 Apr 12 20:34 mpath86p1
0 brw-rw---- 1 root disk 253, 190 Apr 12 20:35 mpath87p1
0 brw-rw---- 1 root disk 253, 191 Apr 12 20:35 mpath88p1
0 brw-rw---- 1 root disk 253, 192 Apr 12 20:35 mpath89p1


node 2 :-

0 brw-rw---- 1 root disk 253, 185 Apr 12 18:04 mpath86
0 brw-rw---- 1 root disk 253, 186 Apr 12 18:04 mpath87
0 brw-rw---- 1 root disk 253, 187 Apr 12 18:04 mpath88
0 brw-rw---- 1 root disk 253, 188 Apr 12 18:04 mpath89
0 brw-rw---- 1 root disk 253, 189 Apr 12 18:04 mpath90
0 brw-rw---- 1 root disk 253, 190 Apr 12 20:36 mpath86p1
0 brw-rw---- 1 root disk 253, 191 Apr 12 20:37 mpath87p1
0 brw-rw---- 1 root disk 253, 192 Apr 12 20:37 mpath88p1
0 brw-rw---- 1 root disk 253, 193 Apr 12 20:37 mpath89p1
0 brw-rw---- 1 root disk 253, 194 Apr 12 20:37 mpath90p1

then please follow below :-

Node 1 :-

[root@node1 mapper]# oracleasm createdisk DBDATA63 /dev/mapper/mpath85p1
Writing disk header: done
Instantiating disk: done
[root@node1 mapper]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@node1 mapper]#


Node 2:-

[root@node2 mapper]# oracleasm scandisks -v /dev/mapper/mpath86p1
Reloading disk partitions: done
Cleaning any stale ASM disks...
Validating disk "CRS01"
( outout truncate )
Scanning system for ASM disks...
Disk "DBDATA63" does not exist or is not instantiated
Instantiating disk "DBDATA63"
[root@node2 mapper]# oracleasm listdisks
CRS01
( outout truncate )
DBDATA63

[root@node2 mapper]# oracleasm listdisks|grep DBDATA63
DBDATA63

Now Proceed to above dash(++++++++++++++++++++++) line . 

Comments

Popular posts from this blog

Installing DBMS_JAVA package in Oracle and calling UTL_DBWS web services through Oracle database

stick the job to the specific instance in Oracle RAC

Starting background process GTX4 and GLOBAL_TXN_PROCESSES