Creation of the ASM Instance with the DBCA

The DBCA is a Java based tool that you can use to create or remove Oracle Databases. Fortunately for us, it can also be used to create or remove ASM instances too. You can create the ASM instance at any time, regardless if a database already exists or not. To create the ASM instance with the DBCA do the following:

  1. Start the Oracle DBCA.
  2. The DBCA will present a list of options to you (see the sample screen) to choose from. Select Configure Automatic Storage Management and click Next.


  3. The DBCA will then prompt you for the SYS password for the new ASM instance to be created. Enter the passwords as seen in this screen output:


  4. Oracle will then create the ASM instance. A new window will appear giving you the option to create new disk groups. You can choose to create disk groups (we will cover that shortly) or you can click on finish to complete the ASM instillation.

  5. The name of the resulting instance will be +ASM. You can log into the ASM instance from SQL*Plus as seen in this example:

    C:\Documents and Settings\Robert>Set ORACLE_SID=+ASM
    C:\Documents and Settings\Robert>Sqlplus sys/Robert as sysdba
    
    SQL*Plus: Release 10.1.0.3.0 - Production on Thu Jan 25 20:52:45 2007
    Copyright (c) 1982, 2004, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Production
    With the Partitioning, OLAP and Data Mining options
    
    SQL> select instance_name from v$instance;
    INSTANCE_NAME
    ----------------
    +asm

Manual Creation of the ASM Instance

