You are on page 1of 60

ORACLE 10g ASM

May 17th, 2006

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

Data Softech Inc. Oracle 10g ASM 2


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
Not Certified for
Trace Files
Data files Temp File
ORACLE_HOME
Log files Voting Disk SPfile
OCR Files
Archived files Alert Log DG file
Password File
Control Files Binary File (BFILE) Flashback Logs

DataGuard Datapump File

Change Tracking File

Data Softech Inc. Oracle 10g ASM 3


Benefits of Automatic Storage Management
 Provide efficient management of storage
 No need for buggy OCFS or expensive 3rd party CFS
 Provide integrated Cluster File system and Volume
management capabilities

Traditional Volume Mgmt. ASM


Tables Tables

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]

Triple Mirroring Double Mirroring No Mirroring

Data Softech Inc. Oracle 10g ASM 5


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]
 Automatic online re-organization of disk space for any new
addition/removal of storage capacity
Disk Group

Data Softech Inc. Oracle 10g ASM 6


Benefits of Automatic Storage Management
 Automatic IO load balancing as data is striped across disks and
better performance
 Available for both Single Instance as well as RAC instance
 Free built in 10g kernel – Available even in Standard Edition
 Prevents Fragmentation and hence no need to relocate data to
reclaim space
 Overcomes file system size limitations
 Prevents accidental file deletion
 Backup with RMAN

Data Softech Inc. Oracle 10g ASM 7


ASM Components
DATABASE ASM DISK GROUP

TABLESPACE DATAFILE ASM FILE

SEGMENT ASM DISK

FILE SYSTEM FILE


Or
EXTENT ALLOCATION UNIT
RAW DEVICE

ORACLE BLOCK PHYSICAL BLOCK

ASM Disk ASM Disk ASM Disk

Data Softech Inc. Oracle 10g ASM 8


Pre-Requisite for ASM
 Need CSS daemon for creating an ASM instance
$ ps –ef | grep css
1. In RAC, it is done by Oracle CLusterware
2. In Single Instance environment, you have to run
# $ORACLE_HOME/bin/localconfig add

To reconfigure the CSS daemon to run from the new Oracle home:
# $ORACLE_HOME/bin/localconfig reset $ORACLE_HOME

 Need Additional at least 100M of memory for ASM instance

Data Softech Inc. Oracle 10g ASM 9


ASM Architecture
Node 1 Node 2
DB Instance Group Services O
C
O
C
Group Services DB Instance
+ASM1-->DG1 S S +ASM2-->DG1
PMON SMON +ASM1 -->DG2 S S +ASM2 -->DG2 SMON PMON
D D
+ASM2 -->DG3 RBAL
RBAL LGWR LGWR
DBWR ASMB LGWR SMON ASMB DBWR
ARB0 GMON
DBWR PMON …
RBAL FG
FG ARB0 GMON ARBa
LGWR SMON
… FG
RBAL DB Instance
ARBa DBWR PMON
ASM Instance +ASM1
ASM Instance +ASM2 ASMB PMON
SMON RBAL
LGWR DBWR

ASM Disk ASM Disk ASM Disk ASM Disk ASM Disk ASM Disk ASM Disk

DG1 – Disk Group DG2 – Disk Group DG3 – Disk Group

Data Softech Inc. Oracle 10g ASM 10


ASM Components
 ASM Instance
 ASM Disk
 Disk Group
 Failure Group
 ASM Files

Data Softech Inc. Oracle 10g ASM 11


ASM Components
 ASM Instance
 ASM Disk
 Disk Group
 Failure Group
 ASM Files

Data Softech Inc. Oracle 10g ASM 12


ASM Components – ASM Instance
10g has two types of Instance
 INSTANCE_TYPE = asm ASM Instance
 INSTANCE_TYPE = rdbms [Default] DB Instance
Feature of ASM instance
 Do not mount the database but manage metadata required to
make ASM files available for DB instances
 DB Instance access ASM files directly and contact ASM instance
only for the layout of ASM files
 Smaller than DB instance < 100M
 Contains no physical files like log files / control files or data files
 Requires only the init.ora file for startup
 Instance Name is +ASM or +ASM1..n [RAC]

Data Softech Inc. Oracle 10g ASM 13


ASM Components – ASM Instance
 ASM instance have no user dictionary and so only way to connect
