Escolar Documentos
Profissional Documentos
Cultura Documentos
INSTANCE_TYPE=ASM
export ORACLE_SID=+ASM
sqlplus / as sysdba
File created.
The ASM instance is now ready to use for creating and mounting disk groups. To shutdown the
ASM instance issue the following command.
SQL> shutdown
ASM instance shutdown
SQL>
Once an ASM instance is present disk groups can be used for the following parameters in
database instances ( INSTANCE_TYPE=RDBMS ) to allow ASM file creation:
DB_CREATE_FILE_DEST
DB_CREATE_ONLINE_LOG_DEST_n
DB_RECOVERY_FILE_DEST
CONTROL_FILES
LOG_ARCHIVE_DEST_n
LOG_ARCHIVE_DEST
STANDBY_ARCHIVE_DEST
Disks
Disk groups are created using the CREATE DISKGROUP statement. This statement allows you to
specify the level of redundancy:
NORMAL REDUNDANCY - Two-way mirroring, requiring two failure groups.
HIGH REDUNDANCY - Three-way mirroring, requiring three failure groups.
EXTERNAL REDUNDANCY - No mirroring for disks that are already protected using hardware
mirroring or RAID. If you have hardware RAID it should be used in preference to ASM
redundancy, so this will be the standard option for most installations.
In addition failure groups and preferred names for disks can be defined. If the NAME clause is
omitted the disks are given a system generated name like "disk_group_1_0001". The FORCE option
can be used to move a disk from another disk group into this one.
Disks can be added or removed from disk groups using the ALTER DISKGROUP statement.
Remember that the wildcard "*" can be used to reference disks so long as the resulting string does
not match a disk already used by an existing disk group.
-- Add disks.
ALTER DISKGROUP disk_group_1 ADD DISK
'/devices/disk*3',
'/devices/disk*4';
-- Drop a disk.
ALTER DISKGROUP disk_group_1 DROP DISK diska2;
Disks can be resized using the RESIZE clause of the ALTER DISKGROUP statement. The statement
can be used to resize individual disks, all disks in a failure group or all disks in the disk group. If
the SIZE clause is omitted the disks are resized to the size of the disk returned by the OS.
The UNDROP DISKS clause of the ALTER DISKGROUP statement allows pending disk drops to be
undone. It will not revert drops that have completed, or disk drops associated with the dropping of a
disk group.
Disk groups can be rebalanced manually using the REBALANCE clause of the ALTER
DISKGROUP statement. If the POWER clause is omitted the ASM_POWER_LIMIT parameter value is
used. Rebalancing is only needed when the speed of the automatic rebalancing is not appropriate.
Disk groups are mounted at ASM instance startup and unmounted at ASM instance shutdown.
Manual mounting and dismounting can be accomplished using the ALTER DISKGROUP statement as
seen below.
Templates
Templates are named groups of attributes that can be applied to the files within a disk group. The
following example show how templates can be created, altered and dropped.
-- Modify template.
ALTER DISKGROUP disk_group_1 ALTER TEMPLATE my_template ATTRIBUTES (COARSE);
-- Drop template.
ALTER DISKGROUP disk_group_1 DROP TEMPLATE my_template;
Directories
A directory heirarchy can be defined using the ALTER DISKGROUP statement to support ASM file
aliasing. The following examples show how ASM directories can be created, modified and deleted.
-- Create a directory.
ALTER DISKGROUP disk_group_1 ADD DIRECTORY '+disk_group_1/my_dir';
https://oracle-base.com/articles/10g/automatic-storage-management-10g 5/9
16/12/2017 ORACLE-BASE - Automatic Storage Management (ASM) in Oracle Database 10g
-- Rename a directory.
ALTER DISKGROUP disk_group_1 RENAME DIRECTORY '+disk_group_1/my_dir' TO '+disk_group_1/my_
Aliases
Aliases allow you to reference ASM files using user-friendly names, rather than the fully qualified
ASM filenames.
-- Rename an alias.
ALTER DISKGROUP disk_group_1 RENAME ALIAS '+disk_group_1/my_dir/my_file.dbf'
TO '+disk_group_1/my_dir/my_file2.dbf';
-- Delete an alias.
ALTER DISKGROUP disk_group_1 DELETE ALIAS '+disk_group_1/my_dir/my_file.dbf';
Files
Files are not deleted automatically if they are created using aliases, as they are not Oracle
Managed Files (OMF), or if a recovery is done to a point-in-time before the file was created. For
these circumstances it is necessary to manually delete the files, as shown below.
Checking Metadata
The internal consistency of disk group metadata can be checked in a number of ways using
the CHECK clause of the ALTER DISKGROUP statement.
https://oracle-base.com/articles/10g/automatic-storage-management-10g 6/9
16/12/2017 ORACLE-BASE - Automatic Storage Management (ASM) in Oracle Database 10g
ASM Views
The ASM configuration can be viewed using the V$ASM_% views, which often contain different
information depending on whether they are queried from the ASM instance, or a dependant
database instance.
V$ASM_ALIAS Displays a row for each alias present in every disk group mounted by the ASM instan
V$ASM_CLIENT Displays a row for each database instance using a disk group managed by the ASM
V$ASM_DISK Displays a row for each disk discovered by the ASM instance, including disks which
V$ASM_DISKGROUP Displays a row for each disk group discovered by the ASM instance.
V$ASM_FILE Displays a row for each file for each disk group mounted by the ASM instance.
V$ASM_OPERATION Displays a row for each file for each long running operation executing in the ASM ins
V$ASM_TEMPLATE Displays a row for each template present in each disk group mounted by the ASM in
ASM Filenames
There are several ways to reference ASM file. Some forms are used during creation and some for
referencing ASM files. The forms for file creation are incomplete, relying on ASM to create the fully
qualified name, which can be retrieved from the supporting views. The forms of the ASM filenames
are summarised below.
Restore the controlfile into the new location from the old location.
https://oracle-base.com/articles/10g/automatic-storage-management-10g 8/9
16/12/2017 ORACLE-BASE - Automatic Storage Management (ASM) in Oracle Database 10g
Create new redo logs in ASM and delete the old ones.
Enable change tracking if it was being used.
https://oracle-base.com/articles/10g/automatic-storage-management-10g 9/9