Recommendations Common to ASM and File System

Oracle

Audience
Public
Technology Integrations
Oracle
Source Type
Documentation

Unlike traditional storage, IOPS are not a function of LUN count. In other words, you get the same IOPS capacity with 1 LUN as you do with 100. However, since it is often convenient to monitor database performance by I/O type (for example, LGWR, DBWR, TEMP), we recommend creating ASM disk groups or file systems dedicated to these individual workloads. This strategy allows you to observe the characteristics of each I/O type either at the command line with tools like iostat and pureadm, or with the Everpure GUI.

In addition to isolating I/O types to individual disk groups, you should also locate the Fast Recovery Area (FRA). We recommend opting for a few large LUNs per disk group.

If performance is a critical concern, we recommend that you do not multiplex redo logs. It is not necessary for redundancy since RAID-HA provides protection against media failures. Multiplexing redo logs introduced a performance impact of up to approximately 10% for a heavy OLTP workload. If your

operations policy requires you to multiplex redo logs, we recommend placing the group members in separate disk groups or file systems. For example, you can create two disk groups, REDOSSD1 and REDOSSD2, and multiplex across them:

Finally, while some flash storage vendors recommend a 4K block size for both redo logs and the database itself (to avoid block misalignment issues), Everpure does not. Since the Everpure FlashArray is designed on a 512-byte geometry, we never have block alignment issues. Performance is completely independent of the block size.

ASM Specific Recommendations

In Oracle 11gR3 the default striping for ONLINELOG template changed from FINE to COARSE. In OLTP workload testing, we found that the COARSE setting for redo logs performs about 20% better. Since the Everpure FlashArray includes RAID-HA protection, you can safely use External Redundancy for ASM diskgroups. Other factors such as sector size and AU size do not have a significant bearing on performance.

ASM SCANORDER

Everpure recommends that you use multipath disks to achieve maximum performance and resiliency. If you are using ASM, you need to configure the SCANORDER to look at multipath devices first. You can do this by changing the following setting in /etc/sysconfig/oracleasm.

Search for:

ORACLEASM_SCANORDER=""

Change to

ORACLEASM_SCANORDER="dm- sd"

More information can be found here: http://www.oracle.com/technetwork/to...th-097959.html.

Table 1. ASM Disk Group Recommendations

Disk Group

Sector Size

Strip

AU Size

Redundancy

Note:

ORACRS

512

COARSE

1048576

External

Small disk group for CRS

ORADATA

512

COARSE

1048576

External

Database segments

ORAREDO

512

COARSE

1048576

External

Redo logs

ORAFRA

512

COARSE

1048576

External

Fast Recovery Area

Following SQL can be used to check the current redundancy type of all diskgroups.
select name, allocation_unit_size/1024/1024 as "AU", state, type, round(total_mb/1024,2) as "Total", round(free_mb/1024,2) as "Free"

  from v$asm_diskgroup;

ASM Space Reclamation

Reclaiming Unused Space in an Oracle Database

As you drop, truncate, or resize database objects in an ASM environment, the space metrics reported by the data dictionary (DBA_FREE_SPACE, V$ASM_DISKGROUP, V$DATAFILE, etc.) reflect your changes as expected. However, these actions may not always trim (free) space on the array immediately. The following options are available to reclaim free space on the Flash Array.

Method 1 - ASMFD THIN_PROVISIONED Attribute

In Oracle 12.1, Oracle released a new kernel module called ASM Filter Driver (ASMFD) that sits in the I/O path of ASM disks. ASMFD provides additional functionality over what was provided by ASMLib. The one that interests us in the context of our problem is a new attribute that was introduced in 12.2 called THIN_PROVISIONED.

The THIN_PROVISIONED attribute enables or disables the functionality to discard unused storage space after a disk group rebalance is completed. The attribute value can be set to true to enable, or set to false to disable the functionality. The default value is false.


SQL > sqlplus / as sysasm
SQL > alter diskgroup DATA set attribute 'thin_provisioned'='TRUE';

When the COMPACT phase of a rebalance operation has completed, Oracle ASM informs the Flash Array which space is no longer used and can be repurposed.

ASM Disk Group rebalance can be triggered using the following command.


