Skip Headers
Oracle® Database Storage Administrator's Guide
11g Release 2 (11.2)

Part Number E10500-02
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

ASMCMD Instance Management Commands

This section describes the ASMCMD Oracle ASM instance management commands.

Some commands in this section affect the Grid Plug and Play (GPnP) profile, which is a resource in a clustered configuration. In an Oracle Restart configuration, the profile is actually located in a resource attribute, not the Grid Plug and Play (GPnP) profile. However, the functionality of the commands is the same for both configurations.

Table 12-3 provides a summary of the Oracle ASM instance management commands.

Table 12-3 Summary of ASMCMD Instance Management Commands

Command Description

dsget

Retrieves the discovery diskstring value that is used by the Oracle ASM instance and its clients.

dsset

Sets the disk discovery diskstring value that is used by the Oracle ASM instance and its clients.

lsct

Lists information about current Oracle ASM clients.

lsop

Lists the current operations on a disk group or Oracle ASM instance.

lspwusr

List the users from an Oracle ASM password file.

orapwusr

Add, drop, or change an Oracle ASM password user.

shutdown

Shuts down an Oracle ASM instance.

spbackup

Backs up an Oracle ASM SPFILE.

spcopy

Copies an Oracle ASM SPFILE.

spget

Retrieves the location of the Oracle ASM SPFILE.

spmove

Moves an Oracle ASM SPFILE.

spset

Sets the location of the Oracle ASM SPFILE.

startup

Starts up an Oracle ASM instance.


dsget

Purpose

Retrieves the discovery diskstring value that is used by the Oracle ASM instance and its clients.

Syntax and Description

dsget [[--normal] [--profile [--force]] [--parameter]]

The syntax options for the dsget command are described in Table 12-4.

Table 12-4 Options for the dsget command

Option Description

--normal

Retrieves the discovery string from the Grid Plug and Play (GPnP) profile and the one that is set in the Oracle ASM instance. It returns one row each for the profile and parameter setting. This is the default setting.

--profile [--force]

Retrieves the discovery string from the GPnP profile.

If --force is specified, retrieves the discovery string from the local GPnP profile.

--parameter

Retrieves the ASM_DISKSTRING parameter setting of the Oracle ASM instance.


Example

The following example uses dsget to retrieve the current discovery diskstring value from the GPnP profile and the ASM_DISKSTRING parameter.

Example 12-4 Using dsget

ASMCMD [+] > dsget
profile: /devices/disk*
parameter: /devices/disk*

dsset

Purpose

Sets the discovery diskstring value that is used by the Oracle ASM instance and its clients.

The specified diskstring must be valid for existing mounted disk groups. The updated value takes effect immediately.

Syntax and Description

dsset [--normal] [--parameter] [--profile [--force]] diskstring

The syntax options for the dsset command are described in Table 12-5.

Table 12-5 Options for the dsset command

Option Description

--normal

Sets the discovery string in the Grid Plug and Play (GPnP) profile and in the Oracle ASM instance. The update occurs after the Oracle ASM instance has successfully validated that the specified discovery string has discovered all the necessary disk groups and voting files. This command fails if the instance is not using a server parameter file (SPFILE).

This is the default setting.

--profile [--force]

Specifies the discovery diskstring that is pushed to the GPnP profile without any validation by the Oracle ASM instance, ensuring that the instance can discover all the required disk groups. The update is guaranteed to be propagated to all the nodes that are part of the cluster.

If --force is specified, the specified diskstring is pushed to the local GPnP profile without any synchronization with other nodes in the cluster. This command option updates only the local profile file. This option should only be used for recovery. The command fails if the Oracle Clusterware stack is running.

--parameter

Specifies that the diskstring is updated in memory after validating that the discovery diskstring discovers all the current mounted disk groups and voting files. The diskstring is not persistently recorded in either the SPFILE or the GPnP profile.

diskstring

Specifies the value for the discovery diskstring.


For information about disk discovery and the discovery diskstring, see "Oracle ASM Disk Discovery".

Example

The following example uses dsset to set the current value of the discovery diskstring in the GPnP profile.

Example 12-5 Using dsset

ASMCMD [+] > dsset /devices/disk*

lsct

Purpose

Lists information about current Oracle ASM clients from the V$ASM_CLIENT view. A client, such as Oracle Database or Oracle ASM Dynamic Volume Manager (Oracle ADVM), uses disk groups that are managed by the Oracle ASM instance to which ASMCMD is currently connected.

Syntax and Description

lsct [-gH] [diskgroup]

Table 12-6 lists the options for the lsct command.

Table 12-6 Options for the lsct command

Option Description

(none)

Displays information about current clients from the V$ASM_CLIENT view.

-g

Selects from the GV$ASM_CLIENT view. GV$ASM_CLIENT.INST_ID is included in the output.

-H

Suppresses column headings.

diskgroup

Specifies the disk group.


If diskgroup is specified, then only information about that disk group is listed.

Example

The following example displays information about the clients that are accessing the data disk group.

Example 12-6 Using lsct

ASMCMD [+] > lsct data
DB_Name  Status    Software_Version Compatible_version  Instance_Name  Disk_Group
+ASM     CONNECTED       11.2.0.1.0         11.2.0.0.0  +ASM           DATA
asmvol   CONNECTED       11.2.0.1.0         11.2.0.0.0  +ASM           DATA
orcl     CONNECTED       11.2.0.1.0         11.2.0.0.0  orcl           DATA

lsop

Purpose

Lists the current operations on a disk group or Oracle ASM instance.

Syntax and Description


lsop

lsop displays information from the V$ASM_OPERATION view.

Example

The following are examples of the lsop command. The examples list operations on the disk groups of the current Oracle ASM instance.

Example 12-7 Using lsop

ASMCMD [+] > lsop
Group_Name  Dsk_Num  State  Power
DATA        REBAL    WAIT   2   

ASMCMD [+] > lsop
Group_Name  Dsk_Num  State  Power  
FRA         REBAL    REAP   3  

lspwusr

Purpose

List the users from the local Oracle ASM password file.

Syntax and Description


lspwusr [-H]

Table 12-7 lists the options for the lspwusr command.

Table 12-7 Options for the lspwusr Command

Option Description

-H

Suppresses column headers from the output.


Examples

The following is an example of the lspwusr example. The example lists the current current users in the local Oracle ASM password file.

Example 12-8 Using lspwusr

ASMCMD [+] > lspwusr
Username sysdba sysoper sysasm 
     SYS   TRUE    TRUE   TRUE 
 ASMSNMP   TRUE   FALSE  FALSE 

orapwusr

Purpose

Add, drop, or modify an Oracle ASM password file user.

Syntax and Description


orapwusr { { { --add | --modify [--password] }
[--privilege {sysasm|sysdba|sysoper} ] } | --delete } user

Table 12-8 lists the options for the orapwusr command.

Table 12-8 Options for the orapwusr Command

Option Description

--add

Adds a user to the password file. Also prompts for a password.

--delete

Drops a user from the password file.

--modify

Changes a user in the password file.

--privilege role

Sets the role for the user. The options are sysasm, sysdba, and sysoper.

--password

Prompts for and then changes the password of a user.

user

Name of the user to add, drop, or modify.


orapwusr attempts to update passwords on all nodes in a cluster. The command requires the SYSASM privilege to run. A user logged in as SYSDBA cannot change its password using this command.

Examples

The following is an example of the orapwusr command. This example adds the hruser to the Oracle ASM password file with the role of the user set to SYSDBA.

Example 12-9 Using orapwusr

ASMCMD [+] > orapwusr --add --privilege sysdba hruser

shutdown

Purpose

Shuts down an Oracle ASM instance.

Syntax and Description


shutdown [ --abort|--immediate ]

Table 12-9 lists the options for the shutdown command.

Table 12-9 Options for the shutdown command

Option Description

--abort

Shut down aborting all existing operations.

--immediate

Shut down immediately.


The default action is a normal shutdown.

Oracle strongly recommends that you shut down all database instances that use the Oracle ASM instance and dismount all file systems mounted on Oracle ASM Dynamic Volume Manager (Oracle ADVM) volumes before attempting to shut down the Oracle ASM instance with the abort (--abort) option.

For more information about shutting down an Oracle ASM instance, see "Shutting Down an Oracle ASM Instance".

Example

The following are examples of the shutdown command. The first example performs a shut down of the Oracle ASM instance with normal action. The second example performs a shut down with immediate action. The third example performs a shut down that aborts all existing operations.

Example 12-10 Using shutdown

ASMCMD [+] > shutdown

ASMCMD [+] > shutdown --immediate

ASMCMD [+] > shutdown --abort

spbackup

Purpose

Backs up an Oracle ASM SPFILE.

Syntax and Description


spbackup source destination

Table 12-10 lists the options for the spbackup command.

Table 12-10 Options for the spbackup command

Option Description

source

Specifies the source file name.

destination

Specifies the destination file.


spbackup does not affect the GPnP profile. The backup file that is created is not a special file type and is not identified as a SPFILE. This file cannot be copied with spcopy. To copy this backup file, use the ASMCMD cp command.

Example

The following are examples of the spbackup command. The first example backs up the Oracle ASM SPFILE from one operating system location to another. The second example backs up the SPFILE from an operating system location to the data/bakspfileASM.ora disk group.

Example 12-11 Using spbackup

ASMCMD> spbackup /u01/oracle/dbs/spfile+ASM.ora /u01/oracle/dbs/bakspfileASM.ora

ASMCMD> spbackup /u01/oracle/dbs/spfile+ASM.ora +DATA/bakspfileASM.ora

spcopy

Purpose

Copies an Oracle ASM SPFILE from source to destination.

Syntax and Description


spcopy [-u] source destination

Table 12-11 lists the options for the spcopy command.

Table 12-11 Options for the spcopy command

Option Description

-u

Updates the Grid Plug and Play (GPnP) profile.

source

Specifies the source file name.

destination

Specifies the destination.


