Oracle Automatic Storage Management (ASM) is a storage solution for Oracle that acts as a volume manager providing file system for exclusive use of the database. When using ASM partitioned disks are assigned to ASM for striping, mirroring, management and ASM implements OMF. ASM has its own database instance which is specifically designed to manage the disks and distribute I/O for performance. The benefits of using ASM are:
- Simplifies operations by creating database and managing disk space.
- Distributes data across physical disks to provide uniform performance.
- Rebalance data automatically after storage change.
An ASM instance uses same basic instance as Oracle database instance with a few exceptions. SGA of ASM is much smaller because it performs fewer activities. Only function of ASM is to mount disk groups and make associate files available to database instances. The logical storage elements of an Oracle ASM instance:
- ASM Disks – Storage devices can be physical disks or LUN (Logical Unit Number) from array or network attached file.
- ASM Disk Group – Group of ASM Disks managed as a logical unit.
- ASM Files – File stored in an Oracle ASM disk group can be data files, control files, online redo logs, other types of files.
- ASM Extents – Raw storage used to hold contents of Oracle ASM file. ASM file is one or more file extents and ASM extent is one or more ASM allocation units.
- ASM Allocation Units – smallest unit of allocation within a disk group.
- ASM Instance – special oracle instance to manage ASM disks. Manages metadata and provides access to database instances.
The files that an ASM instance support are: NOTE ASM does not support trace files, audit files, alert logs, export files, or core files.
- Control Files.
- Data files
- Redo log files
- Archive log files.
- Temporary files.
- Data file backup pieces
- Archive log backup pieces.
- Persistent initialization parameter files (SPFILE)
- Flashback logs
- Data Pump dumpset
The file naming conventions in an ASM instance include Fully Qualified Name, Individual Element Names and Alias Names. A Fully qualified file name is created when a new ASM file is created and gives a complete path name in the ASM file system. You use the filly qualified file name for existing Oracle ASM files, except for disk group creation. They have the following format:
An individual element Name is the name of a single file in the ASM instance. The breakdown of Individual elements of file name includes:
- +diskgroup – the disk group name preceded by a plus sign. plus sign(+) means root directory of ASM instance.
- dbname – DB_UNIQUE_NAME of database owning file.
- filetype – Oracle file type.
- filetypetag – Type specific info about the file.
- incarnation – file/incarnation pair ensure uniqueness.
Example of ASM filename.
File creation request do not give full name, it gives alias or disk group name. If Alias is given, the ASM instance will create it and point at full name. ASM can take single or multiple file create requests at the same time.
Aliases can be used to reference existing ASM file or create new ones. Alias name consist of a Disk Group name proceeded by a plus sign (+), a slash (/), and a sting of characters. Aliases must include the Disk Group name. They cannot exist in root (+) level. When a file is created with alias, both are recorded by ASM and you can access by both. Alias names cannot end in dotted pair of numbers. Example of Alias names
Example of tablespace datafile creation with alias name:
Create tablespace data_one datafile ‘+data/orcldb/data_01.dbf’ size 100m;
If an alias is used, it is not an OMF file and will not be automatically deleted when tablespace is dropped. You must manually delete it as shown below.
Alter diskgroup data drop file ‘+data/orcldb/data_01.dbf’;