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
What is ASM
ASM stands for Automatic Storage Management It is Oracle Cluster File System and Volume Manager Designed for Oracle Database Related Files Provide Storage management capabilities like striping as well as mirroring
Data files Log files Archived files Control Files DataGuard Change Tracking File
Not Certified for Trace Files ORACLE_HOME Voting Disk OCR Files Alert Log Password File Binary File (BFILE)
ASM
Tables Tablespaces Automatic Storage Management
Disk Groups
Physical Volumes
4
Triple Mirroring
Double Mirroring
No Mirroring
ASM Components
DATABASE
ASM DISK GROUP
TABLESPACE
DATAFILE
ASM FILE
SEGMENT
FILE SYSTEM FILE Or RAW DEVICE
ASM DISK
EXTENT
ALLOCATION UNIT
ORACLE BLOCK
PHYSICAL BLOCK
ASM Architecture
Node 1 DB Instance
PMON RBAL DBWR SMON LGWR ASMB LGWR DBWR SMON PMON GMON RBAL Group Services +ASM1-->DG1 +ASM1 -->DG2
O C S S D O C S S D
Node 2
Group Services +ASM2-->DG1 +ASM2 -->DG2 +ASM2 -->DG3 ARB0 ARBa LGWR DBWR GMON RBAL SMON PMON
DB Instance
SMON LGWR ASMB PMON RBAL DBWR
FG
ARB0 ARBa
FG FG
DB Instance
ASMB SMON LGWR PMON RBAL DBWR
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
11
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
12
13
SYSOPER
STARTUP/SHUTDOWN ALTER DISKGROUP MOUNT/DISMOUNT ALTER DISKGROUP ONLINE/OFFLINE DISK ALTER DISK REBALANCE ALTER DISKGROUP CHECK Access to all V$ASM_* views
ALL Operations
Non-Destructive Operations
14
15
16
17
NOTE : If you are using AMM, then ignore the above settings.
18
19
20
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
21
Disk Group
ASM Disk ASM Disk ASM Disk
22
Means Disk is of Oracle Object but can only be added to disk group with FORCE keyword Means Disk is available to be added to any disk group Same as CANDIDATE except that Disk is configured using ASMLIB Means Disk was formerly part of some disk group Means Disk is already part of existing disk group Oracle 10g ASM 23
Disk or LUN
Database Files
AU are part of only one file Span multiple ASM disks A file can only exist in one ASM disk Group
Access Units
ASM Disk
24
# chown oracle:dba /dev/rdsk/c1t1d1s4 # asm_diskstring =/dev/rdsk/c1t1d1s4 Data Softech Inc. Oracle 10g ASM 26
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
27
28
Triple Mirroring
Double Mirroring
No Mirroring
29
Enterprise Manager
30
32
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
33
Triple Mirroring
Double Mirroring
No Mirroring
34
ASM Components
ASM Instance ASM Disk Disk Group Failure Group ASM Files
35
Def Template
ARCHIVELOG AUTOBACKUP BACKUPSET CHANGETRACKING CONTROLFILE DATAGUARDCONFIG DATAFILE DUMPSET FLASHBACK ONLINELOG PARAMETERFILE TEMPFILE XTRANSPORT
Data Softech Inc.
FileType
archive_log autobackup backupset changetracking controlfile drc datafile dumpset rlog
online_log
FileTypeTAG
Thread_thread#_seq_seq#
Def Striping
COARSE COARSE COARSE COARSE FINE COARSE COARSE COARSE FINE
FINE
Client Specified Client Specified ctf Current | Backup Db_unique_name <ts_name>_<file#> User_obj#_file# log_<log#> Group_<group#> spfile <ts_name>_<file#> tsname
Oracle 10g ASM
init
temp
COARSE
COARSE
COARSE
36
du
lsct
rmalias pwd ls
lsdg
find
37
ASMCMD Examples
$ export ORACLE_SID=+ASM $ asmcmd ASMCMD> ls -ltr State Type Rebal Unbal Name MOUNTED EXTERN N N DG_DATA/ ASMCMD> cd DG_DATA ASMCMD> ls -ltr Type Redund Striped Time Sys Name Y DEVPROF/ ASMCMD> cd DEVPROF
ASMCMD> ls -ltr
Type Redund Striped Time Sys Y Y Y Y Y Y Y Name ARCHIVELOG/ CONTROLFILE/ DATAFILE/ DUMPSET/ ONLINELOG/ PARAMETERFILE/ TEMPFILE/ Name Current.1326.591118473 Current.263.590674673 Current.264.590674673
ASMCMD> ls -ltr CONGTROLFILE Type Redund Striped Time Sys CONTROLFILE UNPROT FINE MAY 22 15:00:00 Y CONTROLFILE UNPROT FINE MAY 22 15:00:00 Y CONTROLFILE UNPROT FINE MAY 22 15:00:00 Y
38
ASM Instance
Row for each DB Instance using Disk group Managed by ASM instance Row for all Disk group discovered by the ASM instance Row for all disks discovered by ASM Instance even they are not part of any Disk group Row for all ASM file available in all disk group like online log, archived Data files, control file etc Row for every active ASM long running Operation in an ASM instance Row for every alias present in all mounted Disk group
DB Instance
Row for each Disk Group used by DB Instance Row for all disk group mounted or dismounted Row for disks in the disk group in use by DB instance No rows
No rows
No rows
39
40
41
42
43
Recreate Temp files Drop and recreate Online Redo log groups to ASM
Tablespace Migration
Take tablespace offline Backup copy of tablespace to ASM using RMAN Switch the Tablespace to ASM using RMAN Bring the Tablespace online
Data Softech Inc.
SPFILE Migration
Create PFILE Create SPFILE in required disk Group Edit $OH/dbs/init+ASM.ora and add SPFILE=dg_path specified in step 2
44
Using DBMS_FILE_TRANSFER
Using XMLDB
45
DBMS_FILE_TRANSFER
ASM Disk
10g R2
DBMS_FILE_TRANSFER
File System
DBMS_FILE_TRANSFER
ASM Disk
Read Local File and copy it to new location on local system Contact Remote DB to read Remote file and copy it to Local system Read Local File and contact Remote DB to copy it to remote system
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 Oracle 10g ASM 46
DBMS_FILE_TRANSFER Example
SQL> CREATE DIRECTORY NonASM AS '/export/home/oracle/data' ; Directory created. SQL> CREATE DIRECTORY ASM_D AS as '+DATAD_G1/DEVPROF' ; Directory created. 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 / PL/SQL procedure successfully completed.
47
Using XMLDB
48
$ ftp indy.prnewswire.com 6010 Name (indy.prnewswire.com:oracle): system Password: FTP> cd sys/asm/DG_DATA FTP> binary FTP> get prof.dmp Local : prof.dmp remote: prof.dmp 250 BIN Data Connection 336 BIN Transfer Complete FTP> quit Data Softech Inc. Oracle 10g ASM 50
EM Home Page ..
51
EM Home Page ..
52
EM Home Page ..
53
EM Home Page ..
54
EM Monitoring Metrics
55
Final Thoughts .
Go with Oracle 10g Release 2 on production for ASM environment Work on the following for backup as well data files movement RMAN XMLDB DBMS_FTP_TRANSFER You need ASM on Standby ( Physical ) location, if the Primary database is using ASM If you are on Linux, then use ASMLIB with ASM
56
Misc. Tips #1
Oracle ASM webpage: http://www.oracle.com/technology/products/database/asm/index.html Upgrade ASM using Metalink 329987.1 Re-creating ASM Instances and Diskgroups Doc ID: Note:268481.1 How To Reclaim Asm Disk Space? Doc ID: Note:351866.1 How to Re-configure Asm Disk Group? Doc ID: Note:331661.1 How to Move Asm Database Files From one Diskgroup To Another ? Doc ID: Note:330103.1 Tuning Oracle Database 10g on Linux Using ASM, Bert Scalzo, 2006, http://www.oracle.com/technology/oramag/webcolumns/2003/techarti cles/scalzo_asm.html Oracle Database 10g Release 2 Automated Storage Management Overview and Technical Best Practices, Nitin Vengurlekar, Oracle Corporation 2005
57
Misc. Tips #2
ASM Metadata
It is stored in all ASM Disks header and contain information Disk group name Physical size of all Disks in the Disk Group Allocation Unit (AU) Size Disk Own Size Failure Group Name of Disk Creation Date Redundancy Type Metadata is also stored as ASM file on ASM disks. These Files are internal to data and has file_number less than 256. This is the reason when creating Database on ASM have SYSTEM datafile as file_number as 256 and onwards Metadata is always mirrored across three disk ( if Available) even you are choosing EXTERNAL REDUNDACY. Metadata is also stored in SGA of Database Instance copied by ASMB
Data Softech Inc. Oracle 10g ASM 58
QUESTIONS ANSWERS
THANKS
60