Nothing Special   »   [go: up one dir, main page]

Best Asm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

ASM HANDS-ON TRAINING

Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
Alejandro Vargas | Principal Support Consultant
Oracle Advanced Customer Services

INDEX

Create The ASM Instance.............................................................................................................................................2


Create the Cluster Synchronization Services Daemon.................................................................................................2
Configure and Start a Listener......................................................................................................................................3
Sizing the ASM Shared Pool.........................................................................................................................................4
Setup a minimal ASM Pfile............................................................................................................................................4
Disk Discovery ..............................................................................................................................................................6
Discovering Raw Devices..............................................................................................................................................6
Discovering Block Devices............................................................................................................................................7
Discovering ASMLib Devices........................................................................................................................................8
Creating Disk Groups Using Loop Devices...................................................................................................................9
KFED...........................................................................................................................................................................10
Build the Kfed Utility....................................................................................................................................................10
Kfed Help.....................................................................................................................................................................11
Check Disk Headers Using Kfed ................................................................................................................................12
Creating Normal Redundancy Disk Groups Using Block Devices..............................................................................17
Comparing External And Normal Redundancy Disk Using Kfed ...............................................................................18
Using File System Based Files As ASM Disks...........................................................................................................22
Creating a diskgroup on ASM based on files..............................................................................................................24
Check the diskgroups created on this Lab .................................................................................................................25
Scripts..........................................................................................................................................................................26

1/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
Create The ASM Instance
Create the Cluster Synchronization Services Daemon

On a single instance ASM running ‘localconfig add’ as root configures CSS.


On a RAC environment CSS is one of the Oracle Clusterware processes.

Connect as root and run localconfig add from thr $ORACLE_HOMR/bin directory

[root@asmxpt ~]# cd /u01/app/oracle/10g_db/bin


[root@asmxpt bin]# ./localconfig add
/etc/oracle does not exist. Creating it now.
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
Configuration for local CSS has been initialized

Adding to inittab
/etc/init.d/init.cssd: line 319: /tmp/oratz.7542: No such file or directory
/etc/init.d/init.cssd: line 319: /tmp/oratz.7600: No such file or directory
/etc/init.d/init.cssd: line 319: /tmp/oratz.7644: No such file or directory
Startup will be queued to init within 30 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
CSS is active on these nodes.
asmxpt
CSS is active on all nodes.
Oracle CSS service is installed and running under init(1M)

Check that the CSS process is up

2/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
[root@asmxpt bin]# ps -efa | grep css | grep -v grep
oracle 7695 1 1 06:26 ? 00:00:02 /u01/app/oracle/10g_db/bin/ocssd.bin

Configure and Start a Listener

# listener.ora Network Configuration File: /u01/app/oracle/10g_db/network/admin/


listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER_ASMXPT =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/10g_db)
(PROGRAM = extproc)
)
)

LISTENER_ASMXPT =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = sati))
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)

3/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups

Sizing the ASM Shared Pool

To correctly size the SHARED_POOL_SIZE initialization parameter you need to estimate the size of your database.

To do that aggregate the values from the following queries to obtain the current database storage size that is either
already on ASM or will be stored in ASM.

Next, determine the redundancy type and calculate the SHARED_POOL_SIZE using the aggregated value as input

SELECT SUM(bytes)/(1024*1024*1024)
FROM V$DATAFILE;

SELECT SUM(bytes)/(1024*1024*1024)
FROM V$LOGFILE a, V$LOG b
WHERE a.group#=b.group#;

SELECT SUM(bytes)/(1024*1024*1024)
FROM V$TEMPFILE
WHERE status='ONLINE';

• For disk groups using external redundancy, every 100 GB of space needs 1 MB of extra shared pool plus 2 MB
• For disk groups using normal redundancy, every 50 GB of space needs 1 MB of extra shared pool plus 4 MB
• For disk groups using high redundancy, every 33 GB of space needs 1 MB of extra shared pool plus 6 MB

Setup a minimal ASM Pfile

4/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
The first test will be done using a minimal pfile

*.instance_type='asm'
*.large_pool_size=12582912
*.sga_max_size=120M

Whith this pfile we can start the ASM Instance

export ORACLE_SID=+ASM

[oracle@asmxpt dbs]$ sqlplus / as sysdba


SQL*Plus: Release 10.2.0.4.0 - Production on Tue Feb 3 06:20:29 2009
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
Total System Global Area 125829120 bytes
Fixed Size 1266176 bytes
Variable Size 99397120 bytes
ASM Cache 25165824 bytes
ORA-15110: no diskgroups mounted

SQL> create spfile from pfile;

File created.

SQL> shutdown immediate;


ORA-15100: invalid or missing diskgroup name

