ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [原]ASM删除/增加磁盘

[原]ASM删除/增加磁盘

原创 Linux操作系统 作者:wk773717271 时间:2012-06-16 06:59:04 0 删除 编辑
1.进入asm环境
[oracle@rac1 ~]$ export ORACLE_SID=+ASM1
[oracle@rac1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Wed Jan 5 14:22:46 2011
Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

2.查看当前的状态
SQL> select group_number, name, total_mb, free_mb, total_mb-free_mb used_mb from v$asm_disk_stat;
GROUP_NUMBER NAME                             TOTAL_MB    FREE_MB    USED_MB
------------ ------------------------------ ---------- ---------- ----------
           0                                      1019          0       1019
           0                                       101          0        101
           0                                       101          0        101
           1 DATA_0001                            1019        565        454
           1 DATA_0000                            3067       2129        938

SQL> select name, total_mb, free_mb from v$asm_disk_stat;
NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
                                     1019          0
                                      101          0
                                      101          0
DATA_0001                            1019        565
DATA_0000                            3067       2129

SQL> select * from v$asm_operation;
no rows selected

3.开始删除磁盘DATA_0001
SQL> alter diskgroup data drop disk DATA_0001;
Diskgroup altered.

4.磁盘做rebalance操作
SQL> set linesize 200;
SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- -----------
           1 REBAL RUN           1          1        167        456        414           0

SQL> select name, total_mb, free_mb from v$asm_disk_stat;
NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
                                     1019          0
                                      101          0
                                      101          0
DATA_0001                            1019        732
DATA_0000                            3067       1962

SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- -----------
           1 REBAL RUN           1          1        381        454        411           0

5.继续等待磁盘已经删除
SQL> select * from v$asm_operation;
no rows selected

SQL> select * from v$asm_operation;
no rows selected

SQL>  select name, total_mb, free_mb from v$asm_disk_stat;
NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
                                     1019          0
                                      101          0
                                      101          0
DATA_0000                            3067       1677

SQL> select path,group_number, disk_number,mount_status,header_status,mode_status,state from v$asm_disk;
PATH                                     GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE
---------------------------------------- ------------ ----------- ------- ------------ ------- --------
/dev/raw/raw5                                       0           0 CLOSED  FORMER       ONLINE  NORMAL
/dev/raw/raw3                                       0           1 CLOSED  CANDIDATE    ONLINE  NORMAL
/dev/raw/raw2                                       0           2 CLOSED  FOREIGN      ONLINE  NORMAL
/dev/raw/raw1                                       0           4 CLOSED  FOREIGN      ONLINE  NORMAL
/dev/raw/raw4                                       1           0 CACHED  MEMBER       ONLINE  NORMAL

6.增加一个asm磁盘
SQL> ALTER DISKGROUP DATA ADD DISK '/dev/raw/raw5';
Diskgroup altered.

SQL> select path,group_number, disk_number,mount_status,header_status,mode_status,state from v$asm_disk;
PATH                                     GROUP_NUMBER DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE
---------------------------------------- ------------ ----------- ------- ------------ ------- --------
/dev/raw/raw3                                       0           1 CLOSED  CANDIDATE    ONLINE  NORMAL
/dev/raw/raw2                                       0           2 CLOSED  FOREIGN      ONLINE  NORMAL
/dev/raw/raw1                                       0           4 CLOSED  FOREIGN      ONLINE  NORMAL
/dev/raw/raw5                                       1           1 CACHED  MEMBER       ONLINE  NORMAL
/dev/raw/raw4                                       1           0 CACHED  MEMBER       ONLINE  NORMAL

SQL> select * from v$asm_operation;
GROUP_NUMBER OPERA STAT      POWER     ACTUAL      SOFAR   EST_WORK   EST_RATE EST_MINUTES
------------ ----- ---- ---------- ---------- ---------- ---------- ---------- -----------
           1 REBAL RUN           1          1        181        350        501           0

SQL> select name, total_mb, free_mb from v$asm_disk_stat;
NAME                             TOTAL_MB    FREE_MB
------------------------------ ---------- ----------
                                     1019          0
                                      101          0
                                      101          0
DATA_0001                            1019        671
DATA_0000                            3067       2023

SQL> select * from v$asm_operation;
no rows selected.

 

备注参考:

ORA-15032 & ORA-15033

作者:scs2043 发表于2012-1-31 16:26:37 原文链接
阅读:39 评论:0 查看评论


Link URL: http://blog.csdn.net/scs2043/article/details/7222452

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25188158/viewspace-733010/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-05-25

  • 博文量
    34
  • 访问量
    42750