Oracle中如何从BasicFile迁移到SecureFile
2009-04-17 13:13:04 来源:WEB开发网SET SERVEROUTPUT ON修改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.
报告2 修改许多SecureFile LOB后查询DBA_LOB_PARTITIONS返回的结果
BasicFile and SecureFile LOB Partitions
(from DBA_LOB_PARTITIONS)
Stored in StoredDeDupli-
Table Column Partition Cacheing In Row Encrypted Compressed cated SecureFile
---------------- ------------ ------------ ---------- ---------- ---------- ---------- --------
SECURE_TICKETS DOCUMENT STS_OTHER NOYES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_CLOSED NOYES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_OPEN NOYES NONE NONE NONE NO
SECURE_TICKETS DOCUMENT STS_PENDING NOYES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_OTHER NOYES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_CLOSED NOYES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_PENDING NOYES NONE NONE NONE NO
SECURE_TICKETS SCRNIMG STS_OPEN NOYES NONE NONE NONE NO
TICKETS DOCUMENT STS_OTHER YES NONONOLOB YES
TICKETS DOCUMENT STS_PENDING YES NONONOLOB YES
TICKETS DOCUMENT STS_CLOSED YES NONONOLOB YES
TICKETS DOCUMENT STS_OPEN YES NONONONOYES
TICKETS SCRNIMG STS_PENDING CACHEREADS NONOHIGH NOYES
TICKETS SCRNIMG STS_OPEN CACHEREADS NONOMEDIUM NOYES
TICKETS SCRNIMG STS_CLOSED CACHEREADS NONOHIGH NOYES
TICKETS SCRNIMG STS_OTHER CACHEREADS NONOHIGH NOYES
最后,请记住任何对LOB属性进行修改都只会影响到新创建的LOB或新修改的LOB,例如,将列TRBTKT.SECURE_TICKETS.SCRNIMG的压缩方法从COMPRESS修改为NOCOMPRESS不会影响到现有的LOB条目。
更多精彩
赞助商链接