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

How to replace a disk in an ASM disk group

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

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to replace disks in ASM disk groups. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.

Replace the storage procedure

1. Add a new disk and create a new asm disk for the new disk

2. Add the new asm disk to asm group

3. Wait for the asm group data to be rebalanced

4. Delete the old asm disk corresponding to the old disk from asm group

5. Wait for the asm group data to be rebalanced

6. Remove the old disk

The disk group asm group should be resized:

If the original disk pack is 1T, now you want to change it to 100g

If the asm group is externally redundant, there is only one asm disk inside, and this asm disk 1T, add an asm disk 100G, and then delete the 1T asm disk.

For example, if the asm group is normal redundant, there are two asm disk in it. If the two asm disk add up to 1T, add two asm disk summaries of 100G, and delete two asm dis of 1T.

V$asm_operation

Displays information about asm rebalancing

V$ASM_OPERATION displays one row for every active Oracle ASM long running operation executing in the Oracle ASM instance.

Select * from vastly operating;-- this statement is executed on the ASM instance to see the accurate information

ASM_POWER_LIMIT

ASM_POWER_LIMIT specifies the maximum power consumption of the automatic storage management instance used for disk rebalancing. The higher the upper limit, the faster the rebalancing. Lower values take longer, but consume less processing and Icord O resources.

ASM_POWER_LIMIT specifies the maximum power on an Automatic Storage Management instance for disk rebalancing. The higher the limit, the faster rebalancing will complete. Lower values will take longer, but consume fewer processing and I/O resources

When ASM_POWER_LIMIT is set to 0, it will not be automatically rebalanced, but you can use the following statement to rebalance manually (for example, add the disk during the day and let it execute manually at night)

Alter diskgroup DATA rebalance power 10;-- this statement can only be run on an ASM instance, and the connection mode is as sysasm

The old disk can be physically removed directly, and the corresponding asm disks disappears automatically after removal. This asm disk can be reused by the following disks. For example, the asm disk corresponding to sdd1 is / dev/oracleasm/disks/OCPFRA1. After the physical disk sdd is removed, / dev/oracleasm/disks/OCPFRA1 disappears automatically. If a new disk sdk comes later, you can oracleasm createdisk OCPFRA1 / dev/sdk1.

The practical case of replacing disks for ASM disk groups, replacing more space asm disk for asm group with insufficient space (steps 4-9 in this case correspond to the 1-6 steps described above to replace storage)

1. Identify the ASM disk group with insufficient space, and the result is FRA, with 36% free space.

SQL > select name,total_mb,free_mb,round ((free_mb/total_mb) * 100) from gv$asm_diskgroup

NAME TOTAL_MB FREE_MB ROUND ((FREE_MB/TOTAL_MB) * 100)

DATA 6141 4195 68

FRA 2047 739 36

2. Determine the redundancy mode of FRA and the corresponding asm disk, and the result is EXTERN and / dev/oracleasm/disks/OCPFRA1

SQL > select a.pathrea.namemema.modestatusreport.name diskgroupname,b.type from v$asm_disk arecoverasmwriting diskgroup b where a.group_number=b.group_number and b.namerecording recording FRA'

PATH NAME MODE_ST DISKGROUPN TYPE

/ dev/oracleasm/disks/OCPFRA1 FRA_0000 ONLINE FRA EXTERN

3. Determine the physical disk information and database objects corresponding to / dev/oracleasm/disks/OCPFRA1. The result is sdd1 capacity 2G and corresponding table TABLE_TEW.

[root@ASMDB ~] # ll / dev/oracleasm/disks/OCPFRA1

Brw-rw---- 1 grid dba 8, 49 Jun 7 19:11 / dev/oracleasm/disks/OCPFRA1

[root@ASMDB ~] # ll / dev | grep disk | grep 8 | grep 49

Brw-r- 1 root disk 8, 49 Jun 7 16:11 sdd1

[root@ASMDB ~] # fdisk-l | grep sdd

Disk / dev/sdd: 2147 MB, 2147483648 bytes

/ dev/sdd1 1 261 2096451 83 Linux

[oracle@ASMDB ~] $sqlplus / as sysdba

SQL > select tablespace_name,file_name from dba_data_files where file_name like'% FRA%'

TABLESPACE_NAME FILE_NAME

TEW + FRA/tew01.dbf

SQL > select table_name,tablespace_name from dba_tables where tablespace_name='TEW' and rownum select count (*) from TABLE_TEW

COUNT (*)

-

601480

4. The new physical disk is sdg1, and the asm disk is created as / dev/oracleasm/disks/OCPFRA2

[root@ASMDB ~] # oracleasm createdisk OCPFRA2 / dev/sdg1

[root@ASMDB ~] # oracleasm scandisks

Reloading disk partitions: done

Cleaning any stale ASM disks...

Scanning system for ASM disks...

[root@ASMDB ~] # oracleasm listdisks

OCPDATA1

OCPDATA2

OCPDATA3

OCPFRA1

OCPFRA2

[grid@ASMDB] $asmcmd lsdsk-- candidate

Path

/ dev/oracleasm/disks/OCPFRA2

5. To add a new asm disk to asm group, you must use as sysasm

[grid@ASMDB ~] $sqlplus / as sysasm

SQL > alter diskgroup FRA add disk'/ dev/oracleasm/disks/OCPFRA2' rebalance power 10

Diskgroup altered.

6. Wait for the asm group data rebalance, that is, the v$asm_operation query result is empty. Immediately after the rebalance, it is found that the space and asm disk of the asm group have changed, and the space has become the total space of the new and old asm disk. The available space is 74%, and the new asm disk / dev/oracleasm/disks/OCPFRA2 is added.

SQL > select * from v$asm_operation

GROUP_NUMBER OPERA STAT POWER ACTUAL SOFAR EST_WORK EST_RATE

EST_MINUTES ERROR_CODE

-

2 REBAL RUN 10 10 495 785 672

0

.

.

.

SQL > select * from v$asm_operation

No rows selected

SQL > select name,total_mb,free_mb,round ((free_mb/total_mb) * 100) from gv$asm_diskgroup

NAME TOTAL_MB FREE_MB ROUND ((FREE_MB/TOTAL_MB) * 100)

DATA 6141 4195 68

FRA 5114 3779 74

SQL > select a.pathrea.namemema.modestatusreport.name diskgroupname,b.type from v$asm_disk arecoverasmwriting diskgroup b where a.group_number=b.group_number and b.namerecording recording FRA'

PATH NAME MODE_ST DISKGROUPN TYPE

/ dev/oracleasm/disks/OCPFRA1 FRA_0000 ONLINE FRA EXTERN

/ dev/oracleasm/disks/OCPFRA2 FRA_0001 ONLINE FRA EXTERN

7. Delete the old asm disk corresponding to the old disk from the asm group. Refer to the information in step 3. The old disk sdd1 corresponds to asm disk / dev/oracleasm/disks/OCPFRA1, but the asm disk path name cannot be written here, only the asm disk name, that is, v$asm_disk.name.

SQL > alter diskgroup FRA drop disk 'FRA_0000' rebalance power 10

Diskgroup altered.

8. Wait for the asm group data rebalance, that is, the v$asm_operation query result is empty. Immediately after the rebalance, it is found that the space and asm disk of the asm group have changed, the space has become the total space of the new asm disk, the available space is 57%, the old asm disk is deleted, and verify that the table on the asm group is normal.

SQL > select * from v$asm_operation

No rows selected

SQL > select name,total_mb,free_mb,round ((free_mb/total_mb) * 100) from gv$asm_diskgroup

NAME TOTAL_MB FREE_MB ROUND ((FREE_MB/TOTAL_MB) * 100)

DATA 6141 4195 68

FRA 3067 1734 57

SQL > select a.pathrea.namemema.modestatusreport.name diskgroupname,b.type from v$asm_disk arecoverasmwriting diskgroup b where a.group_number=b.group_number and b.namerecording recording FRA'

PATH NAME MODE_ST DISKGROUPN TYPE

/ dev/oracleasm/disks/OCPFRA2 FRA_0001 ONLINE FRA EXTERN

[oracle@ASMDB ~] $sqlplus / as sysdba

SQL > select count (*) from TABLE_TEW

COUNT (*)

-

601480

9. Remove the old disk, restart the computer, start DB, and find that everything is normal. The verification result is consistent with the result in step 8 above.

This is the end of the article on "how to replace disks in ASM disk groups". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

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