5/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
Find the new Spfile

[oracle@asmxpt dbs]$ ls -ltr


total 33324
-rw-r--r-- 1 oracle dba 69 Feb 3 06:20 init+ASM.ora
-rw-rw---- 1 oracle dba 1544 Feb 3 06:20 hc_+ASM.dat
-rw-rw---- 1 oracle dba 24 Feb 3 06:20 lk+ASM
-rw-rw---- 1 oracle dba 1350 Feb 3 06:20 ab_+ASM.dat
-rw-r----- 1 oracle dba 1536 Feb 3 06:31 spfile+ASM.ora

Disk Discovery

On lab2 we defined 4 types of devices, Loop devices binded to files, Block devices, Block devices stamped as ASM disks
with ASMLib and Files on filesystem (not binded to raw devices).

On this part of the lab we will discover these devices from within ASM.

Discovering Raw Devices

Start the ASM instance from the spfile and check the diskstring parameter, set the diskstring to find the rawdevices

SQL> show parameters asm_diskstring

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
asm_diskstring string

alter system set asm_diskstring='/dev/raw/raw*' scope=both ;

6/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups

System altered.

After having set the asm_diskstring parameter we can see the disks matching the pattern /dev/raw/raw*

@chkasmdisk

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE PATH


----------- ------- ------------ ------- -------- ------------------------------
0 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw4
3 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw1
2 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw2
1 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw3

Discovering Block Devices

We also defined block devices like /dev/sdb1, /dev/sdc1 etc. We will add this definition also to the diskstring.
We can see the the devices used to create disks with ASMLib appear as ‘PROVISIONED’

SQL> alter system set asm_diskstring='/dev/raw/raw*','/dev/sd*' scope=both;

System altered.

SQL> @chkasmdisk

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE PATH


----------- ------- ------------ ------- -------- ------------------------------
0 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw4

7/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
1 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw3
2 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw2
3 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw1
4 CLOSED CANDIDATE ONLINE NORMAL /dev/sdi1
5 CLOSED CANDIDATE ONLINE NORMAL /dev/sdh1
12 CLOSED CANDIDATE ONLINE NORMAL /dev/sda
7 CLOSED CANDIDATE ONLINE NORMAL /dev/sdf1
8 CLOSED PROVISIONED ONLINE NORMAL /dev/sde1
9 CLOSED CANDIDATE ONLINE NORMAL /dev/sdg1
10 CLOSED PROVISIONED ONLINE NORMAL /dev/sdc1
11 CLOSED PROVISIONED ONLINE NORMAL /dev/sdb1
6 CLOSED PROVISIONED ONLINE NORMAL /dev/sdd1

13 rows selected.

Discovering ASMLib Devices

We did set on Lab2 devices /dev/sdb1,sdc1,sdd1 and sde1 as ASM disks. The diskstring we are using show them as
“PROVISIONED” block devices.

We will change the diskstring to see them as ASM disks

alter system set asm_diskstring='ORCL:VOL*','/dev/raw/raw*','/dev/sdf1','/dev/sdg1','/dev/


sdh1'
scope =both;

Now when we check the available devices we will be able to see also the ASMLib provisioned disks as such

SQL> @chkasmdisk.sql

8/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE PATH


----------- ------- ------------ ------- -------- ------------------------------
5 CLOSED CANDIDATE ONLINE NORMAL /dev/sdh1
6 CLOSED CANDIDATE ONLINE NORMAL /dev/sdf1
7 CLOSED CANDIDATE ONLINE NORMAL /dev/sdg1
8 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL1
9 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL2
10 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL3
11 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL4
1 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw4
0 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw3
1 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw2
0 CLOSED CANDIDATE ONLINE NORMAL /dev/raw/raw1

11 rows selected.

Creating Disk Groups Using Loop Devices

Disk Groups can be created using DBCA if we do build the ASM instance with it. Otherwise we may use either command
line or Enterprise Manager.

Create 2 disk groups on the loop devices

SQL> create diskgroup DATADG external redundancy disk '/dev/raw/raw1','/dev/raw/raw2';

Diskgroup created.

SQL> create diskgroup ARCHDG external redundancy disk '/dev/raw/raw3','/dev/raw/raw4';

9/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
Diskgroup created.

Check the ASM disks again:

select disk_number,mount_status,header_status,mode_status,state,path
from v$asm_disk order by path ;

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE PATH