is OS authentication with SYSDBA or SYSOPER privileges

SYSDBA SYSOPER

ALL SYSOPER as on RHS STARTUP/SHUTDOWN


And ALTER DISKGROUP MOUNT/DISMOUNT
ASM Instance ALTER DISKGROUP ONLINE/OFFLINE DISK
CREATE DISKGROUP ARB0 ALTER DISK REBALANCE
SMON
ADD/DROP/RESIZE DISK … ALTER DISKGROUP CHECK
S ARBa PMON Access to all V$ASM_* views
G
LGWR GMON
A
DBWR RBAL Non-Destructive Operations
ALL Operations

ASM Disk Group

ASM Disk ASM Disk ASM Disk

Data Softech Inc. Oracle 10g ASM 14


ASM Components – ASM Instance
Database Configuration Assistant Manual using SQL Oracle Universal Installer

SQL> startup pfile=init+ASM.ora

Data Softech Inc. Oracle 10g ASM 15


ASM Components – ASM Instance
Starting an ASM instance using STARTUP command
MOUNT | OPEN Mount the Disk Group as per ASM_DISKGROUPS setting

NOMOUNT Start the Instance but ignore ASM_DISKGROUPS setting

FORCE Perform SHUTDOWN ABORT to ASM before Restarting

RESTRICT Prevents DB instances connecting to the ASM instance

Shutting down and ASM instance using SHUTDOWN command


ASM instance wait until all SQL running in any connected
NORMAL DB instance are complete before dismounting any Disk Group
IMMEDIATE
TRANSACTIONAL ORA-15097 : Cannot SHUTDOWN ASM instance with
10g R2
Connected RDBMS instance
Shutdown ASM instance immediately without orderly
ABORT
Dismounting Disk Group. All connect DB instances also aborts

Data Softech Inc. Oracle 10g ASM 16


ASM Components – ASM Instance
$ sqlplus /nolog
SQL> connect / as sysdba
Connected to an Idle instance
SQL> startup
ASM instance started

Total System Global Area 79691776 bytes


Fixed Size 1247396 bytes
Variable Size 53278556 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted

Data Softech Inc. Oracle 10g ASM 17


ASM Components – DB Instance
 At least 600 K to LARGE_POOL_SIZE
 At least 25 +15n to PROCESSES where n is no. of DB Instance

 Add the following Megabyte to SHARED_POOL_SIZE based on


ASM mirroring and Total Database size
External Redundancy – ( dp_space / 100 +2 )
Normal Redundancy – ( dp_space / 50 +4 )
High Redundancy – ( dp_space / 33 +6 )

NOTE : If you are using AMM, then ignore the above settings.

Data Softech Inc. Oracle 10g ASM 18


ASM Components – ASM Instance
ASM Instance init.ora parameters
*.asm_diskgroups='DG_LOG','DG_DATA‘
*.asm_diskstring=‘/dev/rdsk/c*’
*.instance_type='asm‘
*.asm_power_limit=1
*.large_pool_size=12M
*.remote_login_passwordfile='SHARED'
*.user_dump_dest='/oracle/product/admin/+ASM/udump
*.background_dump_dest='/oracle/product/admin/+ASM/bdump‘
*.core_dump_dest='/oracle/product/admin/+ASM/cdump'

ASM Instance Binaries


 Use same ORACLE_HOME for ASM and DB Instance , if there is only one
DB instance
 Use separate ORACLE_HOME for ASM instance if it supports several
database instances

Data Softech Inc. Oracle 10g ASM 19


ASM Components – ASM & DB Instance
Three New Background Process for ASM instance
asm_rbal_+ASM -- Co-ordinate rebalance activity for Disk Group
10g R2 asm_gmon_+ASM -- Disk Group Monitor Process
asm_arb0_+ASM -- Perform Actual rebalance using Data extent
movement
-- ARB0 – ARBa depending ASM_POWER_LIMIT setting

Two New Background Process for DB instance


ora_rbal_TEST -- performs global opens of the disk in the Disk groups
asm_asmb_TEST -- Connects to Foreground process in ASM instance to
receive periodic updates and verify that both ASM
and DB instance are healthy.
Database instances are allowed to connect to only one ASM instance at a time
and hence they have at most one ASMB process

