database DB2 和 Oracle Perspective 中的 CLOB 和 BLOB 之间的区别?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21570751/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Difference between CLOB and BLOB from DB2 and Oracle Perspective?
提问by The Dark Knight
I have been pretty much fascinated by these two data types. According to Oracle Docs, they are presented as follows :
我对这两种数据类型非常着迷。根据Oracle Docs,它们呈现如下:
BLOB :Variable-length binary large object string that can be up to 2GB (2,147,483,647) long. Primarily intended to hold non-traditional data, such as voice or mixed media. BLOB strings are not associated with a character set, as with FOR BIT DATA strings.
BLOB :可变长度的二进制大对象字符串,最长可达 2GB (2,147,483,647)。主要用于保存非传统数据,例如语音或混合媒体。BLOB 字符串不与字符集相关联,就像 FOR BIT DATA 字符串一样。
CLOB :Variable-length character large object string that can be up to 2GB (2,147,483,647) long. A CLOB can store single-byte character strings or multibyte, character-based data. A CLOB is considered a character string.
CLOB :可变长度字符大对象字符串,最长可达 2GB (2,147,483,647)。CLOB 可以存储单字节字符串或多字节、基于字符的数据。CLOB 被视为字符串。
What I don't know, is whether there is any difference between the two from DB2 and Oracle perspective? I mean, what are the differences between DB2 CLOB and Oracle CLOB, also between DB2 BLOB and Oracle BLOB? What is the maximum size of both in DB2 and Oracle? Is it just 2 GB ?
我不知道的是,从 DB2 和 Oracle 的角度来看,两者之间是否有任何区别?我的意思是,DB2 CLOB 和 Oracle CLOB 之间以及 DB2 BLOB 和 Oracle BLOB 之间有什么区别?DB2 和 Oracle 中的最大大小是多少?它只是 2 GB 吗?
采纳答案by AngocA
They can be considered as equivalent. The limits in size are the same:
它们可以被认为是等价的。大小限制相同:
- Maximum length of CLOB (in bytes or OCTETS)) 2 147 483 647
- Maximum length of BLOB (in bytes) 2 147 483 647
- CLOB 的最大长度(以字节或 OCTETS 为单位))2 147 483 647
- BLOB 的最大长度(以字节为单位) 2 147 483 647
There is also the DBCLOBs, for double byte characters.
还有 DBCLOB,用于双字节字符。
References:
参考:
回答by scientific
BLOBis for binary data (videos, images, documents, other)
BLOB用于二进制数据(视频、图像、文档、其他)
CLOBis for large text data (text)
CLOB用于大文本数据(text)
Maximum size on MySQL 2GB
MySQL 上的最大大小为 2GB
Maximum size on Oracle 128TB
Oracle 上的最大大小 128TB
回答by Dnyaneshwar
BLOBprimarily intended to hold non-traditional data, such as images,videos,voice or mixed media. CLOBintended to retain character-based data.
BLOB主要用于保存非传统数据,例如图像、视频、语音或混合媒体。CLOB旨在保留基于字符的数据。

