0% found this document useful (0 votes)
108 views

###### Creating Luns Attaching Luns Partition Luns (Fdisk) Naming Partitions # (Using Oracleasm or Udev Rules)

The document discusses how to configure and use Automatic Storage Management (ASM) on Oracle databases. It describes partitioning disks, creating diskgroups in ASM, and installing the Oracle database software to use the ASM diskgroups for storage. The key steps are partitioning disks, creating ASM diskgroups that can be expanded dynamically, and installing the database on top of the ASM diskgroups for automatic storage management.

Uploaded by

Sundar Raavi
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
108 views

###### Creating Luns Attaching Luns Partition Luns (Fdisk) Naming Partitions # (Using Oracleasm or Udev Rules)

The document discusses how to configure and use Automatic Storage Management (ASM) on Oracle databases. It describes partitioning disks, creating diskgroups in ASM, and installing the Oracle database software to use the ASM diskgroups for storage. The key steps are partitioning disks, creating ASM diskgroups that can be expanded dynamically, and installing the database on top of the ASM diskgroups for automatic storage management.

Uploaded by

Sundar Raavi
Copyright
© © All Rights Reserved
Available Formats
Download as RTF, PDF, TXT or read online on Scribd
You are on page 1/ 10

ASM # from 10g

Automatic Storage Management #

lets say you have server #


and you created database #
when you start loading data into the database #
it is going to take size of the server #

when we migrate database to another server


clients have to wait for database # ( here we have down time )

#
Luns are attached to the server #
( Luns are from storage servers NAS Or SAN storage )

ASM s/w
Have capability of bringing
these disks together
and create disk group
#####

Create Diskgroup #
on a diskgroup we can install database #
WHEN diskgroup space is exhausted, we can add new disk to the diskgroup #
thats how we can increase size of the diskgroup #

objective of ASM #
creating diskgroup #
and installing database on diskgroup
if the space on diskgroup is filled, we will add additional space to diskgroup. without affecting
database #

######
* creating luns
* attaching luns
* partition luns ( fdisk )
* naming partitions # ( using oracleasm or udev rules )

* install asm s/w


* create diskgroups

luns are mounted in /dev/


ls -ltr sd*

using fdisk we will partition the luns #


[root@dg4 dev]# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x56551cf9.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): m


Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help):


Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-261, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-261, default 261): 261

Command (m for help): p

Disk /dev/sdb: 2147 MB, 2147483648 bytes


255 heads, 63 sectors/track, 261 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: 0x56551cf9

Device Boot Start End Blocks Id System


/dev/sdb1 1 261 2096451 83 Linux

Command (m for help): p

Disk /dev/sdb: 2147 MB, 2147483648 bytes


255 heads, 63 sectors/track, 261 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: 0x56551cf9

Device Boot Start End Blocks Id System


/dev/sdb1 1 261 2096451 83 Linux

Command (m for help): w


The partition table has been altered!

Calling ioctl() to re-read partition table.


Syncing disks.

#####
partitions completed ####

https://oracle-base.com/articles/linux/udev-scsi-rules-configuration-in-oracle-linux

[root@dg4 dev]# /sbin/scsi_id -g -u -d /dev/sdb


1ATA_VBOX_HARDDISK_VBab5df4a2-c26790c7
[root@dg4 dev]#
vi /etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL=="sdb1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",

RESULT=="1ATA_VBOX_HARDDISK_VBab5df4a2-c26790c7", NAME="asm-disk1", OWNER="oracle", GROUP="dba",

MODE="0660"

KERNEL=="sdc1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",

RESULT=="1ATA_VBOX_HARDDISK_VBa2c05f48-0e15c938", NAME="asm-disk2”, OWNER="oracle", GROUP="dba",

MODE="0660"
KERNEL=="sdd1", BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",

RESULT=="1ATA_VBOX_HARDDISK_VB62866895-f95e8e0b", NAME="asm-disk3”, OWNER="oracle", GROUP="dba",

MODE="0660"

KERNEL=="sdd2”, BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",

