【问题标题】:problem with choosing data type for large file为大文件选择数据类型的问题
【发布时间】:2011-08-03 05:53:16
【问题描述】:

我创建了一个程序来将大文件插入数据库(大约 10M)。我为表中的对象列选择了 BLOB 类型。

现在我读到的 BLOB 只支持最大长度为 4M 的二进制对象。

你能告诉我在这种情况下我能做些什么来上传超过 4M 的对象吗?

我使用的是 Oracle 9i 或 10g。

【问题讨论】:

  • 为什么需要将这些文件存储在数据库中?

标签: oracle oracle10g oracle9i


【解决方案1】:

您阅读的内容似乎不正确。

根据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).

【讨论】:

  • 哦,谢谢,所以我认为我读的这本书犯了错误,他们写的 blob 只能支持 4Megabyte!谢谢
【解决方案2】:

根据本站,

http://ss64.com/ora/syntax-datatypes.html

自 Oracle 8 以来,BLOB 的最大大小为 4GB,因此 10MB 应该没问题。

【讨论】:

  • 哦,谢谢,所以我认为我读的这本书犯了错误,他们写的 blob 只能支持 4Megabyte!谢谢
【解决方案3】:

支持的 LOB 的最大大小 数据库等于 db_block_size 初始化 参数乘以值 4294967295。 这允许最大 LOB 大小 范围从 8 TB 到 128 太字节。

http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_lob.htm#i1016062

【讨论】:

  • 哦,谢谢,所以我认为我读的这本书犯了错误,他们写的 blob 只能支持 4Megabyte!谢谢
猜你喜欢
  • 2020-10-12
  • 1970-01-01
  • 2011-08-01
  • 2020-05-09
  • 1970-01-01
  • 2016-11-24
  • 2015-04-04
  • 2013-04-04
  • 1970-01-01
相关资源
最近更新 更多