|
第三阶段New Feature/OCM Exam Preparation(31-45)- CREATE TABLE sh.func_spec(
- id number, doc CLOB ENCRYPT USING 'AES128' )
- LOB(doc) STORE AS SECUREFILE
- (DEDUPLICATE LOB CACHE NOLOGGING);
- select * from dba_lobs l where l.owner='SH' and l.table_name like 'FUNC_SPEC%';
- CREATE TABLE sh.func_spec1(
- id number, doc CLOB ) ;
-
- CREATE TABLE sh.test_spec (
- id number, doc CLOB)
- LOB(doc) STORE AS SECUREFILE
- (COMPRESS HIGH KEEP_DUPLICATES CACHE NOLOGGING);
- select * from dba_lobs l where l.owner='SH' and
- l.table_name='TEST_SPEC';
-
- CREATE TABLE sh.func_spec2(
- id number, pic BLOB ENCRYPT USING 'AES128' )
- LOB(pic) STORE AS SECUREFILE
- (DEDUPLICATE LOB CACHE NOLOGGING);
-
- ---SQL> alter system set encryption wallet c
- create directory dir1 as '/home/oracle/dir1';
- grant read,write on directory dir1 to sh;
- CREATE OR REPLACE PROCEDURE sh.proc_blob ( p_1 number,
- p_dir VARCHAR2,
- p_file VARCHAR2)
- IS
- v_f BFILE;
- v_b blob;
- BEGIN
- INSERT INTO sh.func_spec2 values(p_1, EMPTY_BLOB ()) RETURN pic into v_b;
- v_f := BFILENAME (p_dir, p_file);
- DBMS_LOB.FILEOPEN (v_f, DBMS_LOB.FILE_READONLY);
- DBMS_LOB.LOADFROMFILE (v_b, v_f, DBMS_LOB.GETLENGTH (v_f));
- DBMS_LOB.FILECLOSE (v_f);
- commit;
- end;
-
-
-
- select * from dba_errors e where e.name='PROC_BLOB';
-
-
- begin
- sh.proc_blob (1000,'DIR1','GreenMeadow.jpg');
- end;
-
-
- select * from sh.func_spec2;
-
-
复制代码
- alter TABLE sh.func_spec move tablespace users
- LOB (doc) store as
- ( tablespace example );
- alter table sh.func_spec1 enable row movement ;
- alter table sh.func_spec1 modify lob (doc) ( shrink space );
- create table sh.tab1 (id number not null, c clob)
- partition by range(id)
- (partition p1 values less than (100) tablespace users lob(c) store as lobp1,
- partition p2 values less than (200) tablespace users lob(c) store as lobp2,
- partition p3 values less than (300) tablespace users lob(c) store as lobp3);
-
-
- select * from dba_LOB_PARTITIONS lp where
- lp.table_owner='SH' ;
-
- select * from dba_PART_LOBS pl
- where pl.table_owner='SH';
复制代码
|
|