RESULT=="1ATA_VBOX_HARDDISK_VB62866895-f95e8e0b", NAME="asm-disk4”, OWNER="oracle", GROUP="dba",

MODE="0660"

KERNEL=="sdd3”, BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",

RESULT=="1ATA_VBOX_HARDDISK_VB62866895-f95e8e0b", NAME="asm-disk5”, OWNER="oracle", GROUP="dba",

MODE="0660"

KERNEL=="sdd4”, BUS=="scsi", PROGRAM=="/sbin/scsi_id -g -u -d /dev/$parent",

RESULT=="1ATA_VBOX_HARDDISK_VB62866895-f95e8e0b", NAME="asm-disk6”, OWNER="oracle", GROUP="dba",

MODE="0660"

/sbin/partprobe /dev/sdb1
/sbin/partprobe /dev/sdc1
/sbin/partprobe /dev/sdd1
/sbin/partprobe /dev/sdd2
/sbin/partprobe /dev/sdd3
/sbin/partprobe /dev/sdd4

load udev rules #


# udevadm control --reload-rules

started udev rules #


# /sbin/start_udev

when ever you start udev rules on servers


rules defined in Udev are applied to the partitions
#####

[root@dg4 dev]# ls -ltr asm*


brw-rw----. 1 oracle dba 8, 33 Jan 20 16:20 asm-disk2
brw-rw----. 1 oracle dba 8, 17 Jan 20 16:20 asm-disk1
brw-rw----. 1 oracle dba 8, 49 Jan 20 16:20 asm-disk3
brw-rw----. 1 oracle dba 8, 50 Jan 20 16:20 asm-disk4
brw-rw----. 1 oracle dba 8, 51 Jan 20 16:20 asm-disk5
brw-rw----. 1 oracle dba 8, 52 Jan 20 16:20 asm-disk6

#####
create directories and make sure oracle User have permissions on it

mkdir -p /u01/app/oracle/product/12.1.0.2/grid_home

grid_home # place where asm s/w is installed is called grid_home

Installation #

root@dg4 ~]# /u01/app/oracle/product/12.1.0.2/grid_home/root.sh


Performing root user operation.

The following environment variables are set as:


ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/12.1.0.2/grid_home

Enter the full pathname of the local bin directory: [/usr/local/bin]:


The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]:

Entries will be added to the /etc/oratab file as needed by


Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Using configuration parameter file:
/u01/app/oracle/product/12.1.0.2/grid_home/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'oinstall'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node dg4 successfully pinned.
2017/01/21 11:23:26 CLSRSC-330: Adding Clusterware entries to file 'oracle-
ohasd.conf'
dg4 2017/01/21 11:23:43
/u01/app/oracle/product/12.1.0.2/grid_home/cdata/dg4/backup_20170121_112343.
olr 0
CRS-2791: Starting shutdown of Oracle High Availability Services-managed
resources on 'dg4'
CRS-2673: Attempting to stop 'ora.evmd' on 'dg4'
CRS-2677: Stop of 'ora.evmd' on 'dg4' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on
'dg4' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
2017/01/21 11:24:50 CLSRSC-327: Successfully configured Oracle Restart for
a standalone server

##############

Asm s/w will maintain parameter file in grid_home/dbs location #


what is the content of ASM pfile ?
[oracle@dg4 dbs]$ ls -ltr
total 4
-rw-r--r--. 1 oracle oinstall 2992 Feb 3 2012 init.ora
lrwxrwxrwx. 1 oracle oinstall 41 Jan 21 11:29 init+ASM.ora ->
/u01/app/oracle/admin/+ASM/pfile/init.ora

[oracle@dg4 dbs]$ cd /u01/app/oracle/admin/+ASM/pfile/


[oracle@dg4 pfile]$ ls -ltr
total 4
-rw-r-----. 1 oracle oinstall 622 Jan 21 11:29 init.ora
[oracle@dg4 pfile]$
[oracle@dg4 pfile]$ cat init.ora
###########################################
# Copyright (c) 1991, 2013 by Oracle Corporation
###########################################
###########################################
asm_diskstring='/dev/asm*'
asm_power_limit=1
###########################################
# Pools
###########################################
large_pool_size=12M
###########################################
# Security and Auditing
###########################################
remote_login_passwordfile=EXCLUSIVE
processes=300

By default # ASM instance follow, AMM #


====== ==== === == = = ========= ====

[oracle@dg4 pfile]$ ps -ef | grep pmon


oracle 22944 1 0 11:30 ? 00:00:00 asm_pmon_+ASM
oracle 23338 22672 0 11:32 pts/0 00:00:00 grep pmon

[oracle@dg4 pfile]$ . oraenv


ORACLE_SID = [delta] ? +ASM
The Oracle base remains unchanged with value /u01/app/oracle
[oracle@dg4 pfile]$ sqlplus / as sysasm
SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 21 11:33:32 2017
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Automatic Storage Management option
SQL>
SQL> select INSTANCE_NAME,VERSION, STATUS from v$instance;

INSTANCE_NAME VERSION STATUS


---------------- ----------------- ------------
+ASM 12.1.0.2.0 STARTED

===== ===== ============== ========== =========


view used in ASM #

SQL> select name from v$fixed_table where name like '%ASM%';

Important views #

v$asm_diskgroup;
v$asm_disk;
v$asm_operation;
v$asm_client;
GV$ASM_DISK_IOSTAT
V$ASM_VOLUME
V$ASM_ACFSVOLUMES

#####

we are going to create diskgroups using disks #


in 2 ways #
1) sysasm ( command line using sqlplus )
2) asmca ( graphical utility )

Manage the asm diskgroups using command line utility #


exists in $GRID_HOME/bin/
asmcmd >

#######

How do ASM ADMIN will create diskgroups #

Header status #
MEMBER # disk is the part of the diskgroup
FORMER # once part of the diskgroup
PROVISIONED | CANDIDATE # BRAND NEW # NOT ASSIGNED TO ANY
DISKGROUP #

FROM VIEW V$ASM_DISK;


SQL> select HEADER_STATUS,PATH from v$asm_disk;

ASM have capability of making a copy of the database inside the diskgroup #
in order to make copy of database ASM will use 3 redundancy levels
ORACLE SERVER PROCESS INTERACTS WITH ASMB process to complete
User request #
ASM will evenly distribute the data among the disks inside the diskgroup #
( RBAL rebalancing process )

1) External ( Minimum number of disks required for External redundancy is 1 )


oracle will perform stripping inside the diskgroup #

2) Normal ( Minimum number of disks required for configuring Normal


Redundancy is 2 )
ASM is going to stripe the data in one diskgroup and mirror the data in another
disk inside the diskgroup #
stripping is followed by mirroring #
ASM will internally RAID 10 ( Stripping is followed by mirroring )
asm will perform block recovery from mirrored copy during maintenance hours #

sql> alter diskgroup <diskgroup name> check;


sql> alter diskgroup <diskgroup name> repair;
Note # make sure you run above commands in off hours #

How rebalancing is happened?


when you add a new disk to the diskgroup
RBAL # has to evenly distribute data across disks inside diskgroup
ARBx # actual rebalancing process # actual rebalancing process will move the data
in the form extents
from existing disks to newly added disks to the diskgroup #
Number of actual rebalancing process depend up on asm_power_limit value #

asm_power_limit value can be altered from 0 to 1024 # depends on asm_diskgroup


compatibility
dg compatibility < 11.2.0.2 ( it can be altered 0 - 11 )
where 0 disables rebalancing process and 11 is the max

dg compatibility > = 11.2.0.2 ( It can be altered 0 - 1024 )

3) High redundancy # disk required is 3


it follow parity # RAID 5
### ### ##### #### ### ##

###
operations as SYSASM
asmcmd >

ASM internals #

https://www.youtube.com/watch?v=lMMLBYsLvrc
http://oracledbabhuvan.blogspot.com/2012/01/difference-between-candidate.html
http://www.oracle.com/technetwork/articles/database/asm-odb12c-enhancements-
2206102.html
http://allthingsoracle.com/12c-database-backups-using-acfs-snapshots/

You might also like