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-4 provides a summary of the Oracle ASM instance management commands.
Table 12-4 Summary of ASMCMD instance management commands
| Command | Description |
|---|---|
|
Retrieves the discovery diskstring value that is used by the Oracle ASM instance and its clients. |
|
|
Sets the disk discovery diskstring value that is used by the Oracle ASM instance and its clients. |
|
|
Lists information about current Oracle ASM clients. |
|
|
Lists the current operations on a disk group or Oracle ASM instance. |
|
|
Lists the users from an Oracle ASM password file. |
|
|
Adds, drops, or changes an Oracle ASM password user. |
|
|
Shuts down an Oracle ASM instance. |
|
|
Backs up an Oracle ASM SPFILE. |
|
|
Copies an Oracle ASM SPFILE. |
|
|
Retrieves the location of the Oracle ASM SPFILE. |
|
|
Moves an Oracle ASM SPFILE. |
|
|
Sets the location of the Oracle ASM SPFILE. |
|
|
Starts up an Oracle ASM instance. |
Retrieves the discovery diskstring value that is used by the Oracle ASM instance and its clients.
dsget [ --normal | --parameter | --profile [-f] ]
The syntax options for the dsget command are described in Table 12-5.
Table 12-5 Options for the dsget command
| Option | Description |
|---|---|
|
|
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. |
|
|
Retrieves the |
|
|
Retrieves the discovery string from the GPnP profile. If |
The following example uses dsget to retrieve the current discovery diskstring value from the GPnP profile and the ASM_DISKSTRING parameter.
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.
dsset [ --normal | --parameter | --profile [-f] ] diskstring
The syntax options for the dsset command are described in Table 12-6.
Table 12-6 Options for the dsset command
| Option | Description |
|---|---|
|
|
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. |
|
|
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. |
|
|
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 |
|
|
Specifies the value for the discovery diskstring. |
For information about disk discovery and the discovery diskstring, see "Oracle ASM Disk Discovery".
The following example uses dsset to set the current value of the discovery diskstring in the GPnP profile.
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.
lsct [--suppressheader] [-g] [diskgroup]
Table 12-7 lists the options for the lsct command.
Table 12-7 Options for the lsct command
| Option | Description |
|---|---|
|
(none) |
Displays information about current clients from the |
|
|
Selects from the |
|
|
Suppresses column headings. |
|
|
Specifies the disk group. |
If diskgroup is specified, then only information about that disk group is listed.
The following example displays information about the clients that are accessing the data disk group.
Lists the current operations on a disk group in an Oracle ASM instance.
lsoplsop displays information from the V$ASM_OPERATION view.
The following are examples of the lsop command. The examples list operations on the disk groups of the current Oracle ASM instance.
List the users from the local Oracle ASM password file.
lspwusr [--suppressheader]Table 12-8 lists the options for the lspwusr command.
Table 12-8 Options for the lspwusr command
| Option | Description |
|---|---|
|
|
Suppresses column headers from the output. |
The following is an example of the lspwusr example. The example lists the current users in the local Oracle ASM password file.
Add, drop, or modify an Oracle ASM password file user.
orapwusr { { { --add | --modify [--password] }--privilege {sysasm|sysdba|sysoper} ] } | --delete } userTable 12-9 lists the options for the orapwusr command.
Table 12-9 Options for the orapwusr command
| Option | Description |
|---|---|
|
|
Adds a user to the password file. Also prompts for a password. |
|
|
Changes a user in the password file. |
|
|
Prompts for and then changes the password of a user. |
|
|
Sets the role for the user. The options are |
|
|
Drops a user from the password file. |
|
|
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.
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.
Shuts down an Oracle ASM instance.
shutdown [--normal | --abort|--immediate ]Table 12-10 lists the options for the shutdown command.
Table 12-10 Options for the shutdown command
| Option | Description |
|---|---|
|
|
Shut down normal. |
|
|
Shut down aborting all existing operations. |
|
|
Shut down immediately. |
The default action is a normal shutdown if an option is not specified.
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".
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.
Backs ups an Oracle ASM SPFILE to a backup file.
spbackup source destinationTable 12-11 lists the options for the spbackup command.
Table 12-11 Options for the spbackup command
| Option | Description |
|---|---|
|
|
Specifies the source file name. |
|
|
Specifies the destination file. |
spbackup should be used when you want to make single or multiple backups of an SPFILE in the same or a different disk group without creating an SPFILE in the target disk group.
Note the following about the use of spbackup:
spbackup can back up an Oracle ASM SPFILE from a disk group to a disk group or to an operating system file.
spbackup can back up an Oracle ASM SPFILE from an operating system file to a disk group.
spbackup can back up an Oracle ASM SPFILE when the SPFILE is being used by an open Oracle ASM instance.
spbackup can make multiple backups of an Oracle ASM SPFILE in the same disk group.
spbackup does not affect the GPnP profile. The backup file that is created is not a special file type and is not identified as an SPFILE. This backup file cannot be copied with spcopy. To copy this backup file to and from a disk group, use the ASMCMD cp command.
To make a copy of a backup file in a disk group that is identified as an SPFILE file:
Use the ASMCMD cp command to copy the backup file from the disk group to an operating system file. See "cp".
Use the ASMCMD spcopy command to copy the operating system file to a disk group. See "spcopy".
The following are examples of the spbackup command. The first example backs up the SPFILE in the data disk group. The second example backs up the SPFILE from the data disk group to the fra disk group.
Copies an Oracle ASM SPFILE from the source location to an SPFILE in the destination location.
spcopy [-u] source destinationTable 12-12 lists the options for the spcopy command.
Table 12-12 Options for the spcopy command
| Option | Description |
|---|---|
|
|
Updates the Grid Plug and Play (GPnP) profile. |
|
|
Specifies the source file name. |
|
|
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.
spcopy can copy an Oracle ASM SPFILE when the SPFILE is being used by an open Oracle ASM instance.
spcopy cannot make multiple copies of an Oracle ASM SPFILE in the same disk group. You can use spbackup for that purpose.
To update the GPnP profile, include the -u option with spcopy. You can also use spset to update the GPnP profile if spcopy is run without the -u option. 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 and updating the GPnP profile, 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 copy an Oracle ASM SPFILE into a disk group using spcopy, the COMPATIBLE.ASM attribute must be set to 11.2 or greater in the target disk group.
See Also:
TheCREATE SPFILE SQL statement in the Oracle Database SQL Language Reference for information about creating a server parameter fileThe following are examples of the spcopy command. The first example copies the Oracle ASM SPFILE from the data disk group to the fra disk group. The second example copies the Oracle ASM SPFILE from the data disk group to an operating system location. The third example copies an Oracle ASM SPFILE from an operating system location to the data disk group and updates the GPnP profile with the -u option.
Example 12-14 Using the ASMCMD spcopy command
ASMCMD> spcopy +DATA/asm/asmparameterfile/registry.253.721810181
+FRA/spfileCopyASM.ora
ASMCMD> spcopy +DATA/asm/asmparameterfile/registry.253.721810181
$ORACLE_HOME/dbs/spfileCopyASM.ora
ASMCMD> spcopy -u /u01/oracle/product/11.2.0/grid/dbs/spfileTestASM.ora
+DATA/ASM/spfileCopyASM.ora
Retrieves the location of the Oracle ASM SPFILE from the Grid Plug and Play (GPnP) profile.
spgetThe 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 Oracle ASM SPFILE currently being used.
The following is an example of the spget command that retrieves and displays the location of the SPFILE from the GPnP profile.
Moves an Oracle ASM SPFILE from source to destination and automatically updates the GPnP profile.
spmove source destinationTable 12-13 lists the options for the spmove command.
Table 12-13 Options for the spmove command
| Option | Description |
|---|---|
|
|
Specifies the source file. |
|
|
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.
The following are examples of the spmove command. The first example moves an Oracle ASM SPFILE from the data disk group to an operating system location. The second example moves an SPFILE from an operating system location to the data disk group.
Sets the location of the Oracle ASM SPFILE in the Grid Plug and Play (GPnP) profile.
spset locationTable 12-14 lists the options for the spset command.
Table 12-14 Options for the spset command
| Option | Description |
|---|---|
|
|
Specifies the location of the Oracle ASM SPFILE. The location is the full path to the SPFILE. |
The following is an example of the spset command that sets the location of the Oracle ASM SPFILE command in the data disk group.
Starts up an Oracle ASM instance.
startup [--nomount] [--restrict] [ --pfile pfile ]Table 12-15 lists the options for the startup command.
Table 12-15 Options for the startup command
| Option | Description |
|---|---|
|
|
Specifies no mount operation. |
|
|
Specifies restricted mode. |
|
|
Oracle ASM initialization parameter file. |
The default action is a startup that mounts disk groups and enables Oracle ASM Dynamic Volume Manager (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".
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.