UseLOBStorage(二)

2015-07-24 06:56:09 · 作者: · 浏览: 12
"ZBDBA"
LOB ("GRAPHIC_BLOB") STORE AS SECUREFILE "GLOB_STORE"(
TABLESPACE "ZBDBA" ENABLE STORAGE IN ROW CHUNK 8192
NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES
STORAGE(INITIAL 106496 NEXT 106496 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0
BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT))

Listing 1: Example Use of The LOB Storage Clause and LOB Use in Tables


BLOBs and CLOBs are identical in creation and use, their major difference is in that BLOBs are used for binary data (much like LONG RAW) while CLOBs are used for single byte character storage (like VARCHAR2). The TYPE creation example in Listing 2 shows how a CLOB is specified for a TYPE.


SQL> CREATE OR REPLACE TYPE clob_demo (
2 clob_id NUMBER,
3 clob_value CLOB
4 );

SQL> CREATE TABLE clob_table OF clob_demo
5 LOB (clob_value) STORE AS clob_store (
6 TABLESPACE raw_data
7 STORAGE (INITIAL 100K NEXT 100K PCTINCREASE 0)
8 CHUNK 4
9 PCTVERSION 10
10 INDEX clob_index (
11 TABLESPACE raw_index))
12 TABLESPACE appl_data
12* STORAGE (INITIAL 1M NEXT 1M PCTINCREASE 0)
SQL> /
Listing 2: Example Use of LOBs in a TYPE specification


Notice that no LOB storage is specified when a BLOB or a CLOB is used in aTYPE specification, the LOB storage clause is applied to the BLOB or CLOBTYPE only when it is used in a table.