用备份还原磁盘头信息:
$ dd if=/u01/asmdisk_header/raw1_header bs=4096 count=1 of=/dev/raw/raw1
读入了 1+0 个块
输出了 1+0 个块
$ env |grep ORA
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
ORACLE_SID=+ASM
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 15 13:40:41 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ASM instance started
Total System Global Area 83886080 bytes
Fixed Size 1217836 bytes
Variable Size 57502420 bytes
ASM Cache 25165824 bytes
SQL>
SQL> alter diskgroup DISK_GROUP1 mount;
Diskgroup altered.
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 15 13:41:28 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area 197132288 bytes
Fixed Size 1218484 bytes
Variable Size 83888204 bytes
Database Buffers 109051904 bytes
Redo Buffers 2973696 bytes
ORA-00205: error in identifying control file, check alert log for more info
ALTER DATABASE MOUNT
Tue Jul 15 13:41:35 2008
Starting background process ASMB
ASMB started with pid=16, OS id=3352
Starting background process RBAL
RBAL started with pid=17, OS id=3356
Tue Jul 15 13:41:40 2008
SUCCESS: diskgroup DISK_GROUP1 was mounted
Tue Jul 15 13:41:40 2008
ORA-00202: ????: ''+FLASHBACK_DISKGROUP/devdb/controlfile/current.256.657732291''
ORA-17503: ksfdopn: 2 ?????? +FLASHBACK_DISKGROUP/devdb/controlfile/current.256.657732291
ORA-15001: ??? "FLASHBACK_DISKGROUP" ????????
ORA-15001: diskgroup "FLASHBACK_DISKGROUP" does not exist or is not mounted
SUCCESS: diskgroup DISK_GROUP1 was dismounted
Tue Jul 15 13:41:40 2008
ORA-205 signalled during: ALTER DATABASE MOUNT...
因为其他磁盘组没有装载,导致controlfile不能全部找到,回到ASM instance mount所有磁盘组
$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jul 15 13:43:21 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> alter diskgroup DISK_GROUP1 dismount;
Diskgroup altered.
SQL> alter diskgroup all mount;
Diskgroup altered.
QL> startup mount
ORACLE instance started.
Total System Global Area 197132288 bytes
Fixed Size 1218484 bytes
Variable Size 83888204 bytes
Database Buffers 109051904 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> alter database open;
Database altered.
SQL> select file_name from dba_data_files;
FILE_NAME
----------------------------------------------------------------------------------------------------
+DISK_GROUP1/devdb/datafile/users.259.657732133
+DISK_GROUP1/devdb/datafile/sysaux.257.657732131
+DISK_GROUP1/devdb/datafile/undotbs1.258.657732131
+DISK_GROUP1/devdb/datafile/system.256.657732131
+DISK_GROUP1/devdb/datafile/example.265.657732351
+DISK_GROUP2/devdb/datafile/users.256.659787481
6 rows selected.
发现数据库可以正常打开,数据没有丢失.
总结: 磁盘划分区以后,在Linux下通过asm lib用oracleasm命令创建ASM磁盘,然后在/etc/sysconfig/rawdevices创建设备文件
disk partition (fdisk -l查看)->asm disk (/etc/init.d/oracleasm listdisks 查看)->more /etc/sysconfig/rawdevices or ls -l
/dev/raw/raw*查看
测试看出,删除raw 设备文件,磁盘组仍然可以直接读取asm disk,但是如果磁盘分区或者asm disk被删除,需要利用备份进行恢复
请兄弟门指正测试中不足,错误的地方