In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article shows you how to expand and delete the online disk of oracle 11g RAC asm under udev. The content is concise and easy to understand, which can definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.
We all know that when ORACLE is deployed and installed with RAC, it is highly recommended that we use ASM to manage storage, rather than the previous bare devices and local file systems. There are many reasons. I think the most important reason is that the ease of use, performance and fault-tolerant mechanism of ASM are better than other ways.
However, after the production system has been used for a period of time, there is often no scalable storage for ASM. At this time, it is necessary to expand the storage of the database online. I believe this situation is also a work that often troubles dba.
This paper focuses on the methods and matters needing attention of using UDEV to expand ASM storage online for your reference.
1. Storage engineer is required to allocate shared disks to two RAC hosts.
/ home/oracle/Skillset/questions/Skillset3/Skillset3.html
[root@rac1 by-path] # fdisk-l
Disk / dev/sdh: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I take O size (minimum/optimal): 32768 bytes / 32768 bytes
Disk identifier: 0x00000000
I only show my newly added disk here.
Two nodes view uuid
[root@rac1 by-path] # ll / dev/disk/by-id
Lrwxrwxrwx 1 root root 9 Apr 11 09:51 scsi-3600507680c808021b800000000000424->.. /.. / sdc
Lrwxrwxrwx 1 root root 9 Apr 11 09:51 scsi-3600507680c808021b800000000000425->.. /.. / sdd
Lrwxrwxrwx 1 root root 9 Apr 11 09:51 scsi-3600507680c808021b800000000000426->.. /.. / sde
Lrwxrwxrwx 1 root root 9 Apr 11 09:51 scsi-3600507680c808021b800000000000427->.. /.. / sdf
Lrwxrwxrwx 1 root root 9 Apr 11 09:51 scsi-3600507680c808021b800000000000428->.. /.. / sdg
Lrwxrwxrwx 1 root root 9 Apr 11 09:51 scsi-3600507680c808021b800000000000429->.. /.. / sdh
View rac2 Node uuid
[root@rac2 ~] # ll / dev/disk/by-id
Lrwxrwxrwx 1 root root 9 Apr 11 10:46 scsi-3600507680c808021b800000000000424->.. /.. / sdc
Lrwxrwxrwx 1 root root 9 Apr 11 10:46 scsi-3600507680c808021b800000000000425->.. /.. / sdd
Lrwxrwxrwx 1 root root 9 Apr 11 10:46 scsi-3600507680c808021b800000000000426->.. /.. / sde
Lrwxrwxrwx 1 root root 9 Apr 11 10:46 scsi-3600507680c808021b800000000000427->.. /.. / sdf
Lrwxrwxrwx 1 root root 9 Apr 11 10:46 scsi-3600507680c808021b800000000000428->.. /.. / sdg
Lrwxrwxrwx 1 root root 9 Apr 11 10:46 scsi-3600507680c808021b800000000000429->.. /.. / sdh
Whether the comparison is consistent, if so, it means that the disk is shared and there is no problem.
2. Configure udev
Here is the udev file to add the disk
Vi / etc/udev/rules.d/99-oracle-asmdevices.rules
KERNEL== "sd*", SUBSYSTEM== "block", PROGRAM== "/ sbin/scsi_id-whitelisted-replace-whitespace-device=/dev/$name", RESULT== "3600507680c808021b800000000000429", NAME= "asm-diskh", OWNER= "oracle", GROUP= "dba", MODE= "0660"
Add this line to the two nodes
Then restart udev on both nodes
Start_udev
Check whether the shared disks of the two nodes are added to the ASM
[root@rac1 ~] # ll / dev/asm*
Brw-rw---- 1 oracle dba 8, 112 Apr 23 15:55 / dev/asm-diskh
3. Expand the disk for ASM online
Rac2:/home/oracle@grid > sqlplus / as sysasm
SQL > set lines 200 pages 1000
SQL > col PATH for A30
SQL > select group_number,path,state,total_mb,free_mb from v$asm_disk
GROUP_NUMBER PATH STATE TOTAL_MB FREE_MB
1 / dev/asm-diskg NORMAL 102400 97445
2 / dev/asm-diskh NORMAL 0 0
2 / dev/asm-diskf NORMAL 102400 38788
3 / dev/asm-diske NORMAL 10240 9932
3 / dev/asm-diskd NORMAL 10240 9930
3 / dev/asm-diskc NORMAL 10240 9932
SQL > select name,state,type,total_mb,free_mb,round (total_mb-free_mb) / total_mb) * 100Pol 2) tbs_used from v$asm_diskgroup
NAME STATE TYPE TOTAL_MB FREE_MB TBS_USED
-
ARCH MOUNTED EXTERN 102400 97445 4.84
DATA MOUNTED EXTERN 102400 29535 71.16
OCR MOUNTED NORMAL 30720 29794 3.01
SQL > alter system set asm_power_limit=10
System altered.
SQL > alter diskgroup data add disk'/ dev/asm-diskh'
Diskgroup altered.
SQL > alter system set asm_power_limit=1
System altered.
After expansion, check to see if asm is in dynamic balance.
SQL > select * from v$asm_operation
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
--
2 REBAL RUN 10 10 36430 36430 0 0
SQL > select group_number,path,state,total_mb,free_mb from v$asm_disk
GROUP_NUMBER PATH STATE TOTAL_MB FREE_MB
1 / dev/asm-diskg NORMAL 102400 97445
2 / dev/asm-diskh NORMAL 102400 65968
2 / dev/asm-diskf NORMAL 102400 65965
3 / dev/asm-diske NORMAL 10240 9932
3 / dev/asm-diskd NORMAL 10240 9930
3 / dev/asm-diskc NORMAL 10240 9932
There are several concepts that need to be explained.
The SGA of the ASM instance requires very little memory.
When adding and deleting disks to a disk group, the disk group automatically redistributes data between the old and new disks, thus achieving decentralized IO, a process called Rebalance. Adding and deleting disks to a disk group moves data between disks, so although it is an online operation, it still affects some performance, so do it when the system is idle.
The asm_power_limit parameter controls the Rebalance speed, with a value range of 0-11. The minimum value is 0, which means no Rebalance, the maximum value 11 represents the fastest speed, and it also means serious performance impact, and 1 represents the slowest speed and the smallest performance impact. Where 1 is the default value.
4. Delete disks for ASM online
Although it is easy to adjust the production disk in production, there is also a need to delete ASM disk online. So let's test whether deleting the disk will affect the use of the database.
Create a test table crm.obj table
Rac2:/home/oracle@db >. Gdenv
Rac2:/home/oracle@grid > sqlplus / as sysasm
SQL > select group_number,name,path,state,total_mb,free_mb from v$asm_disk
GROUP_NUMBER NAME PATH STATE TOTAL_MB FREE_MB
1 ARCH_0000 / dev/asm-diskg NORMAL 102400 97445
2 DATA_0001 / dev/asm-diskh NORMAL 102400 65968
2 DATA_0000 / dev/asm-diskf NORMAL 102400 65965
3 OCR_0002 / dev/asm-diske NORMAL 10240 9932
3 OCR_0001 / dev/asm-diskd NORMAL 10240 9930
3 OCR_0000 / dev/asm-diskc NORMAL 10240 9932
SQL > alter diskgroup data drop disk DATA_0001
Diskgroup altered.
It should be noted here that you need to fill in name, not which disk.
SQL > select GROUP_NUMBER,name,state,type,total_mb,free_mb,round (total_mb-free_mb) / total_mb) * 100Pol 2) tbs_used from v$asm_diskgroup
GROUP_NUMBER NAME STATE TYPE TOTAL_MB FREE_MB TBS_USED
--
1 ARCH MOUNTED EXTERN 102400 97445 4.84
2 DATA MOUNTED EXTERN 102400 29533 71.16
3 OCR MOUNTED NORMAL 30720 29794 3.01
SQL > select disk_number, state, name, total_mb, free_mb from v$asm_disk where group_number = 2
DISK_NUMBER STATE NAME TOTAL_MB FREE_MB
1 DROPPING DATA_0001 102400 72948
0 NORMAL DATA_0000 102400 58985
We can see that this disk is being deleted, because we need to do dynamic balance, so we can see the dynamic balance process below.
SQL > select * from v$asm_operation
GROUP_NUMBER OPERATION STATE POWER ACTUAL SOFAR EST_WORK EST_RATE EST_MINUTES ERROR_CODE
--
2 REBAL RUN 1 1 8172 36430 3897 7
This process does not affect users' use of the database at all, which I tested on my test library.
The above content is what the online expansion and deletion operation of oracle 11g RAC asm under udev is like. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.