SecureFiles: The New LOBs

There are usually two approaches to store none stuctured or semi-structured form Examples include pictures, word processing documents, spreadsheets, XML files, and so on.: The data is stored in the database as LOB fields (BLOB for binary and CLOB for character data), or in OS files with the references to the files stored in the database.

Let see the SecureFiles: The New LOBs in 11G.

CREATE TABLE Account(
  id number(20) NOT NULL,
  field3 clob,
  field4 varchar2(255) NOT NULL,
  field2 varchar2(255) NOT NULL,
  field1 varchar2(255) NOT NULL,
  field5 number(20) NOT NULL,
  field6 date NOT NULL,
  field7 number(20) NOT NULL,
  field8 number(1) NOT NULL,
  constraint PK_ACCOUNT PRIMARY KEY  (id)
   )
   tablespace users
   lob (field3)                             
store as securefile
(
        tablespace users
        enable storage in row
        chunk 4096
        pctversion 20
        nocache
        nologging
)
;

 

use the sqlldr load some data into table.

then select clob column:

SQL> select FIELD3 from account;

FIELD3
--------------------------------------------------------------------------------
DZcLHm6H2iDNnvjU7TafFA==
5nBoqMWLF+w=
bbv+dzukljA=
/I67FDRQc7o=

 

You can compress the values stored in the LOBs using the following SQL:

SQL> alter table account
  2  modify lob(field3)
  3  (compress high);

Table altered.
there is a third compression option in addition to HIGH and MEDIUM: LOW.

SQL> alter table account
  2  modify lob(field3)
  3  (nocompress);

Table altered.

One of the advantages of storing unstructured data in OS files instead of database resident objects is the facility of caching. Files can be cached in the operating system's file buffers.

SQL> alter table account
  2  modify lob(field3)
  3  (cache);

Table altered.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值