当前位置:网站首页>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
边栏推荐
- Power BI----几个常用的分析方法和相适应的视觉对象
- Candence学习篇(11) allegro中设置规则,布局,走线,铺铜
- JVS低代码能力简介及功能清单
- Addition logic for SAP Commerce Cloud Product Review
- Encapsulation of conversion between Json and objects (Gson)
- 学习爬虫之Scrapy框架学习(1)---Scrapy框架初学习及豆瓣top250电影信息获取的实战!
- Docker practical experience: Deploy mysql8 master-slave replication on Docker
- Wearing detection and action recognition of protective gear based on pose estimation
- Caused by: 类找不到: org.apache.flink.table.planner.delegation.ParserFactory或者ExecutorFactory
- 立方体IV(暑假每日一题 10)
猜你喜欢
随机推荐
Docker practical experience: Deploy mysql8 master-slave replication on Docker
Use docker to build mysql master-slave
CWE4.8 -- The 25 most damaging software security issues in 2022
mysql根据多字段分组——group by带两个或多个参数
[core]-ARMV7-A、ARMV8-A、ARMV9-A 架构简介「建议收藏」
FIFO深度计算学习记录(汇总)
线性表的基本概念
Basic use of dosbox [easy to understand]
The item 'node.exe' was not recognized as the name of a cmdlet, function, script file, or runnable program.
Redis学习笔记-3.慢查询和其他高级数据结构
Comparison of ipv4 and ipv6 (IPV4)
认知—运动康复医疗机器人应用设计
VBA实现双击单元格自动输出对号再次双击取消对号
Acwing第 62 场周赛【未完结】
连续变量离散化教程
Banyan Tree Loan GPU Hardware Architecture
生信周刊第38期
深圳某游戏研发公司每个工位都装监控,网友:堪比“坐牢”!
手撕Verilog PWM呼吸灯
ESP8266-Arduino编程实例-HDC1008温度湿度传感器驱动









