Oracle 11.2.0.3 manages ASM instances

Source: Internet
Author: User

Currently, ASM instances are widely used in both rac and single-instance database environments. This article mainly introduces the management of ASM instances in Oracle 11.2.0.3, including the following:
1: view the status of the ASM disk and disk group
2: Create an external redundant disk group, add or delete a disk.
3: Create a normal redundancy disk group
4: failgroup test under normal redundancy
5. Delete the ASM disk group.
6. Meanings of initialization parameters of other asm instances

I. view the status of the ASM disk and disk group
SQL> select * from v $ asm_disk;
SQL> select * from v $ asm_diskgroup;

Ii. Create an external redundant disk group, add or delete a disk, and specify the disk name instead of path when deleting the disk.

  1. SQL> create diskgroup FRA external redundancy disk '/dev/asm-disk4 ';
  2. Diskgroup created.
  3. SQL> alter diskgroup fra add disk'/dev/asm-disk5 'rebalance power 10;
  4. Diskgroup altered.
  5. SQL> select name, failgroup, path from v $ asm_disk;
  6. NAME FAILGROUP PATH
  7. ------------------------------------------------------------
  8. DATA_0000 DATA_0000/dev/asm-disk1
  9. DATA_0001 DATA_0001/dev/asm-disk3
  10. DATA_0002 DATA_0002/dev/asm-disk2
  11. FRA_0000 FRA_0000/dev/asm-disk4
  12. FRA_0001 FRA_0001/dev/asm-disk5
  13. /Dev/asm-disk6
  14. /Dev/asm-disk7
  15. SQL> alter diskgroup fra drop disk '/dev/asm-disk4' rebalance power 10;
  16. Alter diskgroup fra drop disk '/dev/asm-disk4 'rebalance power 10
  17. *
  18. ERROR at line 1:
  19. ORA-15032: not all alterations saved med
  20. ORA-15054: disk "/DEV/ASM-DISK4" does not exist in diskgroup "FRA"
  21. SQL> alter diskgroup fra drop disk 'fra _ 0000 'rebalance power 10;
  22. Diskgroup altered.

3. Create a normal redundancy disk group

  1. SQL> conn/as sysasm
  2. Connected.
  3. SQL> create diskgroup fra normal redundancy
  4. Failgroup fg1 disk '/dev/asm-disk4', '/dev/asm-disk5'
  5. Failgroup fg2 disk '/dev/asm-disk6', '/dev/asm-disk7'
  6. Attribute 'compatible. rdbms '= '11. 2', 'compatible. asm' = '11. 2 ';
  7. Diskgroup created.
  8. SQL> select name, total_mb, free_mb, required_pai_free_mb, usable_file_mb from v $ asm_diskgroup;
  9. NAME TOTAL_MB FREE_MB required_assist_free_mb USABLE_FILE_MB
  10. -------------------------------------------------------------------
  11. DATA 61440 54873 0 18291
  12. FRA 81920 81592 20480 30556

4. failgroup test; FAILGROUP is used to group disks to ensure the loss of any group of FAILGROUP disks. The data is still complete. It is mostly used for multiple arrays and redundant environments through ASM!
1: View failgroup information and disk status in the FRA disk group

  1. SQL> select name, path, failgroup, mount_status from v $ asm_disk where group_number = 2;
  2. Name path failgroup MOUNT_STATUS
  3. -----------------------------------------------------------------------
  4. FRA_0003/dev/asm-disk7 FG2 CACHED
  5. FRA_0002/dev/asm-disk6 FG2 CACHED
  6. FRA_0000/dev/asm-disk4 FG1 CACHED
  7. FRA_0001/dev/asm-disk5 FG1 CACHED

2: Create a tablespace in an rdbms instance, create a table, insert data, and collect table statistics.

  1. SQL> create tablespace test01 datafile '+ fra ';
  2. Tablespace created.
  3. ASMCMD> pwd
  4. + Fra/db/datafile
  5. ASMCMD> ls
  6. TEST01.256.800622493
  7. SQL> create table t1 tablespace test01 as select * from dba_objects;
  8. Table created.
  9. SQL> exec dbms_stats.gather_table_stats ('sys ', 'T1 ');
  10. PL/SQL procedure successfully completed.
  11. SQL> select count (*) from t1;
  12. COUNT (*)
  13. ----------
  14. 74501

3. Delete udev rules, restart database instances and ASM instances, and verify whether data exists.

  1. SQL> conn/as sysasm
  2. Connected.
  3. SQL> alter diskgroup fra mount;
  4. Alter diskgroup fra mount
  5. *
  6. ERROR at line 1:
  7. ORA-15032: not all alterations saved med
  8. ORA-15040: diskgroup is incomplete.
  9. ORA-15042: ASM disk "1" is missing from group number "2"
  10. ORA-15042: ASM disk & quot; 0 & quot; is missing from group number & quot; 2 & quot"
  11. SQL> alter diskgroup fra mount force;
  12. Diskgroup altered.
  13. SQL> select name, path, failgroup, mount_status from v $ asm_disk;
  14. Name path failgroup MOUNT_STATUS
  15. -----------------------------------------------------------------------
  16. FRA_0000 FG1 MISSING
  17. FRA_0001 FG1 MISSING
  18. FRA_0002/dev/asm-disk6 FG2 CACHED
  19. FRA_0003/dev/asm-disk7 FG2 CACHED
  20. DATA_0000/dev/asm-disk1 DATA_0000 CACHED
  21. DATA_0002/dev/asm-disk2 DATA_0002 CACHED
  22. DATA_0001/dev/asm-disk3 DATA_0001 CACHED
  23. 7 rows selected.
  24. SQL> conn/as sysdba
  25. Connected.
  26. SQL> select count (*) from t1;
  27. COUNT (*)
  28. ----------
  29. 74501
  • 1
  • 2
  • Next Page

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.