PCTVERSION or RETENTION?
September 19th, 2007
LOB Segment在 AUTO UNDO下有两种方式来处理old version,一种是按照PCTVERSION,保存PCTVERSION%的old version。
还有一种是RETENTION,这个和undo_retention一样,是保存这一时间段内的old version。
在dba_lobs中,很难判断lob segment究竟是采取了哪种方式,PCTVERSION列和RETENTION列都有值,我们需要查询lob$表,才能确认
- SQL> CREATE TABLE lobpctversion
- 2 (LOBLOC blob,id NUMBER)
- 3 LOB ( lobLoc ) STORE AS
- 4 (TABLESPACE data01
- 5 STORAGE (INITIAL 5k NEXT 5k PCTINCREASE 0) pctversion 5);
- Table created.
- SQL> CREATE TABLE lobretention
- 2 (LOBLOC
- 3 blob,id NUMBER)
- 4 LOB ( lobLoc ) STORE AS
- 5 (TABLESPACE data01 STORAGE (INITIAL 5k NEXT 5k PCTINCREASE 0) retention);
- Table created.
- SQL> select table_name,segment_name,pctversion,retention from dba_lobs where table_name in ('LOBPCTVERSION','LOBRETENTION');
- TABLE_NAME SEGMENT_NAME PCTVERSION RETENTION
- ------------------------------ ------------------------------ ---------- ----------
- LOBPCTVERSION SYS_LOB0000018653C00001$$ 5 10800
- LOBRETENTION SYS_LOB0000018656C00001$$ 10 10800
- SQL> select bitand(flags,32) from sys.lob$ where OBJ#= (select OBJECT_ID from dba_objects where
- 2 OWNER='XFAN' and OBJECT_NAME='LOBPCTVERSION');
- BITAND(FLAGS,32)
- ----------------
- 0 --- 0 代表采用PCTVERSION方式
- SQL> select bitand(flags,32) from sys.lob$ where OBJ#= (select OBJECT_ID from dba_objects where
- 2 OWNER='XFAN' and OBJECT_NAME='LOBRETENTION');
- BITAND(FLAGS,32)
- ----------------
- 32 --- 32代表采用RETENTION方式