暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

Oracle单个库最大容量大小

原创 杨卓 2021-11-27
3342

一、疑问

随着大量的国产数据库的出现,大家经常会比较数据库的一些指标,那么对于Oracle数据库单个库的最大容量多大呢???

二、查询相关资料

2.1 表空间对应的数据文件数量

Primary Note: Overview of Oracle Tablespace Management (Doc ID 1493350.1)	
      Bigfile tablespaces can significantly increase the storage capacity of an
 Oracle database. Smallfile tablespaces can contain up to 1024 files but bigfile
 tablespaces contain only one file that can be 1024 times larger than a smallfile
 tablespace. The total tablespace capacity  is the same for smallfile tablespaces
 and bigfile tablespaces. However, because there is limit  of 64K datafiles for
 each database, a database can contain 1024 times more bigfile tablespaces
 than smallfile tablespaces, so bigfile tablespaces increase the total database
 capacity by 3 orders of magnitude. In other words, 8 exabytes is the maximum size
 of the Oracle database  when bigfile tablespaces are used with the maximum block
 size (32 k).

这一段话告诉我们:
1)数据库bigfile tablespace的单个表空间的容量和smallfile tablespace的容量是一样的,因为bigfile tablespace只能包含一个bigfile文件,但是呢smallfile tablespace可以有1024个文件。 也就是说从表空间层面看,存储的数据的最大值上限是一样的!
2)由于每个数据库都有64K数据文件的限制,一个数据库可以包含比smallfile表空间多1024倍的bigfile表空间;
3)如果按照Block max 32K计算,DB全部使用bigfile tablespaces,数据库最大容量是8 exabytes

2.2 数据库容量计算方法

Oracle Database Limitations (Doc ID 1581130.1)	
Oracle Database - Enterprise Edition - Version
 10.1.0.5 to 18.3.0.0.0 [Release 10.1 to 18]
Oracle database size limitations ?
Max Database Size = Max number of data files * ( Max datafile Size * DB_Block_Size) 
For example (Refer above documentations):
Max number of data files per database  = 65534
Max data file Size per database  =  Operating system dependent , limited by max 
operating system file size , typically  typically 222 or 4 MB blocks
DB_block_Size = Operating system dependent , never more than 32 KB
So in order to specify the MAX database size. Just identify the DB_Block_Size
 and multiply it with the MAX data file Size then multiply it by MAX number of
 data files, as mentioned above

数据库最大容量= 最大文件数量*单个最大块大小

 Max Database Size= max_datafile_number 65534 * Db_block_size 32K

那么这些限制到了19c有没有改变呢?

参考
https://docs.oracle.com/en/database/oracle/oracle-database/
19/refrn/physical-database-limits.html

image.png

2.3单个表空间能最大容量是多少

What is the Maximum Datafile Size Limit In an Oracle  Database ?
 (Doc ID 804733.1)	
Oracle Database Limitations (Doc ID 1581130.1)	
What Is The Maximum Tablespace Size And Database Limit
 For An Oracle Database? (Doc ID 1372905.1)	

Small file database
For a small file database, the Oracle database has the following limits:
maximum number of datafiles is : 65533
maximum data blocks per datafile : 2^22 -1 = 4194303
maximum datafile size = db_block_size * maximum number of blocks
maximum db_block_size = 32 K

maximum tablespace size = 1022 * max database file
Resulting values are:
maximum datafile size = 32 * 4194303 = 128 GB
maximum tablespace size = 1022 * 128 GB = 130816 GB
maximum database size = 128 G * 65533 = 8388224 GB ≈ 8191.625 TB ≈ 8 PB



Big file database
For a big file database, the Oracle database has the following limits:
maximum number of datafiles is : 65533
maximum data blocks per datafile : 2^32 = 4294967296
maximum datafile size = db_block_size * maximum number of blocks
max db_block_size = 32 K

maximum tablespace size = size of big datafile
Resulting values are:
maximum datafile size = 32 * 4294967296 = 128 TB
maximum tablespace size = 128 TB
maximum database size = 128 T * 65533 =8388224 TB ≈ 8191.625 PB ≈ 8 EB

Note: 
If you tried to increase the maxsize of a datafile to beyond the limits
 explained in
 this document the operation will fail with ORA-3206 error.
Oracle does no support datafile size with 4294967296 blocks, 
it will lead to the ORA-00740
 error as follows.
    ORA-00740: datafile size of (4294967296) blocks exceeds maximum file
 size Typically it should be reduced by 1 block as 4294967295

三、总结

1.标准小表空间的情况下,使用max blocks 32k,那么单个数据文件最大128Gb,单个表空间最大130816 GB,单个数据库最大容量8PB;
2.使用大表空间的情况下,使用max blocks 32k,那么单个数据文件最大128Tb,单个表空间最大128 TB,单个数据库最大容量8EB;

最后修改时间:2022-03-01 11:39:10
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论