关于裸设备数据的处理

如果用ASM管理数据库,将原来的数据库删除后,重新创建数据库,会出现如下报错:

CREATE DATABASE "devdb"
*
ERROR at line 1:
ORA-01501: CREATE DATABASE failed
ORA-00200: control file could not be created
ORA-00202: control file: '+DATA/devdb/control01.ctl'
ORA-17502: ksfdcre:4 Failed to create file +DATA/devdb/control01.ctl
ORA-15005: name "devdb/control01.ctl" is already used by an existing alias

说明以前的控制文件、数据文件,日志文件并没有删除,

如何将这些文件删除掉呢?

我的想法是,直接在裸设备上将数据清除,如下步骤去做:

1、使用DD命令,清除块设备数据:

[root@rac1 devdb]# dd if=/dev/zero f=/dev/sdc1
dd: 正在写入 ‘/dev/sdc1’: 设备上没有空间
读入了 6281353+0 个块
输出了 6281352+0 个块

等等。。。。将所有的块设备数据逐个清除。

清除后,需要重启一下操作系统,否则会出现很多麻烦:

我清除后,直接建库,而没有去重新启动操作系统,报如下错误:

 

CREATE DATABASE "devdb0"
*
ERROR at line 1:
ORA-01501: CREATE DATABASE failed
ORA-00200: control file could not be created
ORA-00202: control file: '+DATA/devdb0/control01.ctl'
ORA-17502: ksfdcre:4 Failed to create file +DATA/devdb0/control01.ctl
ORA-15130: diskgroup "DATA" is being dismounted
ORA-15066: offlining disk "DATA_0001" may result in a data loss

曾尝试过从底层重新启用裸设备的方法,使之生效,可是没有达到预期效果:

[root@rac1 devdb]# /etc/init.d/o2cb unload
Stopping O2CB cluster ocfs2: Failed
Unable to stop cluster as heartbeat region still active
[root@rac1 devdb]# /etc/init.d/o2cb unload
Stopping O2CB cluster ocfs2: Failed
Unable to stop cluster as heartbeat region still active
[root@rac1 devdb]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.

This will configure the on-boot properties of the Oracle ASM library
driver.  The following questions will determine whether the driver is
loaded on boot and what permissions it will have.  The current values
will be shown in brackets ('[]').  Hitting without typing an
answer will keep that current value.  Ctrl-C will abort.

Default user to own the driver interface [oracle]: oracle
Default group to own the driver interface [dba]: dba    
Start Oracle ASM library driver on boot (y/n) [y]: y
Fix permissions of Oracle ASM disks on boot (y/n) [y]: y
Writing Oracle ASM library driver configuration: [  OK  ]
Scanning system for ASM disks: [  OK  ]
[root@rac1 devdb]# /etc/init.d/oracleasm createdisk VOL1 /dev/sdc1
Marking disk "/dev/sdc1" as an ASM disk: [  OK  ]
[root@rac1 devdb]# /etc/init.d/oracleasm createdisk VOL2 /dev/sdd1
Marking disk "/dev/sdd1" as an ASM disk: [  OK  ]
[root@rac1 devdb]# /etc/init.d/oracleasm createdisk VOL3 /dev/sde1
Marking disk "/dev/sde1" as an ASM disk: [  OK  ]
[root@rac1 devdb]# /etc/init.d/oracleasm scandisks
Scanning system for ASM disks: [  OK  ]
[root@rac1 devdb]# /etc/init.d/oracleasm listdisks
VOL1
VOL2
VOL3
[root@rac1 devdb]# /etc/init.d/o2cb unload
Stopping O2CB cluster ocfs2: Failed
Unable to stop cluster as heartbeat region still active
[root@rac1 devdb]# /etc/init.d/o2cb status
Module "configfs": Loaded
Filesystem "configfs": Mounted
Module "ocfs2_nodemanager": Loaded
Module "ocfs2_dlm": Loaded
Module "ocfs2_dlmfs": Loaded
Filesystem "ocfs2_dlmfs": Mounted
Checking O2CB cluster ocfs2: Online
  Heartbeat dead threshold: 61
  Network idle timeout: 10000
  Network keepalive delay: 5000
  Network reconnect delay: 2000
Checking O2CB heartbeat: Active

看来,做完这个操作,必须重启。。。。。。

然后将所有服务启动,如下面所示:


rac2-> crs_stat -t
Name           Type           Target    State     Host       
------------------------------------------------------------            
ora....SM1.asm application    ONLINE    ONLINE    rac1       
ora....C1.lsnr application    ONLINE    ONLINE    rac1       
ora.rac1.gsd   application    ONLINE    ONLINE    rac1       
ora.rac1.ons   application    ONLINE    ONLINE    rac1       
ora.rac1.vip   application    ONLINE    ONLINE    rac1       
ora....SM2.asm application    ONLINE    ONLINE    rac2       
ora....C2.lsnr application    ONLINE    ONLINE    rac2       
ora.rac2.gsd   application    ONLINE    ONLINE    rac2       
ora.rac2.ons   application    ONLINE    ONLINE    rac2       
ora.rac2.vip   application    ONLINE    ONLINE    rac2

问题得以最终解决。


 

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

转载于:http://blog.itpub.net/8334342/viewspace-524907/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值