Note the following about the use of spcopy:

  • spcopy can copy an Oracle ASM SPFILE from a disk group to a different disk group or to an operating system file.

  • spcopy can copy an Oracle ASM SPFILE from an operating system file to a disk group or to an operating system file.

  • spcopy can copy an Oracle ASM SPFILE when the SPFILE is being used by an open Oracle ASM instance.

Include the -u option to update the GPnP profile. You can also use spset to update the GPnP profile. See "spset". For information about copying and moving an Oracle ASM instance initialization parameter file after upgrading, see "Backing Up, Copying, and Moving an Oracle ASM Initialization Parameter File".

After copying the SPFILE, you must restart the instance with the SPFILE in the new location to use that SPFILE. When the Oracle ASM instance is running with the SPFILE in the new location, you can remove the source SPFILE.

To use spcopy to copy an Oracle ASM SPFILE into a disk group, the disk group attribute COMPATIBLE.ASM must be set to 11.2 or greater.

Example

The following are examples of the spcopy command. The first example copies the Oracle ASM SPFILE from one operating system location to another. The second example copies the SPFILE from an operating system location to the data disk group and updates the GPnP profile.

Example 12-12 Using spcopy

ASMCMD> spcopy /u01/oracle/dbs/spfile+ASM.ora /u01/oracle/dbs/testspfileASM.ora

ASMCMD> spcopy -u /u01/oracle/dbs/spfile+ASM.ora +DATA/testspfileASM.ora

See Also:

The CREATE SPFILE SQL statement in the Oracle Database SQL Language Reference for information about creating a server parameter file

spget

Purpose

Retrieves the location of the Oracle ASM SPFILE from the Grid Plug and Play (GPnP) profile.

Syntax and Description


spget

The location retrieved by spget is the location in the GPnP profile, but not always the location of the SPFILE currently used. For example, the location could have been recently updated by spset or spcopy with the -u option on an Oracle ASM instance that has not been restarted. After the next restart of the Oracle ASM, this location points to the ASM SPFILE currently being used.

Example

The following is an example of the spget command that retrieves and displays the location of the SPFILE from the GPnP profile.

Example 12-13 Using spget

ASMCMD [+] > spget
+DATA/asm/asmparameterfile/registry.253.691575633

spmove

Purpose

Moves an Oracle ASM SPFILE from source to destination and automatically updates the GPnP profile.

Syntax and Description


spmove source destination

Table 12-12 lists the options for the spmove command.

Table 12-12 Options for the spmove command

Option Description

source

Specifies the source file name.

destination

Specifies the destination file.


Note the following about the use of spmove:

  • spmove can move an Oracle ASM SPFILE when the open instance is using a PFILE or a different SPFILE. After moving the SPFILE, you must restart the instance with the SPFILE in the new location to use that SPFILE.

  • spmove cannot move an Oracle ASM SPFILE when the SPFILE is being used by an open Oracle ASM instance.

For information about copying and moving an Oracle ASM instance initialization parameter file after upgrading, see "Backing Up, Copying, and Moving an Oracle ASM Initialization Parameter File".

To use spmove to move an Oracle ASM SPFILE into a disk group, the disk group attribute COMPATIBLE.ASM must be set to 11.2 or greater.

Example

The following are examples of the spmove command. The first example moves the Oracle ASM SPFILE from one operating system location to another. The second example moves the SPFILE from an operating system location to the data disk group.

Example 12-14 Using spmove

ASMCMD> spmove /u01/oracle/dbs/spfile+ASM.ora /u01/oracle/dbs/testspfileASM.ora

ASMCMD> spmove /u01/oracle/dbs/spfile+ASM.ora +DATA/testspfileASM.ora

spset

Purpose

Sets the location of the Oracle ASM SPFILE in the Grid Plug and Play (GPnP) profile.

Syntax and Description


spset location

Table 12-13 lists the options for the spset command.

Table 12-13 Options for the spset command

Option Description

diskgroup

Specifies the disk group that is the location of the Oracle ASM SPFILE.

location

Specifies the location of the Oracle ASM SPFILE. The location is the path to an Oracle ASM SPFILE.


Example

The following is an example of the spset command that sets the location of the Oracle ASM SPFILE command in the data disk group.

Example 12-15 Using spset

ASMCMD> spset +DATA//asm/asmparameterfile/asmspfile.ora

startup

Purpose

Starts up an Oracle ASM instance.

Syntax and Description


startup [--nomount] [--restrict] [ --pfile pfile ]

Table 12-14 lists the options for the startup command.

Table 12-14 Options for the startup command

Option Description

--nomount

Specifies no mount operation.

--restrict

Specifies restricted mode.

--pfile pfile

Oracle ASM initialization parameter file.


The default action is a startup that mounts disk groups and enables Oracle ADVM volumes. For information about disk groups that are mounted at startup time, see "About Mounting Disk Groups at Startup".

For more information about starting up an Oracle ASM instance, see "Starting Up an Oracle ASM Instance".

Example

The following is an example of the startup command that starts the Oracle ASM instance without mounting disk groups and uses the asm_init.ora initialization parameter file.

Example 12-16 Using startup

ASMCMD> startup --nomount --pfile asm_init.ora