You can manually rebalance the files in a disk group using the REBALANCE
clause of the ALTER DISKGROUP
statement. This would normally not be required, because Oracle ASM automatically rebalances disk groups when their configuration changes. You might want to do a manual rebalance operation to control the speed of what would otherwise be an automatic rebalance operation.
The POWER
clause of the ALTER
DISKGROUP
REBALANCE
statement specifies the degree of parallelism, and thus the speed of the rebalance operation. It can be set to a minimum value of 0 which halts a rebalancing operation until the statement is either implicitly or explicitly rerun. A higher value increases the speed of the rebalance operation.
The default rebalance power is set by the ASM_POWER_LIMIT
initialization parameter. The range of values for the POWER
clause is the same for the ASM_POWER_LIMIT
initialization parameter. For information about the ASM_POWER_LIMIT
initialization parameter, refer to "ASM_POWER_LIMIT".
The power level of an ongoing rebalance operation can be changed by entering the rebalance statement with a new level.
The ALTER DISKGROUP...REBALANCE
command by default returns immediately so that you can run other commands while the rebalance operation takes place asynchronously in the background. You can query the V$ASM_OPERATION
view for the status of the rebalance operation.
To cause the ALTER DISKGROUP...REBALANCE
command to wait until the rebalance operation is complete before returning, add the WAIT
keyword to the REBALANCE
clause. The wait functionality is especially useful in scripts. The command also accepts a NOWAIT
keyword, which invokes the default behavior of conducting the rebalance operation asynchronously. You can interrupt a rebalance running in wait mode by typing CTRL+C
on most platforms. This causes the command to return immediately with the message ORA-01013: user requested cancel of current operation
, and then continue the rebalance operation asynchronously.
Additional rules for the rebalance operation include the following:
An ongoing rebalance command is restarted if the storage configuration changes either when you alter the configuration, or if the configuration changes due to a failure or an outage. Furthermore, if the new rebalance fails because of a user error, then a manual rebalance may be required.
The ALTER DISKGROUP...REBALANCE
statement runs on a single node even if you are using Oracle Real Application Clusters (Oracle RAC).
Oracle ASM can perform one disk group rebalance at a time on a given instance. If you have initiated multiple rebalances on different disk groups on a single node, then Oracle processes these operations in parallel on additional nodes if available; otherwise the rebalances are performed serially on the single node. You can explicitly initiate rebalances on different disk groups on different nodes in parallel.
Rebalancing continues across a failure of the Oracle ASM instance performing the rebalance.
The REBALANCE
clause (with its associated POWER
and WAIT/NOWAIT
keywords) can also be used in ALTER DISKGROUP
commands that add, drop, or resize disks.
The following example manually rebalances the disk group data2
. The command does not return until the rebalance operation is complete.
For more information about rebalancing operations, refer to "Tuning Rebalance Operations".