Manual creation of an ASM instance is fairly straightforward. To manually create an ASM instance, follow these steps:

  1. Create the admin directories for the instance, Note that the instance name must always be +ASM. As with a normal Oracle instance, the ASM instance will require the standard admin directory setup. In the following examples, we assume that you have defined the ORACLE_BASE parameter. We also follow OFA standards with the naming of our administration directories.

    The commands would be as follows:

    UNIX

    mkdir -p $ORACLE_BASE/admin/+ASM/bdump
    mkdir -p $ORACLE_BASE/admin/+ASM/cdump
    mkdir -p $ORACLE_BASE/admin/+ASM/hdump
    mkdir -p $ORACLE_BASE/admin/+ASM/pfile
    mkdir -p $ORACLE_BASE/admin/+ASM/udump

    Microsoft Windows

    mkdir %ORACLE_BASE%\admin\+ASM\bdump
    mkdir %ORACLE_BASE%\admin\+ASM\cdump
    mkdir %ORACLE_BASE%\admin\+ASM\hdump
    mkdir %ORACLE_BASE%\admin\+ASM\pfile
    mkdir %ORACLE_BASE%\admin\+ASM\udump

    You could use a tool, like Windows Explorer, to create the directories.

  2. Create the instance parameter file.

    The ASM instance will require a parameter file, just as any other Oracle instances does. The number of parameters that you will need to set for an ASM instance is relativity small, so the parameter file typically is smaller than that of a normal Oracle database. You will also find that some parameters that you will set are unique to ASM. Let's look at a sample UNIX parameter file and then a sample WINDOWS parameter file. Then we will discuss ASM specific parameters and what they are for:

    ##############################################
    # ASM Parameter File - UNIX
    ##############################################
    # Optional parameters you may or may not need
    ##############################################
    # _asm_allow_only_raw_disks=false
    # ASM_DISKGROUPs='TESTDB_DATA1'
    # asm_power_limit=1
    ##############################################
    # Default ASM_DISKSTRING values for supported platforms:
    #     Solaris (32/64 bit)   /dev/rdsk/*
    #     Windows NT/XP         \\.\orcldisk*
    #     Linux (32/64 bit)     /dev/raw/*
    #     HPUX                  /dev/rdsk/*
    #     HPUX(Tru 64)          /dev/rdisk/*
    #     AIX                   /dev/rhdisk/*
    # ASM_DISKSTRING=''
    
    ###########################################
    # Diagnostics and Statistics
    ###########################################
    background_dump_dest=/u01/app/oracle/admin/+ASM/bdump
    core_dump_dest=/u01/app/oracle/admin/+ASM/cdump
    user_dump_dest=/u01/app/oracle/admin/+ASM/udump
    
    ###########################################
    # Miscellaneous
    # Of course – set compatible to your version of Oracle
    ###########################################
    instance_type=asm
    compatible=10.1.0.4.0
    
    ###########################################
    # Pools
    ###########################################
    large_pool_size=12M
    
    ###########################################
    # Security and Auditing
    ###########################################
    remote_login_passwordfile=exclusive

    And for windows the parameter file isn't much different:

    ##############################################
    # ASM Parameter File - UNIX
    ##############################################
    # Optional parameters you may or may not need
    ##############################################
    # _asm_allow_only_raw_disks=false
    # ASM_DISKGROUPs='TESTDB_DATA1'
    # asm_power_limit=1
    ##############################################
    # ASM_DISKSTRING=''
    ###########################################
    # Diagnostics and Statistics
    ###########################################
    background_dump_dest=C:\oracle\product\10.1.0\admin\+ASM\bdump
    core_dump_dest=C:\oracle\product\10.1.0\admin\+ASM\cdump
    user_dump_dest=C:\oracle\product\10.1.0\admin\+ASM\udump
    
    ###########################################
    # Miscellaneous
    # Of course – set compatible to your version of Oracle
    ###########################################
    instance_type=asm
    compatible=10.1.0.4.0
    
    ###########################################
    # Pools
    ###########################################
    large_pool_size=12M
    
    ###########################################
    # Security and Auditing
    ###########################################
    remote_login_passwordfile=exclusive

    Note in these examples that there are parameters that are specific to ASM . These include:

    • INSTANCE_TYPE: Used only with an ASM instance, this parameter indicated to Oracle that this is an ASM instance. The default value is RDBMS which indicates the instance is an Oracle database instance. This parameter is not dynamic.
       
    • ASM_DISKSTRING: This parameter indicates where Oracle should search of disk devices to be used by ASM. We will discuss this parameter in more detail later in this section. This parameter can be dynamically changed.
       
    • ASM_DISKGROUPS: This parameter lists ASM disk groups that ASM should mount when it is started. You can also use the alter diskgroup all mount command to cause these disk groups to be mounted. This parameter can be dynamically changed.
       
    • ASM_POWER_LIMIT: This parameter controls the rate at which ASM can rebalance disks. Lower values will slow rebalancing but will also result in less of an IO impact by those operations. Higher values will speed up rebalancing. The default is 1, and this is typically sufficient. This parameter can be set dynamically.
       
    • ASM_ALLOW_ONLY_RAW_DISKS: A hidden parameter (and thus, we do not recommend using it) that allows you to restrict ASM to only raw disk devices. Since hidden parameters are not officially supported by Oracle, and there is no assurance that they will remain in the next version of the database product, it is a good idea not to use this parameter unless Oracle support tells you too.

    Note that we did not include any of the memory settings (e.g. SHARED_POOL_SIZE or DB_CACHE_SIZE) in this parameter file. While ASM does allocate memory, the default settings for the memory parameters are often quite enough, so you will rarely see any memory parameters used in an ASM parameter file. Rarely will you see an ASM instance consume more than about 100MB, and some 60MB is probably more the norm.

  3. If you are running Windows, you will need to create a Windows service using the oradim utility.

  4. If you are running in a Windows environment, you will need to create the ASM service with the oradim utility. Here is an example of this operation:

    C:Oracle\> oradim -new -asmsid +ASM -syspwd my_password
        -pfile C:\oracle\product\10.2.0\admin\+ASM\pfile\init.ora -spfile
        -startmode manual -shutmode immediate

    Note in this example that we made the startmode manual, so the service will not start automatically when the system is started. You will want to configure the service startup as required by your system.

  5. You are now ready to start the Oracle ASM instance. Note that until you have added a disk group that you will get an error when the ASM instance is started. This is expected:

    C:\oracle\product\10.2.0\DB01\BIN>set ORACLE_SID=rob10gr2
    C:\oracle\product\10.2.0\DB01\BIN>Sqlplus sys/Robert as sysdba
    SQL*Plus: Release 10.2.0.1.0 - Production on Fri Jan 26 22:28:57 2007
    Copyright (c) 1982, 2005, Oracle.  All rights reserved.
    Connected to an idle instance.
    
    SQL> startup
    ASM instance started
    
    Total System Global Area   83886080 bytes
    Fixed Size                  1247420 bytes
    Variable Size              57472836 bytes
    ASM Cache                  25165824 bytes
    ORA-15110: no diskgroups mounted

    This will look pretty much the same in UNIX, except for the use of UNIX forward slashes rather than DOS backslashes.

    Don't worry about the ORA-15110 error at this time, it's expected.

  6. Having started the ASM instance, create the instance SPFILE from the PFILE created earlier in step 2. Here is an example:

    create spfile from pfile='/u01/opt/oracle/admin/+ASM/pfile/init.ora';