----------- ------- ------------ ------- -------- ------------------------------
0 CACHED MEMBER ONLINE NORMAL /dev/raw/raw1
1 CACHED MEMBER ONLINE NORMAL /dev/raw/raw2
0 CACHED MEMBER ONLINE NORMAL /dev/raw/raw3
1 CACHED MEMBER ONLINE NORMAL /dev/raw/raw4
6 CLOSED CANDIDATE ONLINE NORMAL /dev/sdf1
7 CLOSED CANDIDATE ONLINE NORMAL /dev/sdg1
5 CLOSED CANDIDATE ONLINE NORMAL /dev/sdh1
8 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL1
9 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL2
10 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL3
11 CLOSED PROVISIONED ONLINE NORMAL ORCL:VOL4

KFED

Build the Kfed Utility

This procedure can be used from version 10.2

[oracle@asmxpt 10g_db]$ cd $ORACLE_HOME/rdbms/lib/


[oracle@asmxpt lib]$ make -f ins_rdbms.mk ikfed

10/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
Linking KFED utility (kfed)
rm -f /u01/app/oracle/10g_db/rdbms/lib/kfed
gcc -o /u01/app/oracle/10g_db/rdbms/lib/kfed -L/u01/app/oracle/10g_db/rdbms/lib/
-L/u01/app/oracle/10g_db/lib/ -L/u01/app/oracle/10g_db/lib/stubs/ -L/usr/lib -lirc
/u01/app/oracle/10g_db/lib/s0main.o /u01/app/oracle/10g_db/rdbms/lib/sskfeded.o
/u01/app/oracle/10g_db/rdbms/lib/skfedpt.o /u01/app/oracle/10g_db/rdbms/lib/defopt.o
-ldbtools10 -lclntsh `cat /u01/app/oracle/10g_db/lib/ldflags` -lnsslb10 -lncrypt10
-lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/10g_db/lib/ldflags`
-lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10
-lcommon10 -lgeneric10 -lmm -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10
-lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat
/u01/app/oracle/10g_db/lib/ldflags` -lnsslb10 -lncrypt10 -lnsgr10 -lnzjs10 -ln10
-lnnz10 -lnl10 -lnro10 `cat /u01/app/oracle/10g_db/lib/ldflags` -lnsslb10 -lncrypt10
-lnsgr10 -lnzjs10 -ln10 -lnnz10 -lnl10 -lclient10 -lnnetd10 -lvsn10 -lcommon10
-lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10
-lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 -lclient10 -lnnetd10 -lvsn10
-lcommon10 -lgeneric10 -lsnls10 -lnls10 -lcore10 -lsnls10 -lnls10 -lcore10 -lsnls10
-lnls10 -lxml10 -lcore10 -lunls10 -lsnls10 -lnls10 -lcore10 -lnls10 `cat
/u01/app/oracle/10g_db/lib/sysliblist` -Wl,-rpath,/u01/app/oracle/10g_db/lib -lm `cat /
u01/app/oracle/10g_db/lib/sysliblist` -ldl -lm -L/u01/app/oracle/10g_db/lib
mv -f /u01/app/oracle/10g_db/bin/kfed /u01/app/oracle/10g_db/bin/kfedO
mv: cannot stat `/u01/app/oracle/10g_db/bin/kfed': No such file or directory
make: [ikfed] Error 1 (ignored)
mv /u01/app/oracle/10g_db/rdbms/lib/kfed /u01/app/oracle/10g_db/bin/kfed
chmod 751 /u01/app/oracle/10g_db/bin/kfed

Kfed Help

[oracle@asmxpt ~]$ kfed -help


as/mlib ASM Library [asmlib='lib']
aun/um AU number to examine or update [AUNUM=number]

11/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
aus/z Allocation Unit size in bytes [AUSZ=number]
blkn/um Block number to examine or update [BLKNUM=number]
blks/z Metadata block size in bytes [BLKSZ=number]
ch/ksum Update checksum before each write [CHKSUM=YES/NO]
cn/t Count of AUs to process [CNT=number]
d/ev ASM device to examine or update [DEV=string]
o/p KFED operation type [OP=READ/WRITE/MERGE/NEW/FORM/FIND/STRUCT]
p/rovnm Name for provisioning purposes [PROVNM=string]
s/eek AU number to seek to [SEEK=number]
te/xt File name for translated block text [TEXT=string]
ty/pe ASM metadata block type number [TYPE=number]

Check Disk Headers Using Kfed

Kfed run as oracle need to have read permissions on the device, in this example we run kfed against the raw device we
used to bind to the physical device

[oracle@asmxpt ~]$ kfed read /dev/raw/raw1


kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 NUMB=0x0
kfbh.check: 1337005256 ; 0x00c: 0x4fb114c8
kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8

12/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: DATADG_0000 ; 0x028: length=11
kfdhdb.grpname: DATADG ; 0x048: length=6
kfdhdb.fgname: DATADG_0000 ; 0x068: length=11
kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 32917653 ; 0x0a8: HOUR=0x15 DAYS=0x4 MNTH=0x2 YEAR=0x7d9
kfdhdb.crestmp.lo: 1344777216 ; 0x0ac: USEC=0x0 MSEC=0x1eb SECS=0x2 MINS=0x14
kfdhdb.mntstmp.hi: 32917685 ; 0x0b0: HOUR=0x15 DAYS=0x5 MNTH=0x2 YEAR=0x7d9
kfdhdb.mntstmp.lo: 2585133056 ; 0x0b4: USEC=0x0 MSEC=0x180 SECS=0x21 MINS=0x26
kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 500 ; 0x0c4: 0x000001f4
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 0 ; 0x0da: 0x0000
kfdhdb.redomirrors[2]: 0 ; 0x0dc: 0x0000
kfdhdb.redomirrors[3]: 0 ; 0x0de: 0x0000

13/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32917653 ; 0x0e4: HOUR=0x15 DAYS=0x4 MNTH=0x2 YEAR=0x7d9
kfdhdb.grpstmp.lo: 1344524288 ; 0x0e8: USEC=0x0 MSEC=0xf4 SECS=0x2 MINS=0x14
kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000

14/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]: 0 ; 0x1d0: 0x00000000
kfdhdb.acdb.aba.seq: 0 ; 0x1d4: 0x00000000

15/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
kfdhdb.acdb.aba.blk: 0 ; 0x1d8: 0x00000000
kfdhdb.acdb.ents: 0 ; 0x1dc: 0x0000
kfdhdb.acdb.ub2spare: 0 ; 0x1de: 0x0000

Kfed run against empty ASM disks /dev/sdb1 and empty block device /dev/sdf1

Empty ASM Disks Empty Block Devices


[oracle@asmxpt ~]$ kfed read /dev/sdb1 [oracle@asmxpt ~]$ kfed read /dev/sdf1
kfbh.endian: 0 ; 0x000: 0x00 kfbh.endian: 0 ; 0x000: 0x00
kfbh.hard: 0 ; 0x001: 0x00 kfbh.hard: 0 ; 0x001: 0x00
kfbh.type: 0 ; 0x002: kfbh.type: 0 ; 0x002:
KFBTYP_INVALID KFBTYP_INVALID
kfbh.datfmt: 0 ; 0x003: 0x00 kfbh.datfmt: 0 ; 0x003: 0x00
kfbh.block.blk: 0 ; 0x004: T=0 kfbh.block.blk: 0 ; 0x004: T=0
NUMB=0x0 NUMB=0x0
kfbh.block.obj: 0 ; 0x008: kfbh.block.obj: 0 ; 0x008:
TYPE=0x0 NUMB=0x0 TYPE=0x0 NUMB=0x0
kfbh.check: 827084630 ; 0x00c: kfbh.check: 0 ; 0x00c:
0x314c4f56 0x00000000
kfbh.fcn.base: 0 ; 0x010: kfbh.fcn.base: 0 ; 0x010:
0x00000000 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: kfbh.fcn.wrap: 0 ; 0x014:
0x00000000 0x00000000
kfbh.spare1: 0 ; 0x018: kfbh.spare1: 0 ; 0x018:
0x00000000 0x00000000
kfbh.spare2: 0 ; 0x01c: kfbh.spare2: 0 ; 0x01c:
0x00000000 0x00000000

16/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups

Creating Normal Redundancy Disk Groups Using Block Devices

SQL> CREATE DISKGROUP DATADGNR NORMAL REDUNDANCY


FAILGROUP FG1 DISK 'ORCL:VOL1', 'ORCL:VOL2'
FAILGROUP FG2 DISK 'ORCL:VOL3', 'ORCL:VOL4';

Diskgroup created.

Check the disks groups and the disks that are already members of a diskgroup

SQL> select group_number, name, total_mb, free_mb, state, type


from v$asm_diskgroup ;

GROUP_NUMBER NAME TOTAL_MB FREE_MB STATE TYPE


------------ ------------------------------ ---------- ---------- ----------- ------
1 ARCHDG 1000 948 MOUNTED EXTERN
2 DATADGNR 8188 8082 MOUNTED NORMAL
3 DATADG 1000 948 MOUNTED EXTERN

SQL> 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 ;

PATH REDUNDA TOTAL_MB FREE_MB FAILGROUP


--------------- ------- ---------- ---------- ------------------------------
/dev/raw/raw1 UNKNOWN 500 473 DATADG_0000
/dev/raw/raw2 UNKNOWN 500 475 DATADG_0001
/dev/raw/raw3 UNKNOWN 500 473 ARCHDG_0000

17/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
/dev/raw/raw4 UNKNOWN 500 475 ARCHDG_0001
ORCL:VOL1 UNKNOWN 2047 2017 FG1
ORCL:VOL2 UNKNOWN 2047 2024 FG1
ORCL:VOL3 UNKNOWN 2047 2019 FG2
ORCL:VOL4 UNKNOWN 2047 2022 FG2

Comparing External And Normal Redundancy Disk Using Kfed

External Normal
[oracle@asmxpt ~]$ kfed read /dev/raw/raw1 [oracle@asmxpt ~]$ kfed read /dev/oracleasm/disks/VOL1
kfbh.endian: 1 ; 0x000: 0x01 kfbh.endian: 1 ; 0x000: 0x01
kfbh.hard: 130 ; 0x001: 0x82 kfbh.hard: 130 ; 0x001: 0x82
kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD kfbh.type: 1 ; 0x002: KFBTYP_DISKHEAD
kfbh.datfmt: 1 ; 0x003: 0x01 kfbh.datfmt: 1 ; 0x003: 0x01
kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0 kfbh.block.blk: 0 ; 0x004: T=0 NUMB=0x0
kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8 kfbh.block.obj: 2147483648 ; 0x008: TYPE=0x8
NUMB=0x0 NUMB=0x0
kfbh.check: 2273664232 ; 0x00c: 0x87855ce8 kfbh.check: 4080112120 ; 0x00c: 0xf33191f8
kfbh.fcn.base: 0 ; 0x010: 0x00000000 kfbh.fcn.base: 0 ; 0x010: 0x00000000
kfbh.fcn.wrap: 0 ; 0x014: 0x00000000 kfbh.fcn.wrap: 0 ; 0x014: 0x00000000
kfbh.spare1: 0 ; 0x018: 0x00000000 kfbh.spare1: 0 ; 0x018: 0x00000000
kfbh.spare2: 0 ; 0x01c: 0x00000000 kfbh.spare2: 0 ; 0x01c: 0x00000000
kfdhdb.driver.provstr: ORCLDISK ; 0x000: length=8 kfdhdb.driver.provstr: ORCLDISKVOL1 ; 0x000: length=12
kfdhdb.driver.reserved[0]: 0 ; 0x008: 0x00000000 kfdhdb.driver.reserved[0]: 827084630 ; 0x008: 0x314c4f56
kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000 kfdhdb.driver.reserved[1]: 0 ; 0x00c: 0x00000000
kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000 kfdhdb.driver.reserved[2]: 0 ; 0x010: 0x00000000
kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000 kfdhdb.driver.reserved[3]: 0 ; 0x014: 0x00000000
kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000 kfdhdb.driver.reserved[4]: 0 ; 0x018: 0x00000000
kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000 kfdhdb.driver.reserved[5]: 0 ; 0x01c: 0x00000000

18/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
kfdhdb.compat: 168820736 ; 0x020: 0x0a100000 kfdhdb.compat: 168820736 ; 0x020: 0x0a100000
kfdhdb.dsknum: 0 ; 0x024: 0x0000 kfdhdb.dsknum: 0 ; 0x024: 0x0000
kfdhdb.grptyp: 1 ; 0x026: KFDGTP_EXTERNAL kfdhdb.grptyp: 2 ; 0x026: KFDGTP_NORMAL
kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER kfdhdb.hdrsts: 3 ; 0x027: KFDHDR_MEMBER
kfdhdb.dskname: DATADG_0000 ; 0x028: length=11 kfdhdb.dskname: VOL1 ; 0x028: length=4
kfdhdb.grpname: DATADG ; 0x048: length=6 kfdhdb.grpname: DATADGNR ; 0x048: length=8
kfdhdb.fgname: DATADG_0000 ; 0x068: length=11 kfdhdb.fgname: FG1 ; 0x068: length=3
kfdhdb.capname: ; 0x088: length=0 kfdhdb.capname: ; 0x088: length=0
kfdhdb.crestmp.hi: 32917653 ; 0x0a8: HOUR=0x15 kfdhdb.crestmp.hi: 32917704 ; 0x0a8: HOUR=0x8
DAYS=0x4 MNTH=0x2 YEAR=0x7d9 DAYS=0x6 MNTH=0x2 YEAR=0x7d9
kfdhdb.crestmp.lo: 1344777216 ; 0x0ac: USEC=0x0 kfdhdb.crestmp.lo: 1951739904 ; 0x0ac: USEC=0x0
MSEC=0x1eb SECS=0x2 MINS=0x14 MSEC=0x14c SECS=0x5 MINS=0x1d
kfdhdb.mntstmp.hi: 32917653 ; 0x0b0: HOUR=0x15 kfdhdb.mntstmp.hi: 32917704 ; 0x0b0: HOUR=0x8
DAYS=0x4 MNTH=0x2 YEAR=0x7d9 DAYS=0x6 MNTH=0x2 YEAR=0x7d9
kfdhdb.mntstmp.lo: 1377978368 ; 0x0b4: USEC=0x0 kfdhdb.mntstmp.lo: 1962266624 ; 0x0b4: USEC=0x0
MSEC=0x92 SECS=0x22 MINS=0x14 MSEC=0x174 SECS=0xf MINS=0x1d
kfdhdb.secsize: 512 ; 0x0b8: 0x0200 kfdhdb.secsize: 512 ; 0x0b8: 0x0200
kfdhdb.blksize: 4096 ; 0x0ba: 0x1000 kfdhdb.blksize: 4096 ; 0x0ba: 0x1000
kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000 kfdhdb.ausize: 1048576 ; 0x0bc: 0x00100000
kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80 kfdhdb.mfact: 113792 ; 0x0c0: 0x0001bc80
kfdhdb.dsksize: 500 ; 0x0c4: 0x000001f4 kfdhdb.dsksize: 2047 ; 0x0c4: 0x000007ff
kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002 kfdhdb.pmcnt: 2 ; 0x0c8: 0x00000002
kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001 kfdhdb.fstlocn: 1 ; 0x0cc: 0x00000001
kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002 kfdhdb.altlocn: 2 ; 0x0d0: 0x00000002
kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002 kfdhdb.f1b1locn: 2 ; 0x0d4: 0x00000002
kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000 kfdhdb.redomirrors[0]: 0 ; 0x0d8: 0x0000
kfdhdb.redomirrors[1]: 0 ; 0x0da: 0x0000 kfdhdb.redomirrors[1]: 0 ; 0x0da: 0x0000
kfdhdb.redomirrors[2]: 0 ; 0x0dc: 0x0000 kfdhdb.redomirrors[2]: 0 ; 0x0dc: 0x0000
kfdhdb.redomirrors[3]: 0 ; 0x0de: 0x0000 kfdhdb.redomirrors[3]: 0 ; 0x0de: 0x0000
kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000 kfdhdb.dbcompat: 168820736 ; 0x0e0: 0x0a100000
kfdhdb.grpstmp.hi: 32917653 ; 0x0e4: HOUR=0x15 kfdhdb.grpstmp.hi: 32917704 ; 0x0e4: HOUR=0x8

19/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
DAYS=0x4 MNTH=0x2 YEAR=0x7d9 DAYS=0x6 MNTH=0x2 YEAR=0x7d9
kfdhdb.grpstmp.lo: 1344524288 ; 0x0e8: USEC=0x0 kfdhdb.grpstmp.lo: 1951291392 ; 0x0e8: USEC=0x0
MSEC=0xf4 SECS=0x2 MINS=0x14 MSEC=0x396 SECS=0x4 MINS=0x1d
kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000 kfdhdb.ub4spare[0]: 0 ; 0x0ec: 0x00000000
kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000 kfdhdb.ub4spare[1]: 0 ; 0x0f0: 0x00000000
kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000 kfdhdb.ub4spare[2]: 0 ; 0x0f4: 0x00000000
kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000 kfdhdb.ub4spare[3]: 0 ; 0x0f8: 0x00000000
kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000 kfdhdb.ub4spare[4]: 0 ; 0x0fc: 0x00000000
kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000 kfdhdb.ub4spare[5]: 0 ; 0x100: 0x00000000
kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000 kfdhdb.ub4spare[6]: 0 ; 0x104: 0x00000000
kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000 kfdhdb.ub4spare[7]: 0 ; 0x108: 0x00000000
kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000 kfdhdb.ub4spare[8]: 0 ; 0x10c: 0x00000000
kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000 kfdhdb.ub4spare[9]: 0 ; 0x110: 0x00000000
kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000 kfdhdb.ub4spare[10]: 0 ; 0x114: 0x00000000
kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000 kfdhdb.ub4spare[11]: 0 ; 0x118: 0x00000000
kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000 kfdhdb.ub4spare[12]: 0 ; 0x11c: 0x00000000
kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000 kfdhdb.ub4spare[13]: 0 ; 0x120: 0x00000000
kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000 kfdhdb.ub4spare[14]: 0 ; 0x124: 0x00000000
kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000 kfdhdb.ub4spare[15]: 0 ; 0x128: 0x00000000
kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000 kfdhdb.ub4spare[16]: 0 ; 0x12c: 0x00000000
kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000 kfdhdb.ub4spare[17]: 0 ; 0x130: 0x00000000
kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000 kfdhdb.ub4spare[18]: 0 ; 0x134: 0x00000000
kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000 kfdhdb.ub4spare[19]: 0 ; 0x138: 0x00000000
kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000 kfdhdb.ub4spare[20]: 0 ; 0x13c: 0x00000000
kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000 kfdhdb.ub4spare[21]: 0 ; 0x140: 0x00000000
kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000 kfdhdb.ub4spare[22]: 0 ; 0x144: 0x00000000
kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000 kfdhdb.ub4spare[23]: 0 ; 0x148: 0x00000000
kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000 kfdhdb.ub4spare[24]: 0 ; 0x14c: 0x00000000
kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000 kfdhdb.ub4spare[25]: 0 ; 0x150: 0x00000000
kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000 kfdhdb.ub4spare[26]: 0 ; 0x154: 0x00000000
kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000 kfdhdb.ub4spare[27]: 0 ; 0x158: 0x00000000

20/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000 kfdhdb.ub4spare[28]: 0 ; 0x15c: 0x00000000
kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000 kfdhdb.ub4spare[29]: 0 ; 0x160: 0x00000000
kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000 kfdhdb.ub4spare[30]: 0 ; 0x164: 0x00000000
kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000 kfdhdb.ub4spare[31]: 0 ; 0x168: 0x00000000
kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000 kfdhdb.ub4spare[32]: 0 ; 0x16c: 0x00000000
kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000 kfdhdb.ub4spare[33]: 0 ; 0x170: 0x00000000
kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000 kfdhdb.ub4spare[34]: 0 ; 0x174: 0x00000000
kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000 kfdhdb.ub4spare[35]: 0 ; 0x178: 0x00000000
kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000 kfdhdb.ub4spare[36]: 0 ; 0x17c: 0x00000000
kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000 kfdhdb.ub4spare[37]: 0 ; 0x180: 0x00000000
kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000 kfdhdb.ub4spare[38]: 0 ; 0x184: 0x00000000
kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000 kfdhdb.ub4spare[39]: 0 ; 0x188: 0x00000000
kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000 kfdhdb.ub4spare[40]: 0 ; 0x18c: 0x00000000
kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000 kfdhdb.ub4spare[41]: 0 ; 0x190: 0x00000000
kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000 kfdhdb.ub4spare[42]: 0 ; 0x194: 0x00000000
kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000 kfdhdb.ub4spare[43]: 0 ; 0x198: 0x00000000
kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000 kfdhdb.ub4spare[44]: 0 ; 0x19c: 0x00000000
kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000 kfdhdb.ub4spare[45]: 0 ; 0x1a0: 0x00000000
kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000 kfdhdb.ub4spare[46]: 0 ; 0x1a4: 0x00000000
kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000 kfdhdb.ub4spare[47]: 0 ; 0x1a8: 0x00000000
kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000 kfdhdb.ub4spare[48]: 0 ; 0x1ac: 0x00000000
kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000 kfdhdb.ub4spare[49]: 0 ; 0x1b0: 0x00000000
kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000 kfdhdb.ub4spare[50]: 0 ; 0x1b4: 0x00000000
kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000 kfdhdb.ub4spare[51]: 0 ; 0x1b8: 0x00000000
kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000 kfdhdb.ub4spare[52]: 0 ; 0x1bc: 0x00000000
kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000 kfdhdb.ub4spare[53]: 0 ; 0x1c0: 0x00000000
kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000 kfdhdb.ub4spare[54]: 0 ; 0x1c4: 0x00000000
kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000 kfdhdb.ub4spare[55]: 0 ; 0x1c8: 0x00000000
kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000 kfdhdb.ub4spare[56]: 0 ; 0x1cc: 0x00000000
kfdhdb.ub4spare[57]: 0 ; 0x1d0: 0x00000000 kfdhdb.ub4spare[57]: 0 ; 0x1d0: 0x00000000
kfdhdb.acdb.aba.seq: 0 ; 0x1d4: 0x00000000 kfdhdb.acdb.aba.seq: 0 ; 0x1d4: 0x00000000

21/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
kfdhdb.acdb.aba.blk: 0 ; 0x1d8: 0x00000000 kfdhdb.acdb.aba.blk: 0 ; 0x1d8: 0x00000000
kfdhdb.acdb.ents: 0 ; 0x1dc: 0x0000 kfdhdb.acdb.ents: 0 ; 0x1dc: 0x0000
kfdhdb.acdb.ub2spare: 0 ; 0x1de: 0x0000 kfdhdb.acdb.ub2spare: 0 ; 0x1de: 0x0000

Using File System Based Files As ASM Disks

The files we created on Lab1 for this test are located on directory /u01/app/asm_filesystem_devices.

[oracle@asmxpt ~]$ cd /u01/app/asm_filesystem_devices


[oracle@asmxpt asm_filesystem_devices]$ ls -l
total 2050016
-rw-rw---- 1 oracle dba 524288000 Jan 31 19:58 asm_filesystem_dsk1
-rw-rw---- 1 oracle dba 524288000 Jan 31 19:58 asm_filesystem_dsk2
-rw-rw---- 1 oracle dba 524288000 Jan 31 19:58 asm_filesystem_dsk3
-rw-rw---- 1 oracle dba 524288000 Jan 31 19:58 asm_filesystem_dsk4

To use these files as ASM disks we need to setups the following parameters :

_asm_allow_only_raw_disks = FALSE

and add to the disktring the files to be used: ’ /u01/app/asm_filesystem_devices/*’

SQL> alter system set "_asm_allow_only_raw_disks"= FALSE scope=spfile;

System altered.

SQL> alter system set asm_diskstring='ORCL:VOL*','/dev/raw/raw*','/dev/sdf1','/dev/


sdg1','/dev/sdh1',
'/u01/app/asm_filesystem_devices/*' scope=both;

22/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
System altered.

SQL> show parameters asm_diskstring

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
asm_diskstring string ORCL:VOL*, /dev/raw/raw*, /dev
/sdf1, /dev/sdg1, /dev/sdh1, /
u01/app/asm_filesystem_devices
/*

To activate the parameter _asm_allow_only_raw_disks we need to reboot the ASM instance

SQL> shutdown
ASM diskgroups dismounted
ASM instance shutdown
SQL> startup
ASM instance started

Total System Global Area 125829120 bytes


Fixed Size 1266176 bytes
Variable Size 99397120 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted

SQL> show parameters _asm_allow_only_raw_disks

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
_asm_allow_only_raw_disks boolean FALSE

23/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups

Start the ASM instance and check the discovery of our devices

SQL> select path from v$asm_disk ;

PATH
---------------------------------------------------
/u01/app/asm_filesystem_devices/asm_filesystem_dsk2
/u01/app/asm_filesystem_devices/asm_filesystem_dsk1
/u01/app/asm_filesystem_devices/asm_filesystem_dsk3
/u01/app/asm_filesystem_devices/asm_filesystem_dsk4

SQL> select disk_number,mount_status,header_status,mode_status,state,path


from v$asm_disk where path like '/u01/%';

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE PATH


----------- ------- ------------ ------- -------- ---------------------------------------------------
4 CLOSED CANDIDATE ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk2
7 CLOSED CANDIDATE ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk1
6 CLOSED CANDIDATE ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk3
5 CLOSED CANDIDATE ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk4

Creating a diskgroup on ASM based on files

SQL> create diskgroup DATAONFS external redundancy disk


'/u01/app/asm_filesystem_devices/asm_filesystem_dsk2',
'/u01/app/asm_filesystem_devices/asm_filesystem_dsk1',
'/u01/app/asm_filesystem_devices/asm_filesystem_dsk3',
'/u01/app/asm_filesystem_devices/asm_filesystem_dsk4' ;

24/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
Diskgroup created.

SQL> select disk_number,mount_status,header_status,mode_status,state,path


from v$asm_disk where path like '/u01/%';
DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE PATH
----------- ------- ------------ ------- -------- ---------------------------------------------------
11 CLOSED MEMBER ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk2
14 CLOSED MEMBER ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk1
13 CLOSED MEMBER ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk3
12 CLOSED MEMBER ONLINE NORMAL /u01/app/asm_filesystem_devices/asm_filesystem_dsk4

Check the diskgroups created on this Lab

[oracle@asmxpt ~]$ asmcmd lsdg


State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N N 512 4096 1048576 1000 947 0 947 0 ARCHDG/
MOUNTED EXTERN N N 512 4096 1048576 1000 948 0 948 0 DATADG/
MOUNTED NORMAL N N 512 4096 1048576 8188 5510 2047 1731 0 DATADGNR/
MOUNTED EXTERN N N 512 4096 1048576 2000 1944 0 1944 0 DATAONFS/

25/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups

Scripts

Check ASM disks

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

-- chkasmdisk2
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;
-- eof chkasmdisk2

Check ASM Disks Mapping

#!/bin/ksh
# chkasmmaping
/etc/init.d/oracleasm querydisk `/etc/init.d/oracleasm listdisks` | cut -f2,10,11 -d" " |
perl -pe 's/"(.*)".*\[(.*), *(.*)\]/$1 $2 $3/g;' | while read v_asmdisk v_minor v_major

26/27
ASM HANDS-ON TRAINING
Lab 3 Creating The ASM Instance And Managing ASM Disk Groups
do
v_device=`ls -la /dev | grep " $v_minor, *$v_major " | awk '{print $10}'`
echo "ASM disk $v_asmdisk based on /dev/$v_device [$v_minor, $v_major]"
done
# eof chkasmmapping

End of Lab3

27/27

You might also like