文章详情

短信预约-IT技能 免费直播动态提醒

请输入下面的图形验证码

提交验证

短信预约提醒成功

oracle 11g 使用ASM存储迁移

2024-04-02 19:55

关注
一、环境描述
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> 
阅读原文内容投诉

免责声明:

① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。

② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341

软考中级精品资料免费领

  • 历年真题答案解析
  • 备考技巧名师总结
  • 高频考点精准押题
  • 2024年上半年信息系统项目管理师第二批次真题及答案解析(完整版)

    难度     813人已做
    查看
  • 【考后总结】2024年5月26日信息系统项目管理师第2批次考情分析

    难度     354人已做
    查看
  • 【考后总结】2024年5月25日信息系统项目管理师第1批次考情分析

    难度     318人已做
    查看
  • 2024年上半年软考高项第一、二批次真题考点汇总(完整版)

    难度     435人已做
    查看
  • 2024年上半年系统架构设计师考试综合知识真题

    难度     224人已做
    查看

相关文章

发现更多好内容

猜你喜欢

AI推送时光机
位置:首页-资讯-数据库
咦!没有更多了?去看看其它编程学习网 内容吧
首页课程
资料下载
问答资讯