博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
oracle存储%3e,oracle 11g 使用ASM存储迁移
阅读量:6486 次
发布时间:2019-06-23

本文共 7971 字,大约阅读时间需要 26 分钟。

一、环境描述

rhel 6.6 + Oracle 11.2.0.4

存储更换,需要添加新盘,替换掉旧的存储盘,以下为测试步骤。

二、测试过程

[root@roidb1 ~]# cd /etc/udev

[root@roidb1 udev]# ls

makedev.d rules.d udev.conf

[root@roidb1 udev]# cd rules.d/

[root@roidb1 rules.d]# ls

55-usm.rules 60-pcmcia.rules 70-persistent-net.rules 98-kexec.rules

60-fprint-autosuspend.rules 60-raw.rules 90-alsa.rules 99-oracle-asmdevices.rules

60-openct.rules 70-persistent-cd.rules 90-hal.rules

[root@roidb1 rules.d]# cat 99-oracle-asmdevices.rules

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB134477b8-eb4c906a",

NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB02fff4da-d0a0c3a3",

NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBdfa1c4b9-379f6810",

NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB47ca97bf-4f2e68c0",

NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"

[root@roidb1 rules.d]#

[root@roidb1 rules.d]#

##添加一块新盘

[root@roidb1 rules.d]# scsi_id --whitelisted --replace-whitespace --device=/dev/sdf

1ATA_VBOX_HARDDISK_VBf00cea14-af091329

[root@roidb1 rules.d]#

[root@roidb1 rules.d]#

[root@roidb1 rules.d]#

[root@roidb1 rules.d]# ls

55-usm.rules 60-pcmcia.rules 70-persistent-net.rules 98-kexec.rules

60-fprint-autosuspend.rules 60-raw.rules 90-alsa.rules 99-oracle-asmdevices.rules

60-openct.rules 70-persistent-cd.rules 90-hal.rules

##修改配置文件

[root@roidb1 rules.d]# vi 99-oracle-asmdevices.rules

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1AT

A_VBOX_HARDDISK_VB134477b8-eb4c906a", NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"    Â

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1AT

A_VBOX_HARDDISK_VB02fff4da-d0a0c3a3", NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"    Â

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1AT

A_VBOX_HARDDISK_VBdfa1c4b9-379f6810", NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"    Â

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1AT

A_VBOX_HARDDISK_VB47ca97bf-4f2e68c0", NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"    Â

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1AT

A_VBOX_HARDDISK_VBf00cea14-af091329", NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"  Â Â

~

##传输到节点2~

scp 99-oracle-asmdevices.rules 到rac2

[root@roidb1 rules.d]# cat 99-oracle-asmdevices.rules

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB134477b8-eb4c906a",

NAME="asm-diskb", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB02fff4da-d0a0c3a3",

NAME="asm-diskc", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBdfa1c4b9-379f6810",

NAME="asm-diskd", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VB47ca97bf-4f2e68c0",

NAME="asm-diske", OWNER="grid", GROUP="asmadmin", MODE="0660"

KERNEL=="sd*", BUS=="scsi", PROGRAM=="/sbin/scsi_id --whitelisted --replace-whitespace --device=/dev/$name", RESULT=="1ATA_VBOX_HARDDISK_VBf00cea14-af091329",

NAME="asm-diskf", OWNER="grid", GROUP="asmadmin", MODE="0660"

[root@roidb1 rules.d]#

[root@roidb1 rules.d]#

[root@roidb1 rules.d]#

##重启udev服务,加载配置文件

[root@roidb1 rules.d]# start_udev

Starting udev: udevd[5477]: GOTO 'pulseaudio_check_usb' has no matching label in: '/lib/udev/rules.d/90-pulseaudio.rules'

##生产/dev/asm-diskf [ OK ]

[root@roidb1 rules.d]# ls -l /dev/asm*

brw-rw---- 1 grid asmadmin 8, 16 Jan 30 19:36 /dev/asm-diskb

brw-rw---- 1 grid asmadmin 8, 32 Jan 30 19:36 /dev/asm-diskc

brw-rw---- 1 grid asmadmin 8, 48 Jan 30 19:36 /dev/asm-diskd

brw-rw---- 1 grid asmadmin 8, 64 Jan 30 19:36 /dev/asm-diske

brw-rw---- 1 grid asmadmin 8, 80 Jan 30 19:36 /dev/asm-diskf

/dev/asm:

total 0

##查看asm磁盘

SQL> col name for a40

SQL> set line 200

SQL> select name,path,state,HEADER_STATUS from v$asm_disk;

NAME PATH STATE HEADER_STATUS

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

/dev/asm-diskf NORMAL CANDIDATE --要添加的磁盘

CRSDG_0002 /dev/asm-diskd NORMAL MEMBER

CRSDG_0000 /dev/asm-diskb NORMAL MEMBER

DATADG_0000 /dev/asm-diske NORMAL MEMBER

CRSDG_0001 /dev/asm-diskc NORMAL MEMBER

##使用sysasm添加磁盘

alter diskgroup datadg add disk '/dev/asm-diskf' ;

##加快平衡速度,power=0就是停止rebalance操作,不建议使用11

alter diskgroup datadg rebalance power 11;

SQL> alter diskgroup datadg rebalance power 11;

Diskgroup altered.

SQL> select * from v$asm_operation;

GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE

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

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

2 REBAL RUN 11 11 22 22 0 0

SQL>

##继续查看磁盘状态,已添加完成

col name for a15

col path for a15

col state for a10

set line 200

select MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;

SQL> col name for a15

SQL> col path for a15

SQL> col state for a10

SQL> set line 200

SQL> select MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;

MODE_STATUS HEADER_STATUS MODE_STATUS STATE TOTAL_MB FREE_MB NAME PATH

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

ONLINE MEMBER ONLINE NORMAL 4096 3787 CRSDG_0002 /dev/asm-diske

ONLINE MEMBER ONLINE NORMAL 4096 3788 CRSDG_0001 /dev/asm-diskd

ONLINE MEMBER ONLINE NORMAL 6144 3977 DATADG_0000 /dev/asm-diskb

ONLINE MEMBER ONLINE NORMAL 4096 3787 CRSDG_0000 /dev/asm-diskc

ONLINE MEMBER ONLINE NORMAL 8192 5306 DATADG_0001 /dev/asm-diskf

SQL>

##删除磁盘

alter diskgroup datadg drop disk 'DATADG_0000'; --按照name来删除

alter diskgroup datadg rebalance power 11;

col error_code for a5

set line 200

select * from v$asm_operation;

##查看平衡速度

SQL> col error_code for a5

SQL> set line 200

SQL> select * from v$asm_operation;

GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR

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

2 REBAL RUN 11 11 47 768 2334 0

SQL>

SQL> col name for a15

SQL> col path for a15

SQL> col state for a10

SQL> set line 200

SQL> select MODE_STATUS,HEADER_STATUS, MODE_STATUS,state,TOTAL_MB,FREE_MB,name,PATH from v$asm_disk;

MODE_STATUS HEADER_STATUS MODE_STATUS STATE TOTAL_MB FREE_MB NAME PATH

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

ONLINE FORMER ONLINE NORMAL 0 0 /dev/asm-diske ##已删除

ONLINE MEMBER ONLINE NORMAL 4096 3788 CRSDG_0001 /dev/asm-diskc

ONLINE MEMBER ONLINE NORMAL 4096 3787 CRSDG_0000 /dev/asm-diskb

ONLINE MEMBER ONLINE NORMAL 8192 3095 DATADG_0001 /dev/asm-diskf

ONLINE MEMBER ONLINE NORMAL 4096 3787 CRSDG_0002 /dev/asm-diskd

SQL>

转载地址:http://qmnuo.baihongyu.com/

你可能感兴趣的文章
浏览器的兼容性问题
查看>>
我的友情链接
查看>>
今天真的搬走了
查看>>
PC散热风扇之研究一:风扇种类介绍
查看>>
关于Session和Cookie简单实例
查看>>
App框架实现———dagger2
查看>>
zabbix 微信报警
查看>>
rsync命令参数及SSH自定义端口远程拷贝
查看>>
通过SQL Server 2008数据库复制实现数据库同步备份
查看>>
HttpClient做接口测试时自定义参数长度
查看>>
PyCharm2017激活方法
查看>>
正则表达式
查看>>
Exchange企业实战技巧(27)邮件中使用数字签名和邮件加密功能
查看>>
mysql-5.6.27源码安装及错误解决办法
查看>>
Shell 函数、数组与正则表达式
查看>>
编译安装PHP时两个报错的解决办法
查看>>
System Center 2012 SP1 Data Protection Manager 防止重复备份数据
查看>>
软考复习之路——软考总结
查看>>
Kali linux 2016.2(Rolling)里Metasploit的常用模块
查看>>
企业项目开发--企业中的项目架构以及多环境分配(1)
查看>>