创建一个表
SQL> create table bear2(a number,b blob);
Table created
插入1000行数据,其中BLOB字段插入空
SQL>
SQL> BEGIN
2 FOR I IN 1 .. 1000 LOOP
3 INSERT INTO BEAR2 VALUES (1, '');
4 END LOOP;
5 COMMIT;
6 END;
7 /
PL/SQL procedure successfully completed
查看SEGMENT大小为65536字节
SQL> SELECT SEGMENT_NAME, SEGMENT_TYPE, BYTES FROM USER_SEGMENTS WHERE SEGMENT_NAME = 'BEAR2'
2 /
SEGMENT_NAME SEGMENT_TYPE BYTES
-------------------------------------------------------------------------------- ------------------ ----------
BEAR2 TABLE 65536
更新BLOB字段,使得其值变大
SQL> UPDATE BEAR2 SET B='AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
1000 rows updated
SQL> COMMIT;
Commit complete
查看SEGMENT大小发现已经变大
SQL> SELECT SEGMENT_NAME, SEGMENT_TYPE, BYTES FROM USER_SEGMENTS WHERE SEGMENT_NAME = 'BEAR2';
SEGMENT_NAME SEGMENT_TYPE BYTES
-------------------------------------------------------------------------------- ------------------ ----------
BEAR2 TABLE 131072
更新BLOB字段使得其值更大些
SQL> UPDATE BEAR2 SET B='AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
1000 rows updated
SQL> COMMIT;
Commit complete
发现SEGMENT大小也变的更大
SQL> SELECT SEGMENT_NAME, SEGMENT_TYPE, BYTES FROM USER_SEGMENTS WHERE SEGMENT_NAME = 'BEAR2';
SEGMENT_NAME SEGMENT_TYPE BYTES
-------------------------------------------------------------------------------- ------------------ ----------
BEAR2 TABLE 196608
因此说BLOB的大小是包含在表的SEGMENT中的