Oracle 12c – Manage ASM instance

This article covers the basic management of an ASM instance for database storage.

 

Starting an ASM Instance

  1. You must set the ORACLE_SID variable to ASM SID.
  2. Default ASM SID is +ASM and for RAC is +ASM{node number}.
  3. The ORACLE_HOME variable must be set to Grid infrastructure home where Oracle ASM is installed.
  4. Initialization parameter file must contain text: INSTANCE_TYPE = ASM
  5. When you run STARTUP command, the ASM instance mounst the ASM disk groups.

 

ASM SQL*plus STARTUP command is options interpreted as:

  1. FORCE – Issues SHUTDOWN ABORT to ASM instance before restarting it.
  2. MOUNT or OPEN – Mounts the diskgroups in init parameter ASM_DISKGROUPS. This is the default.   An OPEN state for ASM instance really does not exist, if supplied it is treated as MOUNT.
  3. NOMOUNT – Starts ASM Instance without mounting diskgroups.
  4. RESTRICT – Starts up an instance in restricted mode. Have to have both CREATE SESSION and RESTRICTED SESSION privileges to connect.

 

SYSASM database and OSASM OS privileges gives storage permissions with granting high-level to database itself.  Users can be created in ASM instance and given SYSASM privilege.  OSASM system privilege does same at OS layer.

 

Example of creating a user with SYSASM to new user:

 

$ export ORACLE_SID = + ASM

$ sqlplus / as sysasm

 

CREATE USER asm_admin IDENTIFIED by badpassword_nobiscuit;

User created.

SQL > GRANT SYSASM TO asm_admin;

 

SQLPLUS /NOLOG

SQL > CONNECT asm_admin AS SYSASM

Enter password: badpassword_nobiscuit

Connected to an idle instance.

 

SQL > STARTUP

ASM instance started

Total System Global Area 71303168 bytes

Fixed Size 1069292 bytes

Variable Size 45068052 bytes

ASM Cache 25165824 bytes

ASM disk groups mounted

 

 

Shutting Down an Oracle ASM Instance.

  1. ASM instance uses the SQL*Plus shutdown command and you must set the ORACLE_SID variable to ASM SID.
  2. Before shutting down an ASM instance you should shutdown all databases using it, if not they will be shutdown with abort option upon ASM shutdown.
  3. Before shutting down an ASM instance you should dismount all Dynamic Volume Manager volumes.
  4. example of shutdown.

 

SQLPLUS /NOLOG

SQL>  CONNECT asm_user as sysasm

Enter password: *******

Connected.

SQL> SHUTDOWN NORMAL

 

 

SHUTDOWN Options in ASM:

  1. NORMAL – instance waits for all in-progress SQL to complete, dismounts disk groups and shuts down. Instance also waits for all currently connected users to disconnect from instance.  Any database instance connected, will cause the command to return an error and will not shutdown.   NORMAL is default shutdown.
  2. IMMEDIATE or TRANSACTIONAL – instance waits for all in-progress SQL to complete before dismounting all disk groups and shutting down ASM instance. It does not wait for current users to disconnect.  If any database instances are connected to ASM, will cause the command to return an error and will not shutdown.
  3. ABORT – ASM immediately shuts down without dismounting disk groups. This will cause recovery on next ASM startup.  All databases connected to ASM instance will also perform shutdown abort.

 

 

Larry Catt

OCP