温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

ASM磁盘组如何删除DISK操作

发布时间:2021-10-26 14:17:09 来源:亿速云 阅读:133 作者:小新 栏目:建站服务器

这篇文章主要介绍ASM磁盘组如何删除DISK操作,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!

ASM接触了很长时间,从磁盘组中删除磁盘的操作还是第一次。

 

 

没想到这么简单的操作,由于不熟悉还碰到了两个小问题。

[oracle@dbserver1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 9 10:08:06 2011

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> set pages 100 lines 120
SQL> select group_number, name, state, type, total_mb, free_mb
  2 from v$asm_diskgroup;

GROUP_NUMBER NAME                           STATE       TYPE    TOTAL_MB    FREE_MB
------------ ------------------------------ ----------- ------ ---------- ----------
           1 DATA_AU1M                      CONNECTED   EXTERN   1953124       7430
           2 DATA_AU2M                      CONNECTED   EXTERN   1953124       7384
           3 DATA_AU4M                      CONNECTED   EXTERN   1953124       7304
           4 DATA                           CONNECTED   EXTERN   3906248    3898966

SQL> col path format a30
SQL> col name format a30
SQL> select disk_number, path, name, total_mb, free_mb
  2 from v$asm_disk
  3 where group_number = 4;

DISK_NUMBER PATH                     NAME                        TOTAL_MB    FREE_MB
----------- ------------------------- ------------------------- ---------- ----------
          1 /dev/asm-disk5            DATA_0001                    1953124    1949486
          0 /dev/asm-disk4            DATA_0000                    1953124    1949480

SQL> alter diskgroup data drop disk '/dev/asm-disk5';
alter diskgroup data drop disk '/dev/asm-disk5'
*
ERROR at line 1:
ORA-15000: command disallowed by current instance type

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

由于当前连接的是数据库,显然不能对ASM实例中的磁盘组进行操作,下面连接ASM实例:

[oracle@dbserver1 ~]$ su - grid
Password:
[grid@dbserver1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Tue Aug 9 10:12:39 2011

Copyright (c) 1982, 2010, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Automatic Storage Management option

SQL> set pages 100 lines 120
SQL> select instance_number, instance_name from v$instance;

INSTANCE_NUMBER INSTANCE_NAME
--------------- ----------------
              1 +ASM

SQL> alter diskgroup data drop disk '/dev/asm-disk5';
alter diskgroup data drop disk '/dev/asm-disk5'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15260: permission denied on ASM disk group


SQL> alter diskgroup data drop disk data_0001;
alter diskgroup data drop disk data_0001
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15260: permission denied on ASM disk group

开始看到这个错误还确实疑惑了一下,怎么可能没有权限。有在操作系统上检查了磁盘的权限,也没有任何问题。

检查Oracle文档的错误信息后发现,由于习惯了适用sysdba来处理,忽略了当前是11gASM,应该用sysasm来登录:

SQL> conn / as sysasm
Connected.
SQL> alter diskgroup data drop disk data_0001;

Diskgroup altered.

SQL> select disk_number, state, name, total_mb, free_mb from v$asm_disk where group_number = 4;

DISK_NUMBER STATE    NAME                             TOTAL_MB    FREE_MB
----------- -------- ------------------------------ ---------- ----------
          1 DROPPING DATA_0001                         1953124    1950842
          0 NORMAL   DATA_0000                         1953124   1948124

SQL> select disk_number, state, name, total_mb, free_mb from v$asm_disk where group_number = 4;

DISK_NUMBER STATE   NAME                            TOTAL_MB    FREE_MB
----------- -------- ------------------------------ ---------- ----------
          1 DROPPING DATA_0001                         1953124    1951434
          0 NORMAL   DATA_0000                         1953124    1947532

SQL> select disk_number, state, name, total_mb, free_mb from v$asm_disk where group_number = 4;

DISK_NUMBER STATE   NAME                            TOTAL_MB    FREE_MB
----------- -------- ------------------------------ ---------- ----------
          1 DROPPING DATA_0001                         1953124    1952556
          0 NORMAL   DATA_0000                         1953124    1946410

SQL> select disk_number, state, name, total_mb, free_mb from v$asm_disk where group_number = 4;

DISK_NUMBER STATE   NAME                            TOTAL_MB    FREE_MB
----------- -------- ------------------------------ ---------- ----------
          1 DROPPING DATA_0001                         1953124    1953096
          0 NORMAL   DATA_0000                         1953124    1945870

SQL> select disk_number, state, name, total_mb, free_mb from v$asm_disk where group_number = 4;

DISK_NUMBER STATE   NAME                            TOTAL_MB    FREE_MB
----------- -------- ------------------------------ ---------- ----------
          0 NORMAL   DATA_0000                         1953124    1945854

SQL> select group_number, disk_number, path, name, state, total_mb, free_mb     
  2 from v$asm_disk
  3 where path = '/dev/asm-disk5';

GROUP_NUMBER DISK_NUMBER PATH            NAME       STATE      TOTAL_MB    FREE_MB
------------ ----------- --------------- ---------- -------- ---------- ----------
           0           1 /dev/asm-disk5             NORMAL            0          0

可以看到,虽然删除操作执行完成,但是磁盘并没有真正被删掉,ASM在后台尝试将磁盘上的数据挪到其他可用磁盘中,这时磁盘的状态为DROPPING

当后台数据同步的操作完成,磁盘的组信息被清除,磁盘恢复STATE状态。这时这个磁盘就从ASM中被彻底删除。

以上是“ASM磁盘组如何删除DISK操作”这篇文章的所有内容,感谢各位的阅读!希望分享的内容对大家有帮助,更多相关知识,欢迎关注亿速云行业资讯频道!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI