Oracle dbms_lob如何释放临时表空间

前端之家收集整理的这篇文章主要介绍了Oracle dbms_lob如何释放临时表空间前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

使用dbms_lob.freetemporary释放lob 临时表空间

declare

clb clob;
ch varchar2(32767);
k number;
begin
dbms_lob.createtemporary(clb,true,dbms_lob.call);
for i in 1..1500 loop
ch:=lpad('o',32767,'Y');
dbms_lob.writeappend(clb,length(ch),ch);
end loop;
k:=dbms_lob.getlength(clb);
dbms_lob.freetemporary(clb);
dbms_output.put_line('the clob length: '||k);
end;

/

当然,也可以这样:

alter session set events '60025 trace name context forever'
logon触发器来实现该功能
create or replace trigger sys.login_db after logon on database

begin
execute immediate 'alter session set events ''60025 trace name context forever''';
end;

猜你在找的Oracle相关文章