Oracle ASMis a volume manager and a file system for Oracle database files that supports
single-instanceOracle Database and
Oracle Real Application Clusters(Oracle RAC) configurations.
Oracle ASMis Oracle’s recommended storage management solution that provides an alternative to conventional volume managers, file systems, and raw devices.
Oracle ASM uses disk groups to store data files, an Oracle ASM disk group is a collection of disks that Oracle ASM manages as a unit.
Within a disk group, Oracle ASM exposes a file system interface for Oracle database files. The content of files that are stored in
a disk groupis evenly distributed to eliminate hot spots and to provide uniform performance across the disks.
Oracle ASM instanceis built on the same technology as an Oracle Database instance. An Oracle ASM instance has a
System Global Area(SGA) and background processes that are similar to those of Oracle Database.
However, because Oracle ASM performs fewer tasks than a database, an Oracle ASM SGA is much smaller than a database SGA. In addition, Oracle ASM has a minimal performance effect on a server. Oracle ASM instances mount disk groups to make Oracle ASM files available to database instances; Oracle ASM instances do not mount databases.
See the below structures:
Example - Oracle ASM Cluster with RAC
Oracle ASM clusterin an Oracle
RACenvironment where Oracle ASM provides a clustered pool of storage. There is one Oracle ASM instance for each node serving multiple
single-instancedatabases in the cluster. All of the databases are consolidated and share the same two Oracle ASM disk groups.
Example - Oracle ASM Cluster with single instance
A clustered storage poolcan be shared by multiple
single-instanceOracle Databases. In this case, multiple databases share common disk groups. A shared Oracle ASM storage pool is achieved by using Oracle Clusterware. However, in such environments an Oracle RAC license is not required.
A disk groupconsists of multiple disks and is the fundamental object that Oracle ASM manages. Each disk group contains the metadata that is required for the management of space in the disk group. Disk group components include disks, files, and allocation units.
Files are allocated from disk groups. Any Oracle ASM file is completely contained within a single disk group. However, a disk group might contain files belonging to several databases and a single database can use files from multiple disk groups. For most installations you need only a small number of disk groups, usually two, and rarely more than three.
Oracle ASM disksare the storage devices that are provisioned to Oracle ASM disk groups. Examples of Oracle ASM disks include:
- A disk or partition from a storage array
- An entire disk or the partitions of a disk
- Logical volumes
- Network-attached files (NFS)
Oracle ASM spreads the files proportionally across all of the disks in the disk group. This allocation pattern maintains every disk at the same capacity level and ensures that all of the disks in a disk group have the same
I/Oload. Because Oracle ASM load balances among all of the disks in a disk group, different Oracle ASM disks should not share the same physical drive.
Files that are stored in Oracle ASM disk groups are called
Oracle ASM files. Each Oracle ASM file is contained within a single Oracle ASM disk group. Oracle Database communicates with Oracle ASM in terms of files.
This is similar to the way Oracle Database uses files on any file system. You can store the various file types in Oracle ASM disk groups.
SQL> create diskgroup orag2 external redundancy disk 'ORCL:VOL5';
dd if=/dev/zero of=/dev/rdsk/c1t4d0s4 bs=8192 count=12800
# The rebalancing speed is controlled by the ASM_POWER_LIMIT initialization parameter.
One can use
Rmanto convert a datafile, tablespace or entire database from/to
Here are the steps required to migrate an entire database to
Ensure the database is using an
SPFILEand not a
PFILE(it’s about time after all!).
Set parameters on the target database.
For example, if we set both
DB_RECOVERY_FILE_DESTwe should get mirrored controlfiles and duplexed log files by default:
SQL> alter system set DB_CREATE_FILE_DEST = '+DATA';
Start the database in
NOMOUNTmode and restore the controlfile into the new location from the old location:
RMAN> connect target /
RMAN> STARTUP NOMOUNT
RMAN> RESTORE CONTROLFILE FROM 'old_control_file_name';
Mount the database and copy the database into the
ASM disk group:
RMAN> ALTER DATABASE MOUNT;
RMAN> CONFIGURE DEVICE TYPE DISK PARALLELISM 8;
RMAN> BACKUP AS COPY DATABASE FORMAT '+DATA';
Switch all datafiles to the new
ASMlocation and open the database:
RMAN> SWITCH DATABASE TO COPY;
RMAN> ALTER DATABASE OPEN;
Add new tempfiles and drop the old tempfiles:
SQL> alter tablespace temp add tempfile;
SQL> alter database tempfile '...' DROP;
SQL> select * from dba_temp_files;
1 SQL> CREATE SPFILE '+DATA' FROM PFILE;
Move redo log files into
ASM- for each group:
SQL> ALTER DATABASE DROP LOGFILE GROUP 1;
SQL> ALTER DATABASE ADD LOGFILE GROUP 1 SIZE 100M;
Ensure the database in in
archive log mode, and from
sql "alter tablespace TSNAME offline";
backup as copy tablespace TSNAME format '+DATA';
switch tablespace TSNAME to copy;
sql "alter tablespace TSNAME online";
Ensure the database in in
archive log mode, and from
sql "alter database datafile '...' offline";
backup as copy datafile '...' format '+DATA';
switch datafile '..' to copy;
sql "alter database datafile '...' online";
V$ASM_DISK -- ASM disks
License: CC BY-NC-ND 4.0