Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Asm disks are all damaged recovery summary

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Experimental environment:

Centos6.4

Oracle 11.2.0.4

--

Use raw mapped in udev mode, and then do asm

-

I wanted to replace the sdb,sdc disk.

Sdb = > 1g _ 2g:sdb5,sdb6,sdb7

Sdc = > 2g sdc1meme sdc2 Magi sdc3reg sdc5pr sdc6

Made into two disk groups.

OCR sdb1,sdb2,sdb3 raw1,raw2,raw3,raw4

DATA sdb5,sdb6,sdb7 sdc1 raw5, raw6,raw7,raw8

FRA sdc2,sdc3,sdc5,sdc6 raw9, raw10,raw11,raw12

Extended partitions are not recommended for disks of asm disk groups

-

I want to change these two plates.

Exit the virtual machine and add 2 more disks

Sdd: 1g:sdd1,sdd2,sdd3. 2g:sdd5,sdd6,sdd7

Sde: 2g:sde1,sde2,sde3,sde5,sde6

Then add the following to / etc/udev/rules.d/60-raw.rules

ACTION== "add", KERNEL== "sdd1", RUN+= "/ bin/raw / dev/raw/raw12 N"

ACTION== "add", KERNEL== "sdd2", RUN+= "/ bin/raw / dev/raw/raw13 N"

ACTION== "add", KERNEL== "sdd3", RUN+= "/ bin/raw / dev/raw/raw14 N"

ACTION== "add", KERNEL== "sdd5", RUN+= "/ bin/raw / dev/raw/raw15 N"

ACTION== "add", KERNEL== "sdd6", RUN+= "/ bin/raw / dev/raw/raw16 N"

ACTION== "add", KERNEL== "sdd7", RUN+= "/ bin/raw / dev/raw/raw17 N"

ACTION== "add", KERNEL== "sde1", RUN+= "/ bin/raw / dev/raw/raw18 N"

ACTION== "add", KERNEL== "sde2", RUN+= "/ bin/raw / dev/raw/raw19 N"

ACTION== "add", KERNEL== "sde3", RUN+= "/ bin/raw / dev/raw/raw20 N"

ACTION== "add", KERNEL== "sde5", RUN+= "/ bin/raw / dev/raw/raw21 N"

ACTION== "add", KERNEL== "sde6", RUN+= "/ bin/raw / dev/raw/raw22 N"

KERNEL== "raw [1-9]", OWNER= "grid", GROUP= "asmadmin" MODE= "660"

KERNEL== "raw1 [0-9]", OWNER= "grid", GROUP= "asmadmin" MODE= "660"

KERNEL== "raw2 [0-2]", OWNER= "grid", GROUP= "asmadmin" MODE= "660"

-

Then enter the instance such as asm

Su-grid

Sqlplus / as sysasm

Select name,path from v$asm_disk

Name path

--

OCR_0000 / dev/raw/raw1

OCR_0001 / dev/raw/raw2

OCR_0002 / dev/raw/raw3

DATA_0000 / dev/raw/raw4

DATA_0001 / dev/raw/raw5

DATA_0002 / dev/raw/raw6

DATA_0003 / dev/raw/raw7

FRA_0000 / dev/raw/raw8

FRA_0001 / dev/raw/raw9

FRA_0002 / dev/raw/raw10

FRA_0003 / dev/raw/raw11

Newly added disk found

Then replace it.

-

OCR

Alter diskgroup ocr add disk'/ dev/raw/raw12','/dev/raw/raw13','/dev/raw/raw14'

Alter diskgroup ocr drop disk 'OCR_0000','OCR_0001','OCR_0002'

-

DATA

Alter diskgroup data add disk'/ dev/raw/raw15','/dev/raw/raw16','/dev/raw/raw17','/dev/raw/raw18'

Alter diskgroup data drop disk 'DATA_0000','DATA_0001','DATA_0002','DATA_0003'

--

FRA

Alter diskgroup fra add disk'/ dev/raw/raw19','/dev/raw/raw20','/dev/raw/raw21','/dev/raw/raw22'

Alter diskgroup fra drop disk 'FRA_0000','FRA_0001','FRA_0002','FRA_0003'

--

Select group_number,operation,power,state from v$asm_operation

When there is no information in it, it means that all the data has been moved.

