Chinaunix首页 | 论坛 | 博客
  • 博客访问: 535116
  • 博文数量: 63
  • 博客积分: 1194
  • 博客等级: 中士
  • 技术积分: 761
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-24 12:44
个人简介

得之坦然,失之淡然,争其必然,顺其自然!

文章分类

全部博文(63)

文章存档

2014年(2)

2013年(22)

2012年(39)

分类: Oracle

2013-02-07 15:29:00

磁盘组操作,grid用户下:

sqlplus /nolog

SQL> conn / as sysasm
查询现有磁盘组及磁盘信息:

SQL> select group_number gno,name,state,type,total_mb,free_mb,required_mirror_free_mb rmfmb,usable_file_mb ufmb from v$asm_diskgroup;

       GNO NAME    STATE                  TYPE           TOTAL_MB    FREE_MB      RMFMB       UFMB
---------- ------------------------------ ------------ ---------- ---------- ---------- ----------
         1 DG1     MOUNTED                NORMAL             4076        575        879       -152
         2 DG2     MOUNTED                NORMAL             4076       3531        139       1696

SQL> 
SQL> col name format a10
SQL> col fgno format a20
SQL> select group_number gno,name,failgroup fgno,state,total_mb,free_mb,header_status from v$asm_disk;

       GNO NAME       FGNO                 STATE              TOTAL_MB    FREE_MB HEADER_STATUS
---------- ---------- -------------------- ---------------- ---------- ---------- ------------------------
         0                                 NORMAL                    0          0 PROVISIONED
         0                                 NORMAL                    0          0 PROVISIONED
         1 VOL1       VOL1                 NORMAL                 1019        141 MEMBER
         1 VOL2       VOL2                 NORMAL                 1019        144 MEMBER
         1 VOL3       VOL3                 NORMAL                 1019        140 MEMBER
         1 VOL4       VOL4                 NORMAL                 1019        150 MEMBER
         2 VOL5       VOL5                 NORMAL                 1019        880 MEMBER
         2 VOL6       VOL6                 NORMAL                 1019        883 MEMBER
         2 VOL7       VOL7                 NORMAL                 1019        885 MEMBER
         2 VOL8       VOL8                 NORMAL                 1019        883 MEMBER

10 rows selected.
--创建磁盘组

SQL> create diskgroup dg3 normal redundancy disk 'ORCL:VOL9','ORCL:VOL10';

Diskgroup created.

或:
SQL> create diskgroup dg3 normal redundancy disk 'ORCL:VOL9' disk 'ORCL:VOL10';

Diskgroup created.
--添加磁盘
SQL> alter diskgroup dg1 add disk 'ORCL:VOL9';


Diskgroup altered.
--删除磁盘
SQL> alter diskgroup dg1 drop disk VOL9;


Diskgroup altered.


SQL> select group_number gno,name,failgroup fgno,state,total_mb,free_mb,header_status from v$asm_disk;


       GNO NAME                           FGNO                 STATE              TOTAL_MB    FREE_MB HEADER_STATUS
---------- ------------------------------ -------------------- ---------------- ---------- ---------- ------------------------
         0                                                     NORMAL                    0          0 FORMER
         1 VOL1                           VOL1                 NORMAL                 1019        284 MEMBER
         1 VOL2                           VOL2                 NORMAL                 1019        286 MEMBER
         1 VOL3                           VOL3                 NORMAL                 1019        284 MEMBER
         1 VOL4                           VOL4                 NORMAL                 1019        287 MEMBER
         2 VOL5                           VOL5                 NORMAL                 1019        880 MEMBER
         2 VOL6                           VOL6                 NORMAL                 1019        883 MEMBER
         2 VOL7                           VOL7                 NORMAL                 1019        885 MEMBER
         2 VOL8                           VOL8                 NORMAL                 1019        883 MEMBER
         1 VOL9                           VOL9                 DROPPING               1019        451 MEMBER


10 rows selected.

--取消删除

alter diskgroup dg1 undrop disks;

--调整大小


ALTER DISKGROUP DG1 RESIZE DISK VOL4 SIZE 1024 M


--unmount和mount磁盘组


SQL> alter diskgroup dg3 dismount;


Diskgroup altered.


SQL> select group_number gno,name,state,type,total_mb,free_mb,required_mirror_free_mb rmfmb,usable_file_mb ufmb from v$asm_diskgroup;


       GNO NAME                           STATE                  TYPE                             TOTAL_MB    FREE_MB      RMFMB       UFMB
---------- ------------------------------ ---------------------- ------------------------------ ---------- ---------- ---------- ----------
         1 DG1                            MOUNTED                NORMAL                               4076        575        879       -152
         2 DG2                            MOUNTED                NORMAL                               4076       3531        139       1696
         0 DG3                            DISMOUNTED 
         
SQL> alter diskgroup dg3 mount;  


Diskgroup altered.


阅读(15141) | 评论(0) | 转发(1) |
给主人留下些什么吧!~~