当前位置:网站首页>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
边栏推荐
- 在 Excel 里使用 ODBC 读取 SAP BTP 平台上 CDS view 的数据
- A Week of Wonderful Content Sharing (Issue 14)
- 一周精彩内容分享(第14期)
- 认知—运动康复医疗机器人应用设计
- MySQL模糊查询性能优化
- 纷享销客罗旭对话元气森林黄晓枫:零售数字化的终点不是创新,而是数据
- ESP8266-Arduino编程实例-MCP9808数字温度传感器驱动
- The item 'node.exe' was not recognized as the name of a cmdlet, function, script file, or runnable program.
- B/S架构模式的一个整体执行流程
- JVS轻应用的组成与配置
猜你喜欢
busybox之reboot命令流程分析
Selenium自动化测试之Selenium IDE
Redis学习笔记-3.慢查询和其他高级数据结构
Different lower_case_table_names settings for server (‘1‘) and data dictionary (‘0‘) 解决方案
Is the working process of the belt you know the story - actionreducerstore
订song餐系统
Markdown编辑器语法
JVS低代码能力简介及功能清单
CWE4.8 -- 2022年危害最大的25种软件安全问题
通过斐波那契数再谈函数递归2.0
随机推荐
WPF中TabControl动态获取当前选中的TabItem
Addition logic for SAP Commerce Cloud Product Review
The 2nd activity of the TOGAF10 Standard Reading Club continues wonderfully, and the highlights will be reviewed!
The latest MySql installation teaching, very detailed
JVS开发套件产品定位
MySql模糊查询大全
ipv4和ipv6对比(IPV4)
Shengxin Weekly Issue 38
Docker practical experience: Deploy mysql8 master-slave replication on Docker
学习笔记 Golang 写入文件(io.WriteString、ioutil.WriteFile、file.Write、write.WriteString)
Quickly learn database management
栈和队列的基本概念
ESP8266-Arduino编程实例-HDC1008温度湿度传感器驱动
CWE4.8 -- 2022年危害最大的25种软件安全问题
这款悄然崛起的国产API接口管理工具,你一定要晓得
基于生物激励神经网络的室内实时激光SLAM控制方法
Double non-one into bytes!!Pure dry goods sharing
【OpenCV】-边缘检测汇总示例
VBA输出日志到工作簿demo
vb.net 画曲线