Data Softech Inc. Oracle 10g ASM 20


ASM Components
 ASM Instance
 ASM Disk
 Disk Group
 Failure Group
 ASM Files

Data Softech Inc. Oracle 10g ASM 21


ASM Components – ASM Disks
 It is first task in ASM environment to discover and add Disks to ASM
management
 In 10g Rel 2, Disk names are unique within Disk Group while in Rel 1 it
is unique within ASM instance.
SQL> CREATE DISKGROUP data_dg1 EXTERNAL REDUNDANCY DISK
‘/dev/dsk/sdc4’,’/dev/dsk/sdd4’;
SQL> SELECT name FROM v$asm_disk;
Name
DATA_DG1_0000
DATA_DG1_0001

Disk Selection for Disk Group


 The disk must not have a pre-existing ASM header
 The disk cannot have an Oracle File header
 The disk is not already part of another Disk group
The above validation prevents ASM from destroying any
In use data device

Adding Disks to Disk Groups


Disk Group
 Check if disk is usable
 Format the disk
ASM Disk ASM Disk ASM Disk
 Rebalance the Disk group
Data Softech Inc. Oracle 10g ASM 22
ASM Components – ASM Disks

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

Data Softech Inc. Oracle 10g ASM 23


ASM Components – ASM Disks
ASM separate files into extent and divides the extent for each file evenly
across all of the disks
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
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*

ASM with ASMLib I/O:


Tablespaces are created on raw block devices managed by ASM using ASMLib. Download ASMLIB rpm at
http://www.oracle.com/technology/tech/linux/asmlib

# rpm -Uvh oracleasm-support-2.0.1-1.x86_64.rpm


# rpm -Uvh oracleasm-2.6.9-22.0.1.ELsmp-2.0.1-1.x86_64.rpm
# rpm -Uvh oracleasmlib-2.0.1-1.x86_64.rpm

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 ]

Data Softech Inc. Oracle 10g ASM 25


ASM Components – ASM Disks Configuration - Linux
Configuring ASM Disk
Create Partitions in Solaris and add them as disks in ASM Doc ID: 271621.1

# 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.

Let us create a directory to store these character special files:


# mkdir asmdisk
# cd asmdisk

usage: mknod name [ b/c major minor ] [ p ]


# mknod disk1 c 32 20

# 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’

# 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

Data Softech Inc. Oracle 10g ASM 27


ASM Components – ASM Disk Groups
 It is collection of disks that can managed as logical unit.
 Easy to administer as number of Disk groups remains same while number of files
and disks continually increases.
 After Disk group is created, metadata is stored in SGA on each disk header and
include
 Creation data,
 Disk Group name and
 Redundancy type is stored in SGA and on each Disk header
 When you mount the Disk Group, ASM registers the following with CSS
 Disk Group name,
 Instance name
 Oracle Home Path
DB instance use the above information to build TNS string to connect to ASM
Instance
 A disk group can contain files from different DB Instances which can be on same
or reside on different servers

Data Softech Inc. Oracle 10g ASM 28


ASM Components – ASM Disk Groups

Triple Mirroring Double Mirroring No Mirroring

Data Softech Inc. Oracle 10g ASM 29


ASM Components – ASM Disk Groups Creation
Database Manual using SQL Enterprise
Manager
Configuration SQL> CREATE DISKGROUP data_dg1
Assistant EXTERNAL REDUNDANCY
disk '/dev/raw/raw1','/dev/raw/raw2';
Oracle
Universal
Installer

Data Softech Inc. Oracle 10g ASM 30


Disk Group Examples
Adding new disks to an existing ASM disk group.
ALTER DISKGROUP data_dg1 ADD FAILGROUP ctlr3
DISK '/asmdisks/disk5' NAME dg_5 NOFORCE;
Resizing an ASM disk group.
ALTER DISKGROUP data_dg1 RESIZE ALL SIZE 200M;
Resize all disks in a specific failure group
ALTER DISKGROUP data_dg1 RESIZE DISKS IN FAILGROUP CTLR4 SIZE 48M;

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 ;

Data Softech Inc. Oracle 10g ASM 31


Tablespace and Disk Group
SQL> CREATE TABLESPACE indy_data DATAFILE '+DATA_DG1' size 100M ;

Set the parameter DB_CREATE_FILE_DEST to +DATA_DG1


