ITPub博客

首页 > Linux操作系统 > Linux操作系统 > dd模拟asm磁盘容灾测试

dd模拟asm磁盘容灾测试

原创 Linux操作系统 作者:oracle_mao 时间:2012-06-26 17:33:56 0 删除 编辑

环境:

操作机器:192.168.96.139

GRID版本:11R2    DB版本:11R1

思路:

首先创建新磁盘组TEST_ZKF,磁盘组里包括2块磁盘disk138disk141,且状态为member。选另外2块磁盘disk139disk140作为候选盘(本实验中先讲disk139disk140从磁盘组里drop,然后再用dd命令讲磁盘头内容清空,随后磁盘的状态就变为CANDIDATE

步骤:

1、         disk138disk139disk140disk141从磁盘组DATA_ZKF磁盘组里drop

SQL>alter diskgroup data_zkf drop disk DATA_ZKF_0009;

SQL>alter diskgroup data_zkf drop disk DATA_ZKF_0010;

SQL>alter diskgroup data_zkf drop disk DATA_ZKF_0011;

SQL>alter diskgroup data_zkf drop disk DATA_ZKF_0012;

备注:DATA_ZKF_0009为磁盘在磁盘组里的名字,可以从v$asm_disk中得到。

2、         创建新磁盘组TEST_ZKF

SQL>create diskgroup TEST_ZKF external redundancy disk ‘/dev/rdisk/disk138’;

SQL>alter diskgroup TEST_ZKF add disk ‘/dev/rdisk/disk141’;

3、         在磁盘组里创建表空间以及表

SQL>create tablespace mao ‘+TEST_ZKF’;

SQL>create table t(id int) tablespace mao;

4、         关闭DB,关闭ASM

SQL>conn / as sysasm

SQL>shutdown abort

5、         disk141disk139上的内容清空

dd if=/dev/zero f=disk141 bs=1k

dd  if=/dev/zero  of=disk139  bs=1k count=1

此时可以再重启asm,然后查看两块磁盘的状态就变为CANDIDATE

6、         dddisk138磁盘上的内容复制到disk139上,将disk141的内容复制到disk140上。

dd  if=/dev/disk138   of=/dev/disk139 bs=644000k

dd  if=/dev/disk141   of=/dev/disk140 bs=644000k

7、         disk138disk141清空

dd if=/dev/zero f=/dev/rdisk/disk138 bs=1k count=1

dd if=/dev/zero f=/dev/rdisk/disk141  bs=1k count=1

8、         asm重启,查看各个磁盘状态

SQL> select name,path,header_status from v$asm_disk;

 

NAME                           PATH                           HEADER_STATU

------------------------------ ------------------------------ ------------

                                     /dev/rdisk/disk138             CANDIDATE

                                      /dev/rdisk/disk141             CANDIDATE

OCR_ZKF_0000                   /dev/rdisk/disk127             MEMBER

REDO_ZKF_0000                  /dev/rdisk/disk128             MEMBER

DATA_ZKF_0000                  /dev/rdisk/disk129             MEMBER

DATA_ZKF_0001                  /dev/rdisk/disk130             MEMBER

DATA_ZKF_0002                  /dev/rdisk/disk131             MEMBER

DATA_ZKF_0003                  /dev/rdisk/disk132             MEMBER

DATA_ZKF_0004                  /dev/rdisk/disk133             MEMBER

DATA_ZKF_0005                  /dev/rdisk/disk134             MEMBER

DATA_ZKF_0006                  /dev/rdisk/disk135             MEMBER

 

NAME                           PATH                           HEADER_STATU

------------------------------ ------------------------------ ------------

DATA_ZKF_0007                  /dev/rdisk/disk136             MEMBER

DATA_ZKF_0008                  /dev/rdisk/disk137             MEMBER

TEST_ZKF_0000                  /dev/rdisk/disk139             MEMBER

TEST_ZKF_0001                  /dev/rdisk/disk140             MEMBER

 

15 rows selected.

可以再查看下表的信息,这里不再赘述。

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24500180/viewspace-733879/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 无题
请登录后发表评论 登录
全部评论

注册时间:2011-03-28

  • 博文量
    94
  • 访问量
    754023