SQL > alter diskgroup DATA rebalance with balance compact wait;

Things to be aware of before implementing ASM Filter Driver.

  1. Check the ASM Filter Driver Certification Matrix for supported Linux kernel versions.
  2. If ASMLib is installed and configured for an existing Oracle ASM installation, then it must be explicitly uninstalled before installing and configuring Oracle ASMFD.
  3. Make sure you are on a database version that includes a fix to Bug 28378446 - Using AFD and Attribute "thin_provisioned=true" Can Cause Database Corruption.

    Method 2 - ASM Disk Group Reorganization

    As discussed above, using the ASM Filter Driver with the THIN PROVISIONED attribute set to true can reclaim space when the tablespace is dropped. However, ASM Filter Driver is relatively new and there are many Oracle database installations that either have not or, for various reasons can not make the switch to using ASM Filter Driver. Moreover, there could be cases where the database has a large amount of free space due to dropped or truncated objects but it is not practical to drop the tablespace. For such scenarios, the method described below can be used.

    Add a New Disk and Drop the Old One

    Identify the disks that have a large amount of free space that can be reclaimed, and the disk group they are part of.

    Execute the following command to replace the existing bloated disk in the disk group with a new disk. This SQL also initiates a ASM rebalance of the blocks from the old disk to the new disk. As the wait clause is used, control will be returned only after the operation is complete.

    
    SQL > alter diskgroup DATA add disk '/dev/oracleasm/disks/DATA2' name DATA2
          drop disk DATA1
          rebalance power 16 wait;
    

    So at the end of this command, the old disk will no longer be part of the disk group and can be safely deleted on the FlashArray.

    Note: Oracle recommends that all the disks in a disk group be of the same size. Starting with version 12.2, it enforces this condition for disk groups created with Normal or High redundancy.

    ASMLib and Alternative

    ASMLib is an Oracle-provided utility that allows you to configure block devices for use with ASM. Specifically, it marks devices as ASM disks and sets their permissions so that the o/s account that runs ASM (typically either grid or oracle) can manipulate these devices. For example, to create an ASM disk named MYASMDISK backed by /dev/dm-2 you would issue the command:

    
    /etc/init.d/oracleasm createdisk MYASMDISK /dev/dm-2

    Afterward, /dev/dm-2 appears to still have the same ownership and permissions, but ASMLib creates a file /dev/oracleasm/disks/MYASMDISK owned by the O/S user and the group is identified in /etc/sysconfig/oracleasm. Tell the ASM instance to look for potential disks in this directory through the asm_diskstring initialization parameter.

    In case you do not want to use ASMLib, you can certainly use the UDEV rules, which is the basis for ASMLib.

    Dedicated ASM Disk Froups for Each Database

    ASM allows files from multiple databases to be placed under a common disk group. Create dedicated ASM disk groups for each database.

    ASM SPFILE Location

    When a new database is created using the Database Configuration Assistant (dbca), ASM password (orapwasm) and spfile are typically placed in the +DATA diskgroup. It is recommended that database files not be placed on the same disk group as ASM files because restoring a database from a snapshot backup will overwrite the ASM configuration files as well. This will have the unintended consequence of crashing and/or corrupting the ASM instance.

    Disable ASM Compact

    ALTER DISKGROUP DATA_PRODDB SET ATTRIBUTE '_rebalance_compact'='FALSE';

    File System Recommendations

    There is no significant performance penalty for using a file system instead of ASM. As with ASM, we recommend placing data, redo, and the fast recovery area (FRA) onto separate volumes to ease administration. We also recommend using the ext4 file system and mount it with discard and noatime options. Below is a sample /etc/fstab file showing mount points /u01 (for oracle binaries, trace files, etc.), /oradata (for datafiles) and /oraredo (for online redo logs).

    The main page for mount describes the /discard flag as follows:

    discard/nodiscard

    Controls whether ext4 should issue discard/TRIM commands to the underlying block device when blocks are freed. This is useful for SSD devices and sparse/thinly-provisioned LUNs, but it is off by default until sufficient testing has been done.

    Mounting the ext4 file system with the discard flag causes freed space to be trimmed immediately, just as the ASRU utility trims the storage behind ASM disk groups.