Examples: For the SID = DEVDB1

SQL> CREATE TABLESPACE indy_test_tblspc DATAFILE SIZE 100M ;


+DATA_DG1/DEVDB1/datafile/indy_test_tblspc.299.121212129

SQL> CREATE TABLESPACE TEST100 DATAFILE '+DATADG1' size 100M ;


+DATA_DG1/DEVDB1/datafile/indy_test_tblspc.300.121212129

SQL> CREATE TEMPORARY TABLESPACE TEMP1 TEMPFILE


'+DATADG1/DEVDB1/datafile/temp2.tst' size 100M ;
+DATA_DG1/DEVDB1/datafile/temp1.tst

Data Softech Inc. Oracle 10g ASM 32


ASM Components
 ASM Instance
 ASM Disk
 Disk Group
 Failure Group
 ASM Files

Data Softech Inc. Oracle 10g ASM 33


ASM Components – ASM Failure Groups
 ASM provides internal redundancy and high availability by way of Failure groups
 It is also collection of disk and is considered as subset of disk group.
 Disk group redundancy can be
 Normal – It is Two-way mirroring requiring at least two failure groups
(default)
 High – It is high degree Three-way mirroring requiring at least three failure
groups
 Once a Disk group is created, its redundancy cannot be changed. The only way
to change he redundancy is to create new Disk group with required redundancy
and move the datafiles on it using RMAN restore or using DBMS_FILE_TRANSFER
 ASM does not mirror disks but it mirror extents. When ASM allocates primary
extent (first extent) of a file to one disk in DG, its mirror copy of that extent to
another disk in DG

Triple Mirroring Double Mirroring No Mirroring

Data Softech Inc. Oracle 10g ASM 34


ASM Components
 ASM Instance
 ASM Disk
 Disk Group
 Failure Group
 ASM Files

Data Softech Inc. Oracle 10g ASM 35


ASM Files - Types
Fully Qualified ASM Filename: By default ASM automatically generates filename in the
following form +group/dbname/file_type/file_type_tag.file.incarnation
e.g. +ddg1/indydbn/controlfile/current.256.2195494
Def Template FileType FileTypeTAG Def Striping
ARCHIVELOG archive_log Thread_thread#_seq_seq# COARSE
AUTOBACKUP autobackup Client Specified COARSE
BACKUPSET backupset Client Specified COARSE
CHANGETRACKING changetracking ctf COARSE
CONTROLFILE controlfile Current | Backup FINE
DATAGUARDCONFIG drc Db_unique_name COARSE
DATAFILE datafile <ts_name>_<file#> COARSE
DUMPSET dumpset User_obj#_file# COARSE
FLASHBACK rlog log_<log#> FINE
ONLINELOG online_log Group_<group#> FINE

PARAMETERFILE init spfile COARSE


TEMPFILE temp <ts_name>_<file#> COARSE

XTRANSPORT tsname COARSE

Data Softech Inc. Oracle 10g ASM 36


ASMCMD – Command Line Interface
cd
rm du

mkalias lsct
$ export ORACLE_SID=+ASM
$ asmcmd help
rmalias lsdg

pwd
find

ls

Data Softech Inc. Oracle 10g ASM 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 Name
Y ARCHIVELOG/
Y CONTROLFILE/
Y DATAFILE/
Y DUMPSET/
Y ONLINELOG/
Y PARAMETERFILE/
Y TEMPFILE/
ASMCMD> ls -ltr CONGTROLFILE
Type Redund Striped Time Sys Name
CONTROLFILE UNPROT FINE MAY 22 15:00:00 Y Current.1326.591118473
CONTROLFILE UNPROT FINE MAY 22 15:00:00 Y Current.263.590674673
CONTROLFILE UNPROT FINE MAY 22 15:00:00 Y Current.264.590674673

Data Softech Inc. Oracle 10g ASM 38


ASM Dictionary Views
ASM Views ASM Instance DB Instance
Row for each DB Instance using Row for each Disk Group
V$ASM_CLIENT Disk group Managed by ASM instance used by DB Instance

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

Row for all disks discovered by ASM


V$ASM_DISK Row for disks in the disk
Instance even they are not part of any
V$ASM_DISK_STAT group in use by DB instance
Disk group
Row for all ASM file available in all
V$_ASM_FILE disk group like online log, archived No rows
Data files, control file etc