-

Then shut down the virtual machine.

Delete the corresponding disks of sdb and sdc from the virtual machine

A non-shared disk is also added to the rac2 node.

Power on

It is found that the correspondence of the disk has changed.

Rac1

Sdd became sdb.

Sde became sdc.

Rac2

Sdd became sdc.

Sde became sdd.

The drive letters are all messed up.

I remapped myself. I found that there was still a problem.

-

Then decided not to use the drive letter mapping. Map in scsi_id mode, so that the shared disk cannot be partitioned.

Without doing anything else,

Delete all the partitions of the 2 shared disks. In this way, all the information of ocr,vote disk,data,fra on the shared disk is lost.

--

Then make the following changes in / etc/udev/rules.d/60-raw.rules

ACTION== "add", KERNEL== "sd*", PROGRAM== "/ sbin/scsi_id-g-u-d / dev/$name"

RESULT== "360022a11000e085d0de717f500000003", RUN+= "/ bin/raw / dev/raw/raw1% N"

ACTION== "add", KERNEL== "sd*", PROGRAM== "/ sbin/scsi_id-g-u-d / dev/$name"

RESULT== "360022a11000e085d0de7372c0000002e", RUN+= "/ bin/raw / dev/raw/raw2% N"

ACTION== "adc", KERNEL== "sd*", PROGRAM== "/ sbin/scsi_id-g-u-d / dev/$name"

RESULT== "360022a11000e085d0de7372c0000018e", RUN+= "/ bin/raw / dev/raw/raw2% N"

KERNEL== "raw [1-3]", OWNER= "grid", GROUP= "oinstall", MODE= "660"

--

RESULT== "360022a11000e085d0de717f500000003"

This value is obtained by root#/sbin/scsi_id-g-u-d / dev/sdd

The path to the command varies with different versions of linux.

-

After mapping, it is best to restart it.

=

In this way, after the system is rebooted, it is found that crs is down and cannot be started.

The asm instance cannot be started and the disk group does not exist.

=

Rebuild crs first

Do both 2 nodes.

Root#./crsctl stop crs

Pwd

/ oracle/app/11.2.0/grid/crs/install

Root#./rootcrs.pl-deconfig-force

--

And then

Do both 2 nodes.

Pwd

/ oracle/app/11.2.0/grid

. / root.sh

Rebuilt successfully

=

Then do ocr and vote disk recovery. There is also a backup of the database.

Pwd

/ oracle/app/11.2.0/grid/bin

Rac1

Root#./crsctl stop has

Rac2

Root#./crsctl stop has

The backup of ocr is on rac2

Rac2

Root#./crsctl start crs-excl-nocrs starts to exclusive mode

Grid$sqlplus / as sysasm

Successfully entered the asm instance

Create a disk group

Create diskgroup OCR external redundancy disk'/ dev/raw/raw1'

ATTRIBUTE 'compatible.asm'='11.2.0.0.0'

=

ATTRIBUTE 'compatible.asm'='11.2.0.0.0'

This sentence is more important, if not with it, the recovery of OCR will not be successful.

/ ocrconfig-restore backup00.ocr

Unable to complete

PROT-35: The configured OCR locations are not accessible.

=

Then restore OCR

Root#./ocrconfig-restore / oracle/app/11.2.0/grid/cdata/rac-cluster/backup.ocr

Success

Restore vote disk

Root#./crsctl replace votedisk + OCR

Sqlplus / as sysasm

Create spfile from memory

-

Rac2

Root#./crsctl stop has

--

Rac1

Root#./crsctl start crs

Rac2

Root#./crsctl start crs

=

And then

Rac1

Error logging in with + ASM1

Sqlplus / as sysasm

Ps-ef | grep asm

Asm2

--

Export ORACLE_SID=+ASM2

Sqlplus / as sysasm

Enter successfully

Exit

--

Vi / etc/oratab

+ ASM2-- > + ASM1

--

Oraenv

+ ASM1

Sqlplus / as sysasm

The instance entered successfully

Ps-ef | grep asm

-

Then recreate the DATA and FRA disk groups

Sqlplus / as sysasm

Create diskgroup data add disk'/ dev/raw/raw2'

Create diskgroup fra add disk'/ dev/raw/raw3'

=

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report