Table of Contents
This chapter describes how to manage a TAS disk space.
Disk space properties can be set when creating or modifying a disk space. When creating a disk space, the AU_SIZE property is set. For more information about the allocation unit and extents, refer to "Allocation Unit" and "Extents" of “Chapter 1. TAS Overview”. For information about how to configure AU_SIZE in a disk space, refer to [Example 3.1].
This section describes how to create a disk space.
The following devices can be used in a disk space.
A disk space can be created using the CREATE DISKSPACE SQL statement.
Consider the following when creating a disk space. For more information, refer to “1.2.3. Mirroring and Failure Groups”.
Redundancy level
To use the TAS mirroring function, configure the redundancy level.
Failure group definition
A failure group can be configured. If a failure group is configured, then copies are created in separate failure groups during mirroring. If a failure group is not configured, then each disk becomes a failure group. If a failure group is divided, operation is not interrupted even when a problem occurs in the group.
Disk space properties
Configures properties such as the allocation unit size.
TAS automatically recognizes the size of each disk device. If the size of the disk device cannot be automatically recognized or if the usage size of the disk device is limited, then use the SIZE clause in the disk when creating a disk space. To name a disk, use the NAME clause.
... '/devs/disk101' NAME disk101 SIZE 1TB, ...
The disk size and name can be checked by using the V$AS_DISK view.
The following is an example of creating a disk space named ds0 with a redundancy level of NORMAL and failure groups of fg1 and g2. Set the AS_DISKSTRING initialization parameter to '/devs/disk*', and use the disk spaces that are found as a TAS disk.
[Example 3.1] Creating Disk Space ds0
CREATE DISKSPACE ds0 NORMAL REDUNDANCY FAILGROUP fg1 DISK '/devs/disk101' NAME disk101, '/devs/disk102' NAME disk102, '/devs/disk103' NAME disk103, '/devs/disk104' NAME disk104 FAILGROUP fg2 DISK '/devs/disk201' NAME disk201, '/devs/disk202' NAME disk202, '/devs/disk203' NAME disk203, '/devs/disk204' NAME disk204 ATTRIBUTE 'AU_SIZE'='4M';
In the above example, the NAME clause was used to specify a name for each disk. If disk names are not specified, then a default name in the "{Disk Space Name}_####" format is given; "####" is the disk name in the disk space. In the example, AU_SIZE is set to 4MB. To check the allocation unit size that is configured when creating a disk space, use the V$AS_DISKSPACE view.
A disk space can be configured by using the ALTER DISKSPACE statement. A disk can be added or removed from a disk space during operation, and disk space rebalancing can be performed. When a disk is added or removed, the changes are not applied immediately to the disk space. This is because the data in the existing disks must be evenly redistributed to the new disks when disks are added, and if a disk is removed, the data of the removed disk must be redistributed to the remaining disks to prevent data loss. This process of evenly redistributing data in a disk space is called rebalancing. Adding or removing a disk is applied in a disk space through disk space rebalancing.
A disk can be added in a disk space by using the ADD clause of the ALTER DISKSPACE statement. Disk related clauses and the failure groups used in the CREATE DISKSPACE statement are used in the ADD clause.
The following example shows a SQL statement that adds a disk to disk space ds0. New disk devices '/devs/disk105' and '/devs/disk106' are added to the failure group fg1 of disk space ds0. A disk was added by using the REBALANCE clause, rebalancing the disk space.
[Example 3.2] Adding a Disk in Disk Space ds0
ALTER DISKSPACE ds0 ADD FAILGROUP fg1 DISK '/devs/disk105' NAME disk105, '/devs/disk106' NAME disk106 REBALANCE;
A disk can be removed from a disk space by using the DROP clause of the ALTER DISKSPACE statement.
The following example shows a SQL statement that removes disks "disk105" and "disk 106" from disk space ds0.
[Example 3.3] Removing a Disk from Disk Space ds0
ALTER DISKSPACE ds0 DROP DISK disk105; ALTER DISKSPACE ds0 DROP DISK disk106;
When a disk is in the FAIL state due to disk failure, the disk can be removed using the FORCE option.
The following example shows a SQL statement that removes a disk in the 'FAIL' state.
[Example 3.4] Removing a disk in the 'FAIL' state from Disk Space ds0
ALTER DISKSPACE ds0 DROP DISK disk105 FORCE;
All disks in a failure group can be removed.
The following example shows a SQL statement that removes all disks from the failure group fg1 of disk space ds0.
[Example 3.5] Removing Disks of Failure Group fg1 in Disk Space ds0
ALTER DISKSPACE ds0 DROP DISKS IN FAILGROUP fg1;
A disk can be added or removed through a single SQL statement.
In the following example, disk "disk204" is removed from disk space ds0, and disk device '/devs/disk205' is added in the failure group fg2 of disk space ds0.
[Example 3.6] Adding or Removing a Disk in Disk Space ds0
ALTER DISKSPACE ds0 DROP DISK disk204 ADD FAILGROUP fg2 DISK '/devs/disk205' NAME disk205;
The prepared states of a disk for add, drop, and force drop can be undone by using the UNPREPARE clause of the ALTER DISKSPACE statement.
The PREPARE_DROP, PREPARE_FORCE, and PREPARE_ADD states are restored back to the ONLINE, FAIL, and UNUSED states, respectively. The PREPARE states indicate that the rebalance command has not been executed on the disk yet. After executing the command, the state cannot be undone by using the UNPREPARE clause.
The following example restores the state of disk105 in ds0 from PREPARE_DROP to ONLINE.
[Example 3.7] Restoring disk105 State from PREPARE_DROP to ONLINE
ALTER DISKSPACE ds0 UNPREPARE DISK disk105;
Rebalancing can be performed manually in a case such as when it has not been performed when adding or removing a disk.
The following example shows a SQL statement that rebalances the disk space ds0.
The following example shows how to use the WAIT option to wait until rebalancing is complete.
Using the REBALANCE clause with the FORCE option forcibly performs rebalancing even if there is no disk to add or remove. If the option is used, rebalancing performance decreases because the volume of extents to move increases.
To check if rebalancing is complete, retrieve the disk state from the V$AS_DISK view. Rebalancing jobs in progress can be checked from the V$AS_OPERATION view.
Files in a disk space can be deleted by using the DROP clause of the ALTER DISKSPACE statement.
The following example shows a SQL statement that deletes the file '+DS0/file000.dtf' from the disk space ds0.
[Example 3.10] Deleting a File from Disk Space ds0
ALTER DISKSPACE ds0 DROP FILE '+DS0/file000.dtf';
Multiple files can be deleted from a disk space at one time by listing multiple file names. Each file name must be separated by a comma (,).
The following example shows a SQL statement that deletes multiple files at once from disk space ds0. In this example, the files '+DS0/file000.dtf' and '+DS0/file001.dtf' are deleted from the disk space ds0.
[Example 3.11] Deleting Multiple Files from Disk Space ds0
ALTER DISKSPACE ds0 DROP FILE '+DS0/file000.dtf', '+DS0/file001.dtf';