Skip Headers
Oracle® Database SQL Language Reference
11g Release 1 (11.1)

Part Number B28286-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

CREATE DISKGROUP

Note:

This SQL statement is valid only if you are using Automatic Storage Management and you have started an Automatic Storage Management instance. You must issue this statement from within the Automatic Storage Management instance, not from a normal database instance. For information on starting an Automatic Storage Management instance, refer to Oracle Database Storage Administrator's Guide.

Purpose

Use the CREATE DISKGROUP clause to name a group of disks and specify that Oracle Database should manage the group for you. Oracle Database manages a disk group as a logical unit and evenly spreads each file across the disks to balance I/O. Oracle Database also automatically distributes database files across all available disks in disk groups and rebalances storage automatically whenever the storage configuration changes.

This statement creates a disk group, assigns one or more disks to the disk group, and mounts the disk group for the first time. If you want Automatic Storage Management to mount the disk group automatically in subsequent instances, then you must add the disk group name to the value of the ASM_DISKGROUPS initialization parameter in the initialization parameter file. If you use an SPFILE, then the disk group is added to the initialization parameter automatically.

See Also:

Prerequisites

You must have the SYSDBA system privilege to issue this statement.

Before issuing this statement, you must format the disks using an operating system format utility. Also ensure that the Oracle Database user has read/write permission and the disks can be discovered using the ASM_DISKSTRING.

When you store your database files in Automatic Storage Management disk groups, rather than in a file system or on raw devices, before the database instance can access your files in the disk groups, you must configure and start up an Automatic Storage Management instance to manage the disk groups.

Each database instance communicates with a single Automatic Storage Management instance on the same node as the database. Multiple database instances on the same node can communicate with a single Automatic Storage Management instance.

Syntax

create_diskgroup::=

Description of create_diskgroup.gif follows
Description of the illustration create_diskgroup.gif

qualified_disk_clause::=

Description of qualified_disk_clause.gif follows
Description of the illustration qualified_disk_clause.gif

(size_clause::=)

Semantics

diskgroup_name

Specify the name of the disk group. Disk groups are subject to the same naming conventions and restrictions as database schema objects. Refer to "Schema Object Naming Rules" for information on database object names.

REDUNDANCY Clause

The REDUNDANCY clause lets you specify the redundancy level of the disk group.

FAILGROUP Clause

Use this clause to specify a name for one or more failure groups. If you omit this clause, and you have specified NORMAL or HIGH REDUNDANCY, then Oracle Database automatically adds each disk in the disk group to its own failure group. The implicit name of the failure group is the same as the operating system independent disk name (see "NAME Clause").

You cannot specify this clause if you are creating an EXTERNAL REDUNDANCY disk group.

qualified_disk_clause

Specify DISK qualified_disk_clause to add a disk to a disk group.

search_string  For each disk you are adding to the disk group, specify the operating system dependent search string that Automatic Storage Management will use to find the disk. The search_string must point to a subset of the disks returned by discovery using the strings in the ASM_DISKSTRING initialization parameter. If search_string does not point to any disks the Oracle Database user has read/write access to, then Automatic Storage Management returns an error. If it points to one or more disks that have already been assigned to a different disk group, then Oracle Database returns an error unless you also specify FORCE.

For each valid candidate disk, Automatic Storage Management formats the disk header to indicate that it is a member of the new disk group.

See Also:

The ASM_DISKSTRING initialization parameter for more information on specifying the search string

NAME Clause The NAME clause is valid only if the search_string points to a single disk. This clause lets you specify an operating system independent name for the disk. The name can be up to 30 alphanumeric characters. The first character must be alphabetic. If you omit this clause and you assigned a label to a disk through ASMLIB, then that label is used as the disk name. If you omit this clause and you did not assign a label through ASMLIB, then Automatic Storage Management creates a default name of the form diskgroup_name_####, where #### is the disk number. You use this name to refer to the disk in subsequent Automatic Storage Management operations.

