ASM磁碟組故障導致資料庫不能起來

dingzihan發表於2014-03-06

ASM磁碟組故障導致資料庫不能起來

環境: HP伺服器兩臺  HPp6000儲存  rac 11.2.0.3
故障描述: 給backup 磁碟組新增磁碟時,導致磁碟組不能mount,資料庫不能起來。
cd  /dev/mapper/backup*
[root@RAC-2 mapper]# ls -l backup*
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup -> ../dm-38
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup1 -> ../dm-42
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:33 backup1p1 -> ../dm-55
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup2 -> ../dm-39
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:34 backup2p1 -> ../dm-56
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup3 -> ../dm-27
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:34 backup3p1 -> ../dm-57
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup4 -> ../dm-35
lrwxrwxrwx 1 oracle oinstall 8 Feb 18 14:34 backup4p1 -> ../dm-58
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup5 -> ../dm-32
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backup6 -> ../dm-31
lrwxrwxrwx 1 oracle oinstall 8 Jan 23 17:04 backupp1 -> ../dm-48

Alter diskgroup backup add disk ‘/dev/mapper/backup1p1’;

報錯,磁碟組dismount。

嘗試通過kfed工具修改磁碟頭。

Cd $ORACLE_HOME/rdbms/lib

$make  -f  ins_rdbms.mk  ikfed

Kfed  read  /dev/mapper/backup1p1    ---檢查ASM disk header 資訊

手工備份 kfed read  /dev/mapper/backup1p1  text=/home/oracle/disk_header/backup1p1.txt

恢復     kfed merge /dev/mapper/backup1p1  text=/home/oracle/disk_header/backup1p1.txt

Kfed  repair  /dev/mapper/backup1p1

清空磁碟頭

Dd  if=/dev/zero of=/dev/mapper/backup1p1  bs=4096  count=1

[root@RAC-1 mapper]# dd if=/dev/zero of=/dev/mapper/backupp1 bs=4096 count=1

1+0 records in

1+0 records out

4096 bytes (4.1 kB) copied, 0.00426006 s, 961 kB/s

[root@RAC-1 mapper]# dd if=/dev/zero of=/dev/mapper/backup1p1 bs=4096 count=1

1+0 records in

1+0 records out

4096 bytes (4.1 kB) copied, 0.00449278 s, 912 kB/s

[root@RAC-1 mapper]# dd if=/dev/zero of=/dev/mapper/backup2p1 bs=4096 count=1

1+0 records in

1+0 records out

4096 bytes (4.1 kB) copied, 0.00409579 s, 1.0 MB/s

[root@RAC-1 mapper]# dd if=/dev/zero of=/dev/mapper/backup3p1 bs=4096 count=1

1+0 records in

1+0 records out

4096 bytes (4.1 kB) copied, 0.00398681 s, 1.0 MB/s

[root@RAC-1 mapper]# dd if=/dev/zero of=/dev/mapper/backup4p1 bs=4096 count=1

1+0 records in

1+0 records out

4096 bytes (4.1 kB) copied, 0.00416703 s, 983 kB/s

 

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

SQL> drop diskgroup backup force including contents;

drop diskgroup backup force including contents

*

ERROR at line 1:

ORA-15039: diskgroup not dropped

ORA-15024: discovered duplicately numbered ASM disk 0

 

 

SQL> drop diskgroup backup force including contents;

 

Diskgroup dropped.

 

通過ASMCA工具新增backup 磁碟組,磁碟組能mount,磁碟正常,但資料庫不能起來。

SUCCESS: diskgroup DATA was mounted

SUCCESS: diskgroup BACKUP was mounted

ORA-00210: cannot open the specified control file

ORA-00202: control file: '+BACKUP/oralnx/controlfile/current.256.832531113'

ORA-17503: ksfdopn:2 Failed to open file +BACKUP/oralnx/controlfile/current.256.832531113

ORA-15012: ASM file '+BACKUP/oralnx/controlfile/current.256.832531113' does not exist

ORA-205 signalled during: ALTER DATABASE MOUNT /* db agent *//* {1:2211:560} */...

NOTE: dependency between database oralnx and diskgroup resource ora.DATA.dg is established

故障原因:backup磁碟組下的controlfile沒了。

ASMCMD> cp +data/oralnx/controlfile/current.260.832531113 +BACKUP/oralnx/controlfile/current

copying +data/oralnx/controlfile/current.260.832531113 -> +BACKUP/oralnx/controlfile/current

記住:使用者在拷貝到ASM上的時候不要指定檔案後面的數值,這是OracleASM用來進行標識的資訊。

ls  -l   ASM只是在目標目錄下儲存了一個alias,真正的檔案被ASM放到了其他的位置。

[grid@RAC-1 ~]$ srvctl config database -d oralnx

Database unique name: oralnx

Database name: oralnx

Oracle home: /oracle/app/oracle/product/11.2/db_1

Oracle user: oracle

Spfile: +DATA/oralnx/spfileoralnx.ora

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Server pools: oralnx

Database instances: oralnx1,oralnx2

Disk Groups: DATA,BACKUP

Mount point paths:

Services:

Type: RAC

Database is administrator managed

資料庫還是不能起來,報控制檔案錯,檢查發現參加檔案的控制檔案目錄有錯,修改引數檔案。

SQL> startup nomount pfile='/oracle/app/oracle/product/11.2/db_1/dbs/initoralnx1.ora'

ORACLE instance started.

 

Total System Global Area 8.3645E+10 bytes

Fixed Size                  2237488 bytes

Variable Size            5.3956E+10 bytes

Database Buffers         2.9528E+10 bytes

Redo Buffers              159531008 bytes

SQL> alter database mount;

 

Database altered.

 

SQL> alter database open;

 

Database altered.

 

SQL> create spfile='+DATA/oralnx/spfileoralnx.ora' from pfile='/oracle/app/oracle/product/11.2/db_1/dbs/initoralnx1.ora';

 

File created.

 

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Real Application Clusters, OLAP, Data Mining

and Real Application Testing options

[oracle@RAC-1 ~]$ exit

logout

[root@RAC-1 ~]# su - grid

[grid@RAC-1 ~]$ srvctl start database -d oralnx

資料庫啟動正常。一切問題解決。


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22969361/viewspace-1102515/,如需轉載,請註明出處,否則將追究法律責任。

相關文章