微前端架构如何改变企业的开发模式与效率提升
609
2022-10-07
Oracle ASM存储迁移
对于Linux使用MultiPath的设备,使用以下命令查看多路径聚合后的设备
multipath –llls -l /dev/mapper/*
使用以下命令,查看在统一设备管理下的dm_uuid设备标识号:
for i in votinghds1 votinghds2 votinghds3 asm_hdsdata1 asm_hdsdata2 asm_hdsarch1 asm_hdsarch2; doprintf "%s %s/n" "$i" "$(udevadm info --query=all --name=/dev/mapper/$i |grep -i dm_uuid)"; done在99-oracle-asmdevices.rules文件中加入以下内容KERNEL=="dm-*",SUBSYSTEM=="block",ENV{DM_UUID}=="mpath-36485702100cc1b0b002b63e600000000",SYMLINK+="votinghds1",OWNER="grid",GROUP="asmadmin",MODE="0660"
…保存并退出,重启udev服务。
start_udevStarting udev: [ OK ]ls -l /dev/dm*
1.5. 创建测试ASM磁盘组1.5.1. 登录asm实例以grid 用户执行
su - gridsqlplus / as sysasm
1.5.2. 查看有哪些可用的disk
set line 200 col PATH for a20col NAME for a20select NAME,PATH,OS_MB,TOTAL_MB,FREE_MB from v$asm_disk;NAME PATH OS_MB TOTAL_MB FREE_MB-------------------- -------------------- ---------- ---------- ---------- /dev/asm-data17 1048576 0 0 /dev/asm-data20 1048576 0 0 /dev/asm-data16 1048576 0 0 /dev/asm-data19 1048576 0 0 /dev/asm-data18 1048576 0 0
1.5.3. 创建测试磁盘组
create diskgroup hdsdata normal redundancyfailgroup fa1 disk '/dev/asm-hdsdata1','/dev/asm-hdsdata2','/dev/asm-hdsdata3','/dev/asm-hdsdata4','/dev/asm-hdsdata5'failgroup fa2 disk'/dev/asm-hdsdata6','/dev/asm-hdsdata7','/dev/asm-hdsdata8','/dev/asm-hdsdata9','/dev/asm-hdsdata10';create diskgroup hdsvote extenal redundancy disk '/dev/hdsvote1','/dev/hdsvote2','/dev/hdsvote3','/dev/hdsvote4','/dev/hdsvote5';
1.5.4. 挂载测试磁盘组
alter diskgroup hdsdata mount;alter diskgroup hdsvote mount;
1.5.5. 查看磁盘组情况
set line 200 col PATH for a20col NAME for a20select group_number,disk_number,NAME,PATH,OS_MB,TOTAL_MB,FREE_MB,failgroup,create_date from v$asm_disk;select group_number,name,TYPE,STATE,TOTAL_MB,REQUIRED_MIRROR_FREE_MB,FREE_MB,USABLE_FILE_MB,ALLOCATION_UNIT_SIZE,OFFLINE_DISKS fromV$asm_diskgroup;
1.6. 测试磁盘组稳定性1.6.1. 创建测试表空间和用户
su - oracle$ sqlplus "/as sysdba"SQL>create tablespace hds_test_tbs datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>alter tablespace hds_test_tbs add datafile '+HDSDATA' size 10240M autoextend on;SQL>create user hdsuser identified by hdsuser1234 default tablespace hds_test_tbs temporary tablespace temp;SQL>grant connect,resource,unlimited tablespace,select any dictionary to hdsuser;SQL>create tablespace hds_vote_tbs datafile '+HDSVOTE' size 10240M autoextend on;SQL>alter tablespace hds_vote_tbs add datafile '+HDSVOTE' size 10240M autoextend on;SQL>alter tablespace hds_vote_tbs add datafile '+HDSVOTE' size 10240M autoextend on;SQL>alter tablespace hds_vote_tbs add datafile '+HDSVOTE' size 10240M autoextend on;SQL>alter tablespace hds_vote_tbs add datafile '+HDSVOTE' size 10240M autoextend on;SQL>alter tablespace hds_vote_tbs add datafile '+HDSVOTE' size 10240M autoextend on;SQL>alter tablespace hds_vote_tbs add datafile '+HDSVOTE' size 10240M autoextend on;SQL>alter tablespace hds_vote_tbs add datafile '+HDSVOTE' size 10240M autoextend on;SQL>create user hdsvote identified by hdsvote1234 default tablespace hds_vote_tbs temporary tablespace temp;SQL>grant connect,resource,unlimited tablespace,select any dictionary to hdsvote;
1.6.2. 配置SWINGBENCH按照《SWINGBENCH安装及使用说明.docx》,在PC服务器上配置SWINGBENCH,并按TPC或OLAP测试样例,连接到用户hdsuser和hdsvote持续对数据库实例进行压力加载。但在测试过程中不应负载过大,建议不多于10并行用户。持续压力加载的时间不应该小于120小时。1.6.3. 测试目的测试的目的在于提前发现新接入的设备可能存在的问题。以尽可能防止磁盘设备的稳定性影响磁盘组Loadbalance和可能出现的故障。
正试迁移2.1. 删除测试用户和表空间
sqlplus "/as sysdba"SQL>drop user hdsuser cascade;SQL>drop user hdsvote cascade;SQL>drop tablespace hds_vote_tbs;SQL>drop tablespace hds_test_tbs;
2.2. 删除测试磁盘组
sqlplus "/as sysasm"SQL>drop diskgroup hdsdata;SQL>drop diskgroup hdsvote;
2.3. 迁移ocr磁盘组
SQL>select NAME,PATH,FAILGROUP,STATE from v$asm_disk where group_number=
2.4. 利用ASM磁盘组迁移数据为了减少磁盘组的平衡时间,建议将所有drop/add磁盘放在一个命令中执行,以下示例迁移数据磁盘组磁盘:
SQL>alter diskgroup datadg drop disk datadg_0001,datadg_0002,datadg_0003,datadg_0004,datadg_0005,datadg_0006,datadg_0007,datadg_0008add failgroup fa1 disk'/dev/asm-hdsdata1','/dev/asm-hdsdata2','/dev/asm-hdsdata3'failgroup fa1 disk'/dev/asm-hdsdata4','/dev/asm-hdsdata5','/dev/asm-hdsdata6' rebalance power 8;SQL> select * from v$asm_operation;
以下命令迁移归档磁盘组示例:
SQL>alter diskgroup archdg drop disk archdg_0001,archdg_0002,archdg_0003,archdg_0004add failgroup fa1 disk'/dev/asm-hdsdata7','/dev/asm-hdsdata8'failgroup fa1 disk'/dev/asm-hdsdata9','/dev/asm-hdsdata10' rebalance power 8;SQL> select * from v$asm_operation;
oracle
版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。
发表评论
暂时没有评论,来抢沙发吧~