11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 12 ■ DATA WAREHOUSING 521create table secure_docs( document_id number not null primary key,name varchar2(255) not null,edba_knowledgebase_category_id number,mime_type varchar2(128),doc_size number,dad_charset varchar2(128),last_updated date,content_type varchar2(128),blob_content blob)tablespace secure_docs_dlob (blob_content) store as securefile (deduplicate lobtablespace secure_docs_d enable storage in row chunk 8192 pctversion 10nocache logging)/Using SQL*Loader again, we are able to load the same 189KB document 100 times. Thededuplication option is truly working since the 100 inserts of the document are resident in the1MB tablespace. Let’s see the actual size of the SecureFiles LOB segment using the same space.sqlscript created earlier:SQL> @space secure_docsold 12: and table_name=upper('&v_tab');new 12: and table_name=upper('secure_docs');KB used: 200PL/SQL procedure successfully completed.Amazingly, LOBs in the SECURE_DOCS table, using the deduplication option, consume only200KB of space compared to the LOB column in the BASIC_DOCS table, which consumes about19MB of storage.By default, <strong>Oracle</strong> <strong>Database</strong> <strong>11</strong>g allows duplicate LOB data to be loaded inside the database.When you query the DBA_LOBS view, you will see several distinct values for the DEDUPLICATIONcolumn, as shown here:SQL> select table_name, column_name, deduplication, securefile2 from dba_lobs3* where table_name in ('DEFAULT_DOCS', 'SECURE_DOCS', 'DOCS')SQL> /TABLE_NAME COLUMN_NAME DEDUPLICATION SEC--------------- ------------- ------------- ------DEFAULT_DOCS BLOB_CONTENT NO YESSECURE_DOCS BLOB_CONTENT LOB YESDOCS BLOB_CONTENT NONE NO

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!