当前位置:网站首页>ASM外部冗余是否可以替换磁盘
ASM外部冗余是否可以替换磁盘
2022-07-31 12:19:00 【文档搬运工】
RDBMS:11.2.0.4
当ASM的磁盘冗余为external的时候,是否可以换掉一块盘。
经过测试,是可以的。前提条件是,磁盘要有较大的空余空间,因为要把换掉的磁盘上的extent ,reblance到其他的盘上。
如果空间不够,可能会失败,这次进行的测试,所占用空间比较小,剩余空间比较大。测试成功。
参考文档:
https://docs.oracle.com/cd/E11882_01/server.112/e18951/asmdiskgrps.htm#OSTMG10071
To drop disks from a disk group, use the DROP DISK clause of the ALTER DISKGROUP statement. You can also drop all of the disks in specified failure groups using the DROP DISKS IN FAILGROUP clause.
When a disk is dropped, the disk group is rebalanced by moving all of the file extents from the dropped disk to other disks in the disk group. A drop disk operation might fail if not enough space is available on the other disks. The best approach is to perform both the add and drop operation with the same ALTER DISKGROUP statement. This has the benefit of rebalancing data extents only one time and ensuring that there is enough space for the rebalance operation to succeed.
-- 创建测试用的表空间test, 放在磁盘组+test上 ,创建用户test,默认的表空间是test 。创建表,数据存放在表空间test上。
[email protected]>create tablespace test datafile '+test' size 100M autoextend on;
Tablespace created.
[email protected]>create user test identified by oracle;
User created.
[email protected]>alter user test default tablespace test;
User altered.
[email protected]>grant dba to test;
Grant succeeded.
[email protected]>
[email protected]>conn test/oracle
Connected.
[email protected]>create table test as select * from dba_tables;
Table created.
[email protected]>
-- 通过dbms_rowid来查看表test中的数据,发现对应的file_id是7,查看file_id为7的数据文件,发现是存放在磁盘组+test上的
select rowid,
dbms_rowid.rowid_object(rowid) object_id,
dbms_rowid.rowid_relative_fno(rowid) file_id,
dbms_rowid.rowid_block_number(rowid) block_id,
dbms_rowid.rowid_row_number(rowid) num
from test;
ROWID OBJECT_ID FILE_ID BLOCK_ID NUM
------------------ ---------- ---------- ---------- ----------
AAAVt3AAHAAAADtAAC 88951 7 237 2
AAAVt3AAHAAAADtAAD 88951 7 237 3
AAAVt3AAHAAAADtAAE 88951 7 237 4
AAAVt3AAHAAAADtAAF 88951 7 237 5
AAAVt3AAHAAAADtAAG 88951 7 237 6
AAAVt3AAHAAAADtAAH 88951 7 237 7
AAAVt3AAHAAAADtAAI 88951 7 237 8
AAAVt3AAHAAAADtAAJ 88951 7 237 9
2879 rows selected.
[email protected]>
[email protected]>select file_name from dba_data_files where file_id = 7;
FILE_NAME
--------------------------------------------------------------------------------
+TEST/test/datafile/test.256.1111411155
[email protected]>
-- 查看磁盘组信息,test磁盘组是external冗余 ,两块盘,asm-test1和asm-test2 ,drop掉其中一块盘后,还剩余一块盘。数据正常,2879条。
[email protected]+ASM2>select group_number,name from v$asm_diskgroup;
GROUP_NUMBER NAME
------------ ------------------------------
1 DATA
2 OCR
3 TEST
[email protected]+ASM2>select group_number,name,type from v$asm_diskgroup;
GROUP_NUMBER NAME TYPE
------------ ------------------------------ ------
1 DATA EXTERN
2 OCR NORMAL
3 TEST EXTERN
[email protected]+ASM2>
[email protected]+ASM2>select path from v$asm_disk where GROUP_NUMBER = 3;
PATH
--------------------------------------------------------------------------------
/dev/asm-test1
/dev/asm-test2
[email protected]+ASM2>
[email protected]+ASM2>select name,path from v$asm_disk where GROUP_NUMBER = 3;
NAME PATH
-------------------- ----------------------------------------
TEST_0000 /dev/asm-test1
TEST_0001 /dev/asm-test2
[email protected]+ASM2>
alter diskgroup TEST drop disk 'TEST_0000';
[email protected]+ASM2>alter diskgroup TEST drop disk 'TEST_0000';
Diskgroup altered.
[email protected]+ASM2>select name,path from v$asm_disk where GROUP_NUMBER = 3;
NAME PATH
-------------------- ----------------------------------------
TEST_0001 /dev/asm-test2
[email protected]+ASM2>
[email protected]>select count(*) from test.test;
COUNT(*)
----------
2879
[email protected]>
[email protected]+ASM2>select name,path from v$asm_disk where GROUP_NUMBER = 3;
NAME PATH
-------------------- ----------------------------------------
TEST_0001 /dev/asm-test2
[email protected]+ASM2>
-- 再次将drop掉的磁盘添加上。
[email protected]+ASM2>ALTER DISKGROUP TEST ADD DISK '/dev/asm-test1' NAME TEST_0000;
Diskgroup altered.
[email protected]+ASM2>select * from V$ASM_OPERATION;
no rows selected
[email protected]+ASM2>select name,path from v$asm_disk where GROUP_NUMBER = 3;
NAME PATH
-------------------- ----------------------------------------
TEST_0000 /dev/asm-test1
TEST_0001 /dev/asm-test2
[email protected]+ASM2>
-- alrt log 中,可以看到reblance 。
SQL> alter diskgroup TEST drop disk 'TEST_0000'
NOTE: GroupBlock outside rolling migration privileged region
NOTE: requesting all-instance membership refresh for group=3
Sat Jul 30 14:47:47 2022
NOTE: membership refresh pending for group 3/0xfab86ef8 (TEST)
Sat Jul 30 14:47:50 2022
GMON querying group 3 at 16 for pid 18, osid 3765
SUCCESS: refreshed membership for 3/0xfab86ef8 (TEST)
SUCCESS: alter diskgroup TEST drop disk 'TEST_0000'
NOTE: starting rebalance of group 3/0xfab86ef8 (TEST) at power 1
Starting background process ARB0
Sat Jul 30 14:47:51 2022
ARB0 started with pid=34, OS id=15309
NOTE: assigning ARB0 to group 3/0xfab86ef8 (TEST) with 1 parallel I/O
cellip.ora not found.
NOTE: F1X0 copy 1 relocating from 0:2 to 1:80 for diskgroup 3 (TEST)
NOTE: Attempting voting file refresh on diskgroup TEST
NOTE: Refresh completed on diskgroup TEST. No voting file found.
NOTE: stopping process ARB0
SUCCESS: rebalance completed for group 3/0xfab86ef8 (TEST)
Sat Jul 30 14:47:57 2022
NOTE: GroupBlock outside rolling migration privileged region
NOTE: requesting all-instance membership refresh for group=3
GMON updating for reconfiguration, group 3 at 17 for pid 34, osid 15335
NOTE: group 3 PST updated.
SUCCESS: grp 3 disk TEST_0000 emptied
SUCCESS: ALTER DISKGROUP TEST ADD DISK '/dev/asm-test1' NAME TEST_0000
NOTE: starting rebalance of group 3/0xfab86ef8 (TEST) at power 1
Starting background process ARB0
Sat Jul 30 14:55:10 2022
ARB0 started with pid=35, OS id=16572
NOTE: assigning ARB0 to group 3/0xfab86ef8 (TEST) with 1 parallel I/O
cellip.ora not found.
NOTE: Attempting voting file refresh on diskgroup TEST
NOTE: Refresh completed on diskgroup TEST. No voting file found.
NOTE: stopping process ARB0
SUCCESS: rebalance completed for group 3/0xfab86ef8 (TEST)
Sat Jul 30 14:55:16 2022
NOTE: GroupBlock outside rolling migration privileged region
NOTE: requesting all-instance membership refresh for group=3
Sat Jul 30 14:55:19 2022
NOTE: membership refresh pending for group 3/0xfab86ef8 (TEST)
Sat Jul 30 14:55:22 2022
GMON querying group 3 at 37 for pid 18, osid 3765
SUCCESS: refreshed membership for 3/0xfab86ef8 (TEST)
NOTE: Attempting voting file refresh on diskgroup TEST
NOTE: Refresh completed on diskgroup TEST. No voting file found.
END
END
边栏推荐
猜你喜欢
Chrome开发自定义右键菜单实现快速跳转到指定页面
基于C51实现按键控制
Markdown编辑器语法
mysql根据多字段分组——group by带两个或多个参数
The 2nd activity of the TOGAF10 Standard Reading Club continues wonderfully, and the highlights will be reviewed!
Exploring Plain Vision Transformer Backbones for Object Detection Paper Reading Notes
分布式监视 Zabbix 和 Prometheus 到底怎么选?千万别用错了!
深度学习基本概念
2022年最新重庆建筑安全员模拟题库及答案
这款悄然崛起的国产API接口管理工具,你一定要晓得
随机推荐
DCM middleware family welcomes a new member
Standard SQL/JSON - the sobering part
AMBA APB学习记录(AMBA 2.0)
字符函数和字符串函数
Caused by: 类找不到: org.apache.flink.table.planner.delegation.ParserFactory或者ExecutorFactory
JVM 运行时数据区与JMM 内存模型详解
生信周刊第38期
imx6ull看门狗使用
file contains vulnerabilities
立方体IV(暑假每日一题 10)
三相PWM整流器预测直接功率控制
JVS轻应用的组成与配置
JS列表数据通过递归实现树形结构
三六零与公安部三所发布报告:关基设施保护成为网络安全博弈关键
Indoor real-time laser SLAM control method based on biological excitation neural network
PAT考试总结(考试心得)
基于生物激励神经网络的室内实时激光SLAM控制方法
Data Lake (19): SQL API reads Kafka data and writes it to Iceberg table in real time
Double non-one into bytes!!Pure dry goods sharing
ASM module in SAP Ecommerce Cloud Spartacus UI and Accelerator UI