Professional Documents
Culture Documents
Inderpal S. Johal
Principal Consultant
Agenda
What is ASM
Benefits of ASM
ASM Architecture
ASM Components
DB Instance parameters to support ASM
ASM Instance Monitoring using EM
ASM Views
Migrating from File system to ASM
Miscellaneous Tips
Q&A
Tablespaces Tablespaces
Files
Automatic
File systems Storage Disk Groups
Management
Logical
Volumes
Physical Physical
Volumes Volumes
Data Softech Inc. Oracle 10g ASM 4
Benefits of Automatic Storage Management
Provide efficient management of storage
Provide integrated Cluster File system and Volume
management capabilities
No need for buggy OCFS or expensive 3rd Party CFS
Provide Software Mirroring on top of vendor supplied SAN
[2 or 3 Mirrors]
To reconfigure the CSS daemon to run from the new Oracle home:
# $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME
ASM Disk ASM Disk ASM Disk ASM Disk ASM Disk ASM Disk ASM Disk
SYSDBA SYSOPER
NOTE : If you are using AMM, then ignore the above settings.
Means Disk is of Oracle Object but can only be added to disk group
FOREIGN with FORCE keyword
CANDIDATE Means Disk is available to be added to any disk group
PROVISIONED Same as CANDIDATE except that Disk is configured using ASMLIB
FORMER Means Disk was formerly part of some disk group
MEMBER Means Disk is already part of existing disk group
Access Units
Disk Inputs
Disks
LUNS
Partitions
ASM Disk
ASM provides 2 levels of Striping
COARSE – 1 M, each AU is filled to 1M
FINE – 128K are written to each 1M AU and so each
AU has 8 pieces. Good for Logfiles
Data Softech Inc. Oracle 10g ASM 24
ASM Components – ASM Disks Configuration - Solaris
ASM with UNIX I/O:
Tablespaces are created on raw character devices managed by ASM using standard Linux I/O routines.
# vi /etc/sysconfig/rawdevices
/dev/raw/raw1 /dev/sdd1
/dev/raw/raw2 /dev/sdd2
/dev/raw/raw3 /dev/sdd3
# vi /etc/rc.d/rc.local
chown oracle:dba /dev/raw/raw*
chmod 660 /dev/raw/raw*
Usage: /etc/init.d/oracleasm
{start|stop|restart|enable|disable|configure|createdisk|deletedisk|querydisk|listdisks|scand
isks| status}
# /etc/init.d/oracleasm createdisk VOL1 /dev/sdb2
Marking disk "/dev/sdb2" as an ASM disk: [ OK ]
# ls -lL c0t2d0s4
crw-r----- 1 root sys 32, 20 Feb 24 07:14 c0t2d0s4
This shows that the major and minor device number for this slice is 32,20 respectively.
The 'c' at the beginning shows that this is a character (raw) special file.
# ls -l
crw-r--r-- 1 root other 32, 20 May 7 07:50 disk1
For this to be accessible to the ASM instance, we need to give oracle user permission to this file:
# chown oracle:dba disk1
crw-r--r-- 1 oracle dba 32, 20 May 7 07:50 disk1
asm_diskstring =‘/asmdisk/disk1’
Check all disks in a specific disk group; don't repair them -- even if a problem is found
ALTER DISKGROUP data_dg1 CHECK ALL NOREPAIR;
Check a specific disk in a specific disk group, and repair the disk if needed
ALTER DISKGROUP data_dg1 CHECK DISK dg_5 ;
Manually rebalancing an ASM disk group
ALTER DISKGROUP data_dg1 REBALANCE POWER 10;
Mounting and dismounting ASM disk groups
ALTER DISKGROUP data_dg1 DISMOUNT;
ALTER DISKGROUP data_dg1 MOUNT;
Drop just one disk
ALTER DISKGROUP data_dg1 DROP DISK dg_5 ;
"Undrop" a recently-dropped disk
ALTER DISKGROUP data_dg1 UNDROP DISK dg_5 ;
mkalias lsct
$ export ORACLE_SID=+ASM
$ asmcmd help
rmalias lsdg
pwd
find
ls
V$ASM_DISKGROUP Row for all Disk group discovered by Row for all disk group
V$ASM_DISKGROUP_STAT the ASM instance mounted or dismounted
Using DBMS_FILE_TRANSFER
Using XMLDB
ASM to ASM
COPY_FILE - Read Local File and copy it to new location on local system
GET_FILE - Contact Remote DB to read Remote file and copy it to Local system
PUT_FILE - Read Local File and contact Remote DB to copy it to remote system
Note : This operation can be performed directly without having to convert the datafile
It will only be used for Database files like Datafile, tempfiles,controlfiles etc
SQL> begin
2 DBMS_FILE_TRANSFER.COPY_FILE(
3 source_directory_object => ‘ASM_D' ,
4 source_file_name => 'spfiledevprof.ora' ,
5 destination_directory_object => ‘NonASM' ,
6 destination_file_name => 'spfileDEV.ora');
7 end ;
8 /
Using XMLDB
$ export ORACLE_SID=+ASM
$ asmcmd
ASMCMD> cd DG_DATA
ASMCMD> ls
prof.dmp=>+DG_DATA/DEVPROF/DUMPSET/PROFNETSYS_EX
PORT_TABLE_01_54652_1.1332.59266069