SIZE Clause Use this clause to specify in bytes the size of the disk. If you specify a size greater than the capacity of the disk, then Automatic Storage Management returns an error. If you specify a size less than the capacity of the disk, then you limit the disk space Automatic Storage Management will use. If you omit this clause, then Automatic Storage Management attempts programmatically to determine the size of the disk.

FORCE Specify FORCE if you want Automatic Storage Management to add the disk to the disk group even if the disk is already a member of a different disk group.

Caution:

Using FORCE in this way may destroy existing disk groups.

For this clause to be valid, the disk must already be a member of a disk group and the disk cannot be part of a mounted disk group.

NOFORCE Specify NOFORCE if you want Automatic Storage Management to return an error if the disk is already a member of a different disk group. NOFORCE is the default.

ATTRIBUTE Clause

Use this clause to set attribute values for the disk group. You can view the current attribute values by querying the V$ASM_ATTRIBUTE view. Table 14-1 lists the attributes you can set with this clause. All attribute values are strings.

Table 14-1 Disk Group Attributes

Attribute Valid Values Description

AU_SIZE

Size in bytes. Valid values are powers of 2 from 1M to 64M. Examples '4M', '4194304'.

Specifies the allocation unit size. This attribute can be set only during disk group creation; it cannot be modified with an ALTER DISKGROUP statement.

COMPATIBLE.RDBMS

Valid Oracle Database version number (Note 1)

This setting is not reversible. It dictates the format of messages that are exchanged between the Automatic Storage Management instance and the database instance. You can set different values of this parameter for different database clients running at different compatibility settings. However, the compatibility settings for all disk groups must be equal to or less than the value of the COMPATIBLE initialization parameter of the database using the disk groups.

COMPATIBLE.ASM

Valid Oracle Database version number (Note 1)

This setting is not reversible. It controls the format of data structures for ASM metadata on disk. COMPATIBLE.ASM must always be greater than or equal to COMPATIBLE.RDBMS for the same disk group. For example, you can set COMPATIBLE.ASM for the disk group to 11.0 and COMPATIBLE.RDBMS for the disk group to 10.1. In this case, the disk group can be managed only by Automatic Storage Management software of version is 11.0 or higher, while any database client of version 10.1 or higher can use that disk group.

DISK_REPAIR_TIME

0 to 136 years

By default, ASM drops disks shortly after they are taken offline. This attribute lets you prevent that operation in order to repair the disk and bring it back online. The time can be specified in units of minute (M) or hour (H). If you omit the unit, then the default is H. If you omit this attribute, then the default is 3.6 H. The specified time elapses only when the disk group is mounted. After the specified time, ASM drops the disk. You can override this attribute with an ALTER DISKGROUP ... DISK OFFLINE statement and the DROP AFTER clause.

See Also: The ALTER DISKGROUP ... disk_offline_clause for more information

Note 1: Specify at least the first two digits of a valid Oracle Database release number. Refer to Oracle Database Administrator's Guide for information on specifying valid version numbers. For example, you can specify compatibility as '10.2' or '11.1'.


See Also:

Oracle Database Storage Administrator's Guide for more information on managing these attribute settings

Examples

The following example assumes that the ASM_DISKSTRING parameter is a superset of $ORACLE_HOME/disks/c*, $ORACLE_HOME/disks/c* points to at least one device to be used as an Automatic Storage Management disk, and the Oracle Database user has read/write permission to the disks.

See Also:

Oracle Database Storage Administrator's Guide for information on Automatic Storage Management and using disk groups to simplify database administration

Creating a Diskgroup: Example The following statement creates an Automatic Storage Management disk group dgroup_01 where no redundancy for the disk group is provided by Automatic Storage Management and includes all disks that match the search_string:

CREATE DISKGROUP dgroup_01
  EXTERNAL REDUNDANCY
  DISK '$ORACLE_HOME/disks/c*';