问题描述
当我创建一个包含CLOB
的表时,报告CLOB
列的DATA_LENGTH
为4000:
When I create a table with a CLOB
in it, the CLOB
column is reported to have a DATA_LENGTH
of 4000:
create table test (
data clob
);
-- Returns 4000
select data_length from all_tab_cols
where table_name = 'TEST';
我该怎么解释?考虑到VARCHAR2
的限制也是4000,这是否是一些向后兼容的调整?还是这表示我只能插入/更新长度为4000的字符串文字?是否在某处记录了 SYS.ALL_TAB_COLS
的这种行为? /p>
How can I interpret that? Is that some backwards-compatible tweak, considering that the limit for VARCHAR2
is also 4000? Or is this to indicate that I can only insert / update string literals of length 4000? Is this behaviour of SYS.ALL_TAB_COLS
documented somewhere?
推荐答案
表空间中最多可以在线存储4000字节.如果CLOB的长度超过4000字节,则必须通过特殊功能将其存储在LOB存储区中或从中读取.
Up to 4000 bytes can be stored in-line in the tablespace. If the length of the CLOB exceeds 4000 bytes it must be stored in/readed from LOB storage area via special functions.
另请参阅:
- http://www.dba-oracle.com/t_blob.htm
- http://www.dba-oracle.com/t_table_blob_lob_storage.htm
这篇关于如何为Oracle的CLOB类型解释ALL_TAB_COLS.DATA_LENGTH = 4000?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!