ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 关于裸设备数据的处理

关于裸设备数据的处理

原创 Linux操作系统 作者:anycall2010 时间:2009-01-01 05:41:29 0 删除 编辑

如果用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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-06-24

  • 博文量
    182
  • 访问量
    567395