- 最后登录
- 2023-8-16
- 在线时间
- 1686 小时
- 威望
- 2135
- 金钱
- 50532
- 注册时间
- 2011-10-12
- 阅读权限
- 200
- 帖子
- 5207
- 精华
- 39
- 积分
- 2135
- UID
- 2
|
1#
发表于 2013-11-7 20:51:45
|
查看: 3683 |
回复: 4
create table clob_example ( a number, b CLOB )
lob (b) store as ( enable storage in row );
SQL> desc CLOB_EXAMPLE
Name Null? Type
----------------------------------------- -------- ---------------
-------------
A NUMBER
B CLOB
insert into clob_example values ( 1,'abc');
insert into clob_example values ( 2,empty_clob());
SQL> select rowid,a,b from CLOB_EXAMPLE;
ROWID A B
------------------------------------
AAAQYkAAFAAAAA1AAA 1 abc
AAAQYkAAFAAAAA1AAB 2
SQL> select dbms_rowid.rowid_relative_fno('AAAQYkAAFAAAAA1AAA')
from dual;
DBMS_ROWID.ROWID_RELATIVE_FNO('AAAQYKAAFAAAAA1AAA')
---------------------------------------------------
5
SQL> select dbms_rowid.rowid_block_number('AAAQYkAAFAAAAA1AAA')
from dual;
DBMS_ROWID.ROWID_BLOCK_NUMBER('AAAQYKAAFAAAAA1AAA')
---------------------------------------------------
53
alter system dump datafile 5 block 53;
tab 0, row 0, @0x1f72
tl: 46 fb: --H-FL-- lb: 0x1 cc: 2
col 0: [ 2] c1 02
col 1: [39]
00 54 00 01 02 0c 00 00 00 01 00 00 00 01 00 00 00 13 db cb 00 13 09 00 00
00 00 00 00 03 00 00 00 00 00 01 61 62 63
LOB
Locator:
Length: 84(39)
Version: 1
Byte Length: 1
LobID: 00.00.00.01.00.00.00.13.db.cb
Flags[ 0x02 0x0c 0x00 0x00 ]:
Type: CLOB
Storage: BasicFile
Enable Storage in Row
Characterset Format: IMPLICIT
Partitioned Table: No
Options: ReadWrite
Inode:
Size: 19
Flag: 0x09 [ Valid DataInRow ]
Future: 0x00 (should be '0x00')
Blocks: 0
Bytes: 3
Version: 00000.0000000001
Inline data[3]
Dump of memory from 0x00007FC3D2F981F9 to 0x00007FC3D2F981FC
7FC3D2F981F0 63626101 [.abc]
tab 0, row 1, @0x1f47
tl: 43 fb: --H-FL-- lb: 0x1 cc: 2
col 0: [ 2] c1 03
col 1: [36]
00 54 00 01 02 0c 00 00 00 01 00 00 00 01 00 00 00 13 db cc 00 10 09 00 00
00 00 00 00 00 00 00 00 00 00 00
LOB
Locator:
Length: 84(36)
Version: 1
Byte Length: 1
LobID: 00.00.00.01.00.00.00.13.db.cc
Flags[ 0x02 0x0c 0x00 0x00 ]:
Type: CLOB
Storage: BasicFile
Enable Storage in Row
Characterset Format: IMPLICIT
Partitioned Table: No
Options: ReadWrite
Inode:
Size: 16
Flag: 0x09 [ Valid DataInRow ]
Future: 0x00 (should be '0x00')
Blocks: 0
Bytes: 0
Version: 00000.0000000000
Inline data[0]
col 1: [39]
00 54 00 01 02 0c 00 00 00 01 00 00 00 01 00 00 00 13 db cb 00 13 09 00 00
00 00 00 00 03 00 00 00 00 00 01 61 62 63
[39] Length: 84(39)
00 54 len , LOB locator 的最大长度,排除len的这2个字节
00 01 vsn,LOB locator结构的版本 Version: 1
02 0c 00 00 flg 4字节,
Flags[ 0x02 0x0c 0x00 0x00 ]:
Type: CLOB
Storage: BasicFile
Enable Storage in Row
Characterset Format: IMPLICIT
Partitioned Table: No
00 01 bytl = byte length (1 for BLOB/CLOB/BFILE. Value for NCLOB) - 00 01
00 54 00 01 02 0c 00 00 00 01 len(2), vsn(2), flg(4), bytl(2)
00 00 00 01 00 00 00 13 db cb lob ID LobID: 00.00.00.01.00.00.00.13.db.cb
00 13 09 00 00 - 00 -size(19)-Flag-(09)-future(00)-blocks(00)-
00 00 00 00 03 00 Bytes (6)
00 00 00 00 01 version 00000.0000000001 (5bytes) inode of 16 bytes
61 62 63 – data.
Inode:
Size: 19
Flag: 0x09 [ Valid DataInRow ]
Future: 0x00 (should be '0x00')
Blocks: 0
Bytes: 3
Version: 00000.0000000001
Inline data[3]
|
|