Oracle® Database Storage Administrator's Guide 11g Release 2 (11.2) Part Number E10500-02 |
|
|
View PDF |
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 |
---|---|
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. |
|
List the users from an Oracle ASM password file. |
|
Add, drop, or change 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. |
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 |
---|---|
|
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 discovery string from the GPnP profile. If |
|
Retrieves the |
Example
The following example uses dsget
to retrieve the current discovery diskstring value from the GPnP profile and the ASM_DISKSTRING
parameter.
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 |
---|---|
|
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 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 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 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.
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 |
|
Selects from the |
|
Suppresses column headings. |
|
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.
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.
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 |
---|---|
|
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.
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 |
---|---|
|
Adds a user to the password file. Also prompts for a password. |
|
Drops a user from the password file. |
|
Changes a user in the password file. |
|
Sets the role for the user. The options are |
|
Prompts for and then changes the password of a 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.
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 |
---|---|
|
Shut down aborting all existing operations. |
|
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.
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 |
---|---|
|
Specifies the source file name. |
|
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.
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 |
---|---|
|
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 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:
TheCREATE SPFILE
SQL statement in the Oracle Database SQL Language Reference for information about creating a server parameter filePurpose
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.
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 |
---|---|
|
Specifies the source file name. |
|
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.
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 |
---|---|
|
Specifies the disk group that is the location of the Oracle ASM SPFILE. |
|
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.
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 |
---|---|
|
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 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.