DBA Hub

📋Steps in this guide1/6

How to create asm disk using asm filter driver(AFD) - DBACLASS DBACLASS

If you are working on RHEL, then to use the disk in ASM diskgroup, the disks need to be labeled with ASM. Earlier oracleasm utility was used for this purpose. But oracle developed its own ASM filter driver(AFD), which can be used for this . SEE ALSO : Oracleasm utility in oracle 1. First check […]

oracle clusteringintermediate
by OracleDba
11 views
1

1. First check afd is enabled or not?

Code/Command (click line numbers to comment):

1
2
3
4
5
6
[root]# export ORACLE_HOME=/u01/app/19.0.0/grid
[root]# export ORACLE_BASE=/u01/app/grid
[root]# export PATH=$ORACLE_HOME/bin:$PATH
[root]#<span style="color: #993300;"><strong> asmcmd</strong></span>
ASMCMD><span style="color: #993300;"><strong> afd_state</strong></span>
ASMCMD-9526: The AFD state is 'LOADED' and filtering is 'ENABLED' on host 'ECAEEDBTL0123'
2

2. Find list of existing asm labeled disks:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
[root]# <span style="color: #993300;"><strong>/u01/app/19.0.0/grid/bin/asmcmd afd_lslbl</strong></span>
--------------------------------------------------------------------------------
Label                     Duplicate  Path
================================================================================
DATA1                                 /dev/sde
FRA1                                  /dev/sdf
GIMR1                                 /dev/sdg
GIMR2                                 /dev/sdh
OCR_VOTING1                           /dev/sdi
OCR_VOTING2                           /dev/sdj
OCR_VOTING3                           /dev/sdk
3

3. List down the raw disks you need to label with asm:

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/dev/sds
/dev/sdr 


[rootdev]# <span style="color: #993300;"><strong> lsblk -f</strong></span>
NAME          FSTYPE      LABEL       UUID                                   MOUNTPOINT
.
.
sde           oracleasm   DATA1
sdf           oracleasm   FRA1
sdg           oracleasm   GIMR1
sdh           oracleasm   GIMR2
sdi           oracleasm   OCR_VOTING1
sdj           oracleasm   OCR_VOTING2
sdk           oracleasm   OCR_VOTING3
sdr
sds
4

4. Label the raw disks:

Note – in case of multi-node RAC, you need to label this disk only on one node. run the same afd_lsdsk command on other rac nodes also. In case you are unable to see the disks, then run below command.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[root]# <span style="color: #993300;"><strong>/u01/app/19.0.0/grid/bin/asmcmd afd_label REDO1 /dev/sdr</strong></span>
[root]# <span style="color: #993300;"><strong>/u01/app/19.0.0/grid/bin/asmcmd afd_label REDO2 /dev/sds</strong></span>

[root]# <span style="color: #993300;"><strong> /u01/app/19.0.0/grid/bin/asmcmd afd_lslbl</strong></span>
--------------------------------------------------------------------------------
Label                     Duplicate  Path
================================================================================
DATA1                                 /dev/sde
FRA1                                  /dev/sdf
GIMR1                                 /dev/sdg
GIMR2                                 /dev/sdh
OCR_VOTING1                           /dev/sdi
OCR_VOTING2                           /dev/sdj
OCR_VOTING3                           /dev/sdk
REDO1                                 /dev/sdr
REDO2                                 /dev/sds


[root]# <span style="color: #993300;"><strong>/u01/app/19.0.0/grid/bin/asmcmd afd_lsdsk</strong></span>
--------------------------------------------------------------------------------
Label                     Filtering   Path
================================================================================
DATA1                       ENABLED   /dev/sde
FRA1                        ENABLED   /dev/sdf
GIMR1                       ENABLED   /dev/sdg
GIMR2                       ENABLED   /dev/sdh
OCR_VOTING1                 ENABLED   /dev/sdi
OCR_VOTING2                 ENABLED   /dev/sdj
OCR_VOTING3                 ENABLED   /dev/sdk
REDO1                       ENABLED   /dev/sds
REDO2                       ENABLED   /dev/sdr

/u01/app/19.0.0/grid/bin/asmcmd <span style="color: #993300;">afd_scan
</span>
5

5. Now you can create asm diskgroup using this disks:

Code/Command (click line numbers to comment):

1
2
3
SQL> <span style="color: #993300;"><strong>CREATE DISKGROUP REDO1 EXTERNAL REDUNDANCY DISK 'AFD:REDO1', 'AFD:REDO2' attribute 'compatible.asm'='19.0.0.0.0',
'compatible.rdbms'='10.1.0.0.0','compatible.advm'='19.0.0.0.0','au_size'='4M';
</strong></span>
6

How to unlabel a disk:

If you to release a disk, then you can unlabel the disk with below command.

Code/Command (click line numbers to comment):

1
2
[root]# <strong><span style="color: #993300;">/u01/app/19.0.0/grid/bin/asmcmd afd_unlabel REDO1
</span></strong>

Comments (0)

Please to add comments

No comments yet. Be the first to comment!