修改SecureFile属性
当我创建TRBTKT.SECURE_TICKETS表时,你可能注意到我为每个LOB列在它们对应的分区中执行压缩和重复删除,重要的是我还使用了ALTER TABLE语句进行修正,另外,如果需要的话,我还可以在每个LOB独立的分区上应用改变到SecureFile LOB。清单6中的代码显示了4个修改TRBTKT.TICKETS表的SecureFile LOB属性的例子,注意这个表现在已经用清单3中的代码和TRBTKT.SECURE_TICKETS表执行了交换,我也从DBA_PART_LOBS创建了一个报告显示在修改这些LOB属性前后的状态,结果输出如报告2所示。
清单6 管理SecureFile LOB属性
SQL> ALTER TABLE TRBTKT.TICKETS
SQL> MODIFY LOB(DOCUMENT) (NOCOMPRESS);
Table altered.
SQL> ALTER TABLE TRBTKT.TICKETS
SQL> MODIFY LOB(SCRNIMG) (KEEP_DUPLICATES);
Table altered.
SQL> ALTER TABLE TRBTKT.TICKETS
SQL> MODIFY PARTITION STS_PENDING LOB(SCRNIMG) (COMPRESS HIGH);
Table altered.
SQL> ALTER TABLE TRBTKT.TICKETS
SQL> MODIFY PARTITION STS_PENDING LOB(DOCUMENT) (DEDUPLICATE);
Table altered.
SQL> MODIFY LOB(DOCUMENT) (NOCOMPRESS);
Table altered.
SQL> ALTER TABLE TRBTKT.TICKETS
SQL> MODIFY LOB(SCRNIMG) (KEEP_DUPLICATES);
Table altered.
SQL> ALTER TABLE TRBTKT.TICKETS
SQL> MODIFY PARTITION STS_PENDING LOB(SCRNIMG) (COMPRESS HIGH);
Table altered.
SQL> ALTER TABLE TRBTKT.TICKETS
SQL> MODIFY PARTITION STS_PENDING LOB(DOCUMENT) (DEDUPLICATE);
Table altered.
报告2 修改许多SecureFile LOB后查询DBA_LOB_PARTITIONS返回的结果
BasicFile and SecureFile LOB Partitions
(from DBA_LOB_PARTITIONS)
Stored in Stored DeDupli-
Table Column Partition Cacheing In Row Encrypted Compressed cated SecureFile
---------------- ------------ ------------ ---------- ---------- ---------- ---------- --------
SECURE_TICKETS DOCUMENT STS_OTHER NO YES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_CLOSED NO YES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_OPEN NO YES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_PENDING NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_OTHER NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_CLOSED NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_PENDING NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_OPEN NO YES NONE NONE NONE NO
TICKETS DOCUMENT STS_OTHER YES NO NO NO LOB YES
TICKETS DOCUMENT STS_PENDING YES NO NO NO LOB YES
TICKETS DOCUMENT STS_CLOSED YES NO NO NO LOB YES
TICKETS DOCUMENT STS_OPEN YES NO NO NO NO YES
TICKETS SCRNIMG STS_PENDING CACHEREADS NO NO HIGH NO YES
TICKETS SCRNIMG STS_OPEN CACHEREADS NO NO MEDIUM NO YES
TICKETS SCRNIMG STS_CLOSED CACHEREADS NO NO HIGH NO YES
TICKETS SCRNIMG STS_OTHER CACHEREADS NO NO HIGH NO YES
(from DBA_LOB_PARTITIONS)
Stored in Stored DeDupli-
Table Column Partition Cacheing In Row Encrypted Compressed cated SecureFile
---------------- ------------ ------------ ---------- ---------- ---------- ---------- --------
SECURE_TICKETS DOCUMENT STS_OTHER NO YES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_CLOSED NO YES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_OPEN NO YES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_PENDING NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_OTHER NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_CLOSED NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_PENDING NO YES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_OPEN NO YES NONE NONE NONE NO
TICKETS DOCUMENT STS_OTHER YES NO NO NO LOB YES
TICKETS DOCUMENT STS_PENDING YES NO NO NO LOB YES
TICKETS DOCUMENT STS_CLOSED YES NO NO NO LOB YES
TICKETS DOCUMENT STS_OPEN YES NO NO NO NO YES
TICKETS SCRNIMG STS_PENDING CACHEREADS NO NO HIGH NO YES
TICKETS SCRNIMG STS_OPEN CACHEREADS NO NO MEDIUM NO YES
TICKETS SCRNIMG STS_CLOSED CACHEREADS NO NO HIGH NO YES
TICKETS SCRNIMG STS_OTHER CACHEREADS NO NO HIGH NO YES
最后,请记住任何对LOB属性进行修改都只会影响到新创建的LOB或新修改的LOB,例如,将列TRBTKT.SECURE_TICKETS.SCRNIMG的压缩方法从COMPRESS修改为NOCOMPRESS不会影响到现有的LOB条目。