【发布时间】:2011-08-03 05:53:16
【问题描述】:
我创建了一个程序来将大文件插入数据库(大约 10M)。我为表中的对象列选择了 BLOB 类型。
现在我读到的 BLOB 只支持最大长度为 4M 的二进制对象。
你能告诉我在这种情况下我能做些什么来上传超过 4M 的对象吗?
我使用的是 Oracle 9i 或 10g。
【问题讨论】:
-
为什么需要将这些文件存储在数据库中?
我创建了一个程序来将大文件插入数据库(大约 10M)。我为表中的对象列选择了 BLOB 类型。
现在我读到的 BLOB 只支持最大长度为 4M 的二进制对象。
你能告诉我在这种情况下我能做些什么来上传超过 4M 的对象吗?
我使用的是 Oracle 9i 或 10g。
【问题讨论】:
您阅读的内容似乎不正确。
根据Oracle 10g Release 2 documentation:
The BLOB datatype stores unstructured binary large objects. BLOB objects
can be thought of as bitstreams with no character set semantics. BLOB
objects can store binary data up to (4 gigabytes -1) * (the value of the
CHUNK parameter of LOB storage).
If the tablespaces in your database are of standard block size, and if you
have used the default value of the CHUNK parameter of LOB storage when
creating a LOB column, then this is equivalent to (4 gigabytes - 1) *
(database block size).
【讨论】:
根据本站,
http://ss64.com/ora/syntax-datatypes.html
自 Oracle 8 以来,BLOB 的最大大小为 4GB,因此 10MB 应该没问题。
【讨论】:
支持的 LOB 的最大大小 数据库等于 db_block_size 初始化 参数乘以值 4294967295。 这允许最大 LOB 大小 范围从 8 TB 到 128 太字节。
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1016062
【讨论】: