首页 > Linux操作系统 > Linux操作系统 > 记忆深刻的10K空间
10K空间能做什么,对于DBA来说,基本上10K没有任何的意义。讨论数据库的容量时单位是T;建立数据文件时单位是G;分配内存空间时单位是M;只有设定数据库的BLOCK_SIZE是单位才是K。
数据库BLOCK_SIZE的最小值是2K,对于一个BLOCK_SIZE为2K的数据库而言,10K空间仅仅够1个表的初始空间而已。
所以对于DBA来说,10K大小的空间基本上没有多大的意义。不过今天碰到了一个10K空间相关的问题,估计会让我记一辈子。
要搭建一套RAC环境,共享存储准备使用ASM,于是和硬件人员沟通存储的划分问题。存储是EMC的CX3-40,30块300G的硬盘,总容量9T。
对于ASM准备使用外部冗余,因此给ASM挂载一个裸设备就可以了。除了给两个服务器各挂载一定容量的本地磁盘外,还需要为ocr和vot盘分配裸设备,剩下的部分就都划分给ASM使用的裸设备了。
开始硬件维护人员问我ocr和vot盘对应的空间有多大,由于以前分配的时候没有太考虑容量的问题,我说分配5个200M的空间。硬件人员可能认为是保存类似参数文件之类的东西,于是问了一句,需要那么大的空间吗,是不是有点浪费。我也不记得ocr和vot的最小要求是大多了,于是说至少100M的空间不能再少了。最终硬件人员划分了5个100M的裸设备。
当我开始安装CLUSTERWARE的时候,在ocr盘的地方输入对应的裸设备:/dev/rdsk/emcpower0g和/dev/rdsk/emcpower1g时,安装程序报错:
The partition which is used to store the Oracle Cluster Registry (OCR) must be at least 100MB in size. The partition you chose /dev/rdsk is only 99MB in size. Specify a partition large enough to hold the primary OCR.
当时要求分配至少100M的空间,怎么变成99M了。检查一下裸设备的划分:
root@ser1 # format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w2100001862ef48ad,0
1. c1t1d0
/pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w2100001862ef4926,0
2. c2t5006016A41E0AC1Cd0
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016a41e0ac1c,0
3. c2t5006016A41E0AC1Cd1
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016a41e0ac1c,1
4. c2t5006016A41E0AC1Cd2
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016a41e0ac1c,2
5. c2t5006016A41E0AC1Cd3
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016a41e0ac1c,3
6. c2t5006016A41E0AC1Cd4
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016a41e0ac1c,4
7. c2t5006016A41E0AC1Cd5
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016a41e0ac1c,5
8. c2t5006016A41E0AC1Cd6
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016a41e0ac1c,6
9. c2t5006016241E0AC1Cd0
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016241e0ac1c,0
10. c2t5006016241E0AC1Cd1
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016241e0ac1c,1
11. c2t5006016241E0AC1Cd2
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016241e0ac1c,2
12. c2t5006016241E0AC1Cd3
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016241e0ac1c,3
13. c2t5006016241E0AC1Cd4
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016241e0ac1c,4
14. c2t5006016241E0AC1Cd5
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016241e0ac1c,5
15. c2t5006016241E0AC1Cd6
/pci@8,600000/QLGC,qlc@1/fp@0,0/ssd@w5006016241e0ac1c,6
16. c3t5006016B41E0AC1Cd0
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016b41e0ac1c,0
17. c3t5006016B41E0AC1Cd1
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016b41e0ac1c,1
18. c3t5006016B41E0AC1Cd2
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016b41e0ac1c,2
19. c3t5006016B41E0AC1Cd3
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016b41e0ac1c,3
20. c3t5006016B41E0AC1Cd4
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016b41e0ac1c,4
21. c3t5006016B41E0AC1Cd5
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016b41e0ac1c,5
22. c3t5006016B41E0AC1Cd6
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016b41e0ac1c,6
23. c3t5006016341E0AC1Cd0
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016341e0ac1c,0
24. c3t5006016341E0AC1Cd1
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016341e0ac1c,1
25. c3t5006016341E0AC1Cd2
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016341e0ac1c,2
26. c3t5006016341E0AC1Cd3
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016341e0ac1c,3
27. c3t5006016341E0AC1Cd4
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016341e0ac1c,4
28. c3t5006016341E0AC1Cd5
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016341e0ac1c,5
29. c3t5006016341E0AC1Cd6
/pci@8,600000/QLGC,qlc@2/fp@0,0/ssd@w5006016341e0ac1c,6
30. emcpower0a
/pseudo/emcp@0
31. emcpower1a
/pseudo/emcp@1
32. emcpower2a
/pseudo/emcp@2
33. emcpower3a
/pseudo/emcp@3
34. emcpower4h
/pseudo/emcp@4
35. emcpower5a
/pseudo/emcp@5
36. emcpower6a
/pseudo/emcp@6
Specify disk (enter its number): 30
selecting emcpower0a
[disk formatted]
FORMAT MENU:
disk - select a disk
type - select (define) a disk type
partition - select (define) a partition table
current - describe the current disk
format - format and analyze the disk
repair - repair a defective sector
label - write label to the disk
analyze - surface analysis
defect - defect list management
backup - search for backup labels
verify - read and display labels
save - save new disk/partition definitions
inquiry - show vendor, product and revision
volname - set 8-character volume name
!
quit
format> p
PARTITION MENU:
0 - change `0' partition
1 - change `1' partition
2 - change `2' partition
3 - change `3' partition
4 - change `4' partition
5 - change `5' partition
6 - change `6' partition
7 - change `7' partition
select - select a predefined table
modify - modify a predefined partition table
name - name the current table
print - display the current table
label - write partition map and label to the disk
!
quit
partition> p
Current partition table (original):
Total disk cylinders available: 20478 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 unassigned wm 0 0 (0/0/0) 0
1 unassigned wu 0 0 (0/0/0) 0
2 backup wu 0 - 20477 99.99MB (20478/0/0) 204780
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 usr wm 0 - 20477 99.99MB (20478/0/0) 204780
7 unassigned wm 0 0 (0/0/0) 0
确实不到100M,空间大小是99.99M。Oracle的检查机制也不会四舍五入,这和100M的空间有多大的区别。
看看是什么导致100M变成了99.99M:
Total disk cylinders available: 20478 + 2 (reserved cylinders)
由于操作系统要保留2个cylinders,用来保存系统信息,导致分配的20480个cylinders只有20478个可用。
SQL> select 100 * 1024 * 1024 / 20480 from dual;
100*1024*1024/20480
-------------------
5120
每个cylinder是5K的空间,系统保留了2个cylinders,占用了10K的空间,所以裸设备可用空间是99.99MB。就是由于少了这10K的空间,导致总容量9T的存储不得不重新划分空间,真是一个black humor。
常说细节决定成败,自己又一次证明了这个真理。不过这次经历至少让我清晰的记得很多的细节:
ocr要求至少100MB的空间;
vot要求至少20MB的空间;
操作系统将占用2个cylinder作为保留空间;
还有这个无法忘记的10K空间的故事。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4227/viewspace-616813/ ,如需转载,请注明出处,否则将追究法律责任。