Row for every active ASM long running


V$_ASM_OPERATION Operation in an ASM instance
No rows

Row for every alias present in all


V$_ASM_ALIAS mounted Disk group
No rows

Data Softech Inc. Oracle 10g ASM 39


File System to ASM Migration
 Using EM
 Using RMAN Manually
 Using DBMS_FILE_TRANSFER
 Using XMLDB

Data Softech Inc. Oracle 10g ASM 40


File System to ASM Migration
 Using EM
 Using RMAN Manually
 Using DBMS_FILE_TRANSFER
 Using XMLDB

Data Softech Inc. Oracle 10g ASM 41


Moving from File System to ASM - EM
 It uses RMAN for the
movement
 Job is scheduled using
DBMS_SCHEDULER

Data Softech Inc. Oracle 10g ASM 42


File System to ASM Migration
 Using EM

 Using RMAN Manually


 Using DBMS_FILE_TRANSFER
 Using XMLDB

Data Softech Inc. Oracle 10g ASM 43


Moving from File System to ASM - MANUAL
Database Migration
 Create an ASM instance
 Create the Required Disk Groups
 Setup OMF parameters
 Perform RMAN steps
 Backup as copy database format ‘+DiskGroup’
 Switch Database to copy
 Recreate Temp files
 Drop and recreate Online Redo log groups to ASM

Tablespace Migration SPFILE Migration


 Take tablespace offline  Create PFILE
 Backup copy of tablespace to ASM  Create SPFILE in required
using RMAN disk Group
 Switch the Tablespace to ASM  Edit $OH/dbs/init+ASM.ora
using RMAN and add SPFILE=dg_path
 Bring the Tablespace online specified in step 2

Data Softech Inc. Oracle 10g ASM 44


File System to ASM Migration
 Using EM
 Using RMAN Manually

 Using DBMS_FILE_TRANSFER
 Using XMLDB

Data Softech Inc. Oracle 10g ASM 45


DBMS_FILE_TRANSFER and ASM
File System to ASM
10g R2

File System DBMS_FILE_TRANSFER ASM Disk

ASM to File System


10g R2

ASM Disk DBMS_FILE_TRANSFER File System

ASM to ASM

ASM Disk DBMS_FILE_TRANSFER ASM Disk

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

Data Softech Inc. 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.

Data Softech Inc. Oracle 10g ASM 47


File System to ASM Migration
 Using EM
 Using RMAN Manually
 Using DBMS_FILE_TRANSFER

 Using XMLDB

Data Softech Inc. Oracle 10g ASM 48


ASM and XMLDB
SQL> CREATE DIRECTORY test_asm as ‘+DG_DATA’;
SQL> GRANT READ,WRITE ON DIRECTORY test_asm TO indy;
$ expdp indy/indy DUMPFILE=test_asm:indy.dmp nologfile=y ….

$ 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

SQL> select dbms_xdb.cfg_get "xdbconfig.xsd" from dual;


SQL>declare
newconfig XMLType;
begin
--ftp port setting
select updatexml(
dbms_xdb.cfg_get(),'/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()',6010)
into newconfig from dual;
dbms_xdb.cfg_update(newconfig);
--http port setting
select updatexml(
dbms_xdb.cfg_get(),'/xdbconfig/sysconfig/protocolconfig/httpconfig/http-
port/text()',6020) into newconfig from dual;
dbms_xdb.cfg_update(newconfig);
end;
Data Softech Inc. Oracle 10g ASM 49
ASM and XMLDB
 Cannot logon as SYS to view
/sys/asm
 Need DBA privileges to view
/sys/asm
 Cannot put regular files
under /sys/asm

$ 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 ..

Data Softech Inc. Oracle 10g ASM 51


EM Home Page ..

Data Softech Inc. Oracle 10g ASM 52


EM Home Page ..

Data Softech Inc. Oracle 10g ASM 53


EM Home Page ..

Data Softech Inc. Oracle 10g ASM 54


EM Monitoring Metrics

Data Softech Inc. Oracle 10g ASM 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

Data Softech Inc. Oracle 10g 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

Data Softech Inc. Oracle 10g ASM 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

Data Softech Inc. Oracle 10g ASM 60

You might also like