一、CLOB字段的业务说明:CLOB为字符LOB,是LOB 的一种。这种类型用于存储大量的文本信息,如XML 或者只是纯文本。这个数据类型需要进行字符集转换,也就是说,在获取时,这个字段中的字符会从数据库的字符集转换为客户的字符集,而在修改时会从客户的字符集转换为数据库的字符集。
二、官方解释:The CLOB data type stores single-byte and multibyte character data. Both fixed-width and variable-width character sets are supported, and both use the database character set. CLOB objects can store up to (4 gigabytes -1) * (the value of the CHUNK parameter of LOB storage) of character data. 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).
CLOB objects have full transactional support. Changes made through SQL, the DBMS_LOB package, or Oracle Call Interface (OCI) participate fully in the transaction. CLOB value manipulations can be committed and rolled back. However, you cannot save a CLOB locator in a PL/SQL or OCI variable in one transaction and then use it in another transaction or session.
三、CLOB字段在数据库中的结构:
1、创建Clob列的时候会创建相应的索引;
2、表上面clob列会存放类似于指针的东西;
3、通过索引指向存放LOB对象的段;
4、CHUNK的大小是ORACLE数据块的整数倍;
四、常用的CLOB查询语句
1、知道CLOB的名称,查找对应的表名、索引名称、占用空间
SELECT A.OWNER,A.TABLE_NAME,A.COLUMN_NAME,A.INDEX_NAME,b.SEGMENT_TYPE,b.bytes/1024/1034 SIZE_MB
FROM dba_lobs A,DBA_SEGMENTS B
WHERE A.SEGMENT_NAME=B.SEGMENT_NAME AND A.OWNER=B.OWNER AND A.SEGMENT_NAME='&NAME';
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
本文作者:JOHN
ORACLE技术博客:ORACLE 猎人笔记 数据库技术群:367875324 (请备注ORACLE管理 )
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++