Oracle ASM Operation Management

Source: Internet
Author: User

View the ASM disk status

SQL> select group_number, disk_number, mount_status, header_status, mode_status, state, failgroup, total_mb, free_mb, name, path from v $ asm_disk;

View the situation of the ASM disk group
SQL> select group_number, block_size, name, allocation_unit_size, state, type, total_mb, free_mb, offline_disks from v $ asm_diskgroup;

Create an ASM Disk

[Root @ b1 redhat 5.4-64] #

[Root @ b1 redhat 5.4-64] #

[Root @ b1 redhat 5.4-64] #
Device "/dev/sdb" is not marked as an ASM disk
Device "/dev/sdb1" is marked an ASM disk with the label "DISK1"
Device "/dev/sdb2" is marked an ASM disk with the label "DISK2"

[Root @ b1 redhat 5.4-64] #
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[Root @ b1 redhat 5.4-64] #
DISK1
DISK2

 

Delete An ASM Disk

[Root @ b1 ~] #
Clearing disk header: done

Create an ASM disk group

A. Create an outsourced redundant disk group

B. Create a common redundant disk group (at least two disks)

Create diskgroup dg1 normal redundancy failgroup fg1 disk 'ORCL: disk3 'failgroup fg2 disk' ORCL: disk4 ';

C. Create a high-redundancy disk group (at least three disks)

Create diskgroup dg1 high redundancy
Failgroup fg1 disk 'ORCL: disk3 'name dg1_a
Failgroup fg2 disk 'ORCL: disk4 'name dg1_ B
Failgroup fg3 disk 'ORCL: disk5 'name dg1_c;

Delete An ASM disk group

Drop diskgroup dg1;

Drop diskgroup dg1 including contents;

 

Add a disk to the ASM disk group

A. Add disk members to a high-redundancy disk group

Alter diskgroup dg1
Add failgroup fg1 disk 'orcl: disk1'
Add failgroup fg2 disk 'orcl: diskd2'
Add failgroup fg3 disk 'orcl: diskd3 ';

B. Add disk members to an external redundant disk group.

Alter diskgroup dg2 add disk 'orcl: diske2 ';

 

Delete a disk from the ASM disk group

Alter diskgroup dg1 drop disk diskd1, diskd2, diskd3;

Alter diskgroup dg2 drop disk diske2 add disk 'orcl: diske3 ';

Delete a fault group (delete all disks in the fault group)

Alter diskgroup dg1 drop disks in failgroup fg3;

Add fault group

Alter diskgroup dg1 add failgroup fg3 disk 'orcl: disk5 ';

Add a fault group when deleting a disk

Alter diskgroup dg1 drop disks in failgroup fg3 add failgroup fg4 disk 'orcl: disk6 ';

Stop deleting a disk from a disk group'

Balance Disk Data

Alter diskgroup dg1 rebalance;

Alter diskgroup dg1 rebalance wait;

Alter diskgroup dg1 rebalance power 11;

Stop balancing Disk Data

Alter diskgroup dg1 rebalance power 0;

 

Attach and detach a disk group

Alter diskgroup dg1 mount;

Alter diskgroup dg1 dismount;

Alter diskgroup dg1 dismount force;

Reset disk size

Alter diskgroup dg1 resize all size 512 M; -- set ALL disks in dg1 to 512 M

Alter diskgroup dg1 RESIZE disk diskd4 SIZE 564 M;

Check disk group consistency

Alter diskgroup dg1 check all;

Alter diskgroup dg1 check all repair;

SQL> alter diskgroup DG2 add directory '+ DG2/datafile ';

Rename a directory

SQL> alter diskgroup DG2 rename directory '+ DG2/datafile' to '+ DG2/datafiles ';

Delete directory

SQL> alter diskgroup DG2 drop directory '+ DG2/datafiles ';

 

ASM alias Management

Add an alias to the asm file
SQL> alter diskgroup data add alias '+ data/c1/datafile/system01.dbf' for '+ data/c1/datafile/SYSTEM.260.803945885 ';
Diskgroup altered.
Modify the alias of the asm file
Alter diskgroup data rename alias '+ data/c1/datafile/system01.dbf' to '+ data/c1/datafile/system02.dbf ';

Delete an alias for an asm file

Alter diskgroup DG1 drop alias '+ data/c1/datafile/system02.dbf ';

 

ASM template Management

View the redundancy level and striping of the default asm Template

Select * from v $ asm_template;

View the template to use

Select name, redundancy, striped
From v $ asm_alias a, v $ asm_file B
Where a. file_number = B. file_number
And a. group_number = B. group_number
Order by a. file_number;

Syntax for creating an asm Template

Alter diskgroup disk_group_name add template template_name
ATTRIBUTES ([{MIRROR | HIGH | UNPROTECTED}] [{FINE | COARSE}]);

Create Template

Alter diskgroup dg1 add template template1 attributes (high fine );

Alter diskgroup dg1 add template template2 attributes (unprotected coarse );

Modify template

Alter diskgroup dg1 alter template template1 attributes (coarse );

Delete Template

Alter diskgroup dg1 drop template template1;

Use Template

Create tablespace test datafile '+ DG1 (template1) 'size 50 M;

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.