暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle 如何修改securefile Lob 的保留时间

原创 泡泡龙 2022-03-11
956
SQL> CREATE TABLE cust\_int (id number,c\_lob CLOB) LOB(c\_LOB) STORE AS SECUREFILE ;

Table created.

SQL>  
SQL> show parameter undo

NAME TYPE VALUE  
\------------------------------------ ----------- ------------------------------  
\_in\_memory\_undo boolean TRUE  
undo\_management string AUTO  
undo\_retention integer 900  
undo\_tablespace string UNDOTBS1

  
SQL>  
SQL>  
SQL> alter system set undo\_retention=1200;

System altered.

SQL> select TABLE\_NAME,COLUMN\_NAME,PCTVERSION,RETENTION,SECUREFILE,RETENTION\_TYPE,RETENTION\_VALUE from dba\_lobs where table\_name='CUST\_INT';

TABLE\_NAME COLUMN\_NAM PCTVERSION RETENTION   SEC   RETENTION\_TYPE RETENTION\_VALUE  
\-------------------- ---------- ---------- ---------- --- ------- ---------------  
CUST\_INT   C\_LOB                              YES   DEFAULT

SQL>  
SQL>

  
SQL> alter table cust\_int modify lob (c\_lob) (retention);

Table altered.

SQL> select TABLE\_NAME,COLUMN\_NAME,PCTVERSION,RETENTION,SECUREFILE,RETENTION\_TYPE,RETENTION\_VALUE from dba\_lobs where table\_name='CUST\_INT';

TABLE\_NAME COLUMN\_NAME PCTVERSION RETENTION SEC RETENTION\_TYPE RETENTION\_VALUE  
\------------------------------ ------------------------------ ---------- -----   
CUST\_INT    C\_LOB                           YES DEFAULT

SQL> **alter table cust\_int modify lob (c\_lob) (retention min 1200);**

Table altered.

SQL> select TABLE\_NAME,COLUMN\_NAME,PCTVERSION,RETENTION,SECUREFILE,RETENTION\_TYPE,RETENTION\_VALUE from dba\_lobs where table\_name='CUST\_INT';

TABLE\_NAME COLUMN\_NAME PCTVERSION RETENTION SEC RETENTION\_TYPE RETENTION\_VALUE  
\------------------------------ ------------------------------ ---------- ----------    
CUST\_INT   C\_LOB                            YES    MIN            **1200** 


非分区 LOB

select TABLE\_NAME,COLUMN\_NAME,SECUREFILE,RETENTION\_TYPE,RETENTION\_VALUE from dba\_lobs where table\_name='<table\_name>';


分区  LOB

select TABLE\_OWNER,COLUMN\_NAME,LOB\_NAME,DEF\_PCTVERSION,DEF\_RETENTION,DEF\_MINRET from dba\_part\_lobs where table\_name='<table\_name>';

LOB参数含义:

| RETENTION \[ { MAX | MIN integer | AUTO | NONE } \]  

RETENTION AUTO (default)

Use the value Oracle has automatic tuning as RETENTION period. A value of AUTO tells the system to manage the space as efficiently as possible weighing both time and space needs.

RETENTION MAX

The value of MAX specifies keeping old versions of LOB data blocks until the space used by segment has reached the size specified in the MAXSIZE parameter. If MAXSIZE is not specified, MAX behaves like AUTO.

RETENTION MIN (in seconds)

A value of MIN means to use a retention time of the specified seconds.

RETENTION NONE

A value of NONE means that there is no retention period and space can be reused in any way deemed necessary.

参考文档: How to change retention of securefile Lob segment (文档 ID 2175438.1)

最后修改时间:2022-03-14 14:48:06
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论