日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

oracle 提示存在lob,案例:Oracle数据库临时文件特别大 commit后lob字段使用临时表空...

發布時間:2025/3/15 数据库 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 oracle 提示存在lob,案例:Oracle数据库临时文件特别大 commit后lob字段使用临时表空... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

測試結果$ ./test1.sh

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Oct 12 10:04:39 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

SQL> Connected.

SQL> drop user xifenfei cascade

*

ERROR at line 1:

ORA-01918: user 'XIFENFEI' does not exist

Grant succeeded.

SQL>

Revoke succeeded.

SQL> SQL> SQL> Connected.

SQL>

TO_NCLOB('A')

--------------------------------------------------------------------------------

a

SQL> SQL>

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Oct 12 10:04:39 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected.

USERNAME USER SESSION_ADDR

------------------------------ ------------------------------ ----------------

SESSION_NUM SQLADDR SQLHASH SQL_ID

----------- ---------------- ---------- -------------

TABLESPACE CONTENTS SEGTYPE SEGFILE# SEGBLK#

------------------------------- --------- --------- ---------- ----------

EXTENTS BLOCKS SEGRFNO#

---------- ---------- ----------

xifenfei xifenfei 07000002F96ECB30

10152 07000002AE1C36E0 1362191183 9z69tsx8m2sug

TEMP TEMPORARY LOB_DATA 201 3465

1 128 1

SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SQL>

Commit complete.

SQL> SQL>

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Oct 12 10:04:39 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected.

USERNAME USER SESSION_ADDR

------------------------------ ------------------------------ ----------------

SESSION_NUM SQLADDR SQLHASH SQL_ID

----------- ---------------- ---------- -------------

TABLESPACE CONTENTS SEGTYPE SEGFILE# SEGBLK#

------------------------------- --------- --------- ---------- ----------

EXTENTS BLOCKS SEGRFNO#

---------- ---------- ----------

xifenfei xifenfei 07000002F96ECB30

10152 07000002AE1C36E0 1362191183 9z69tsx8m2sug

TEMP TEMPORARY LOB_DATA 201 3465

1 128 1

SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

--測試腳本2

$ ./test2.sh

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Oct 12 10:03:56 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

SQL> Connected.

SQL>

Session altered.

SQL>

TO_NCLOB('A')

--------------------------------------------------------------------------------

a

SQL> SQL>

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Oct 12 10:03:56 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected.

no rows selected

SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SQL>

Commit complete.

SQL> SQL>

SQL*Plus: Release 10.2.0.5.0 - Production on Fri Oct 12 10:03:56 2012

Copyright (c) 1982, 2010, Oracle. All Rights Reserved.

Connected.

no rows selected

SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

1.Without event 60025 set (before and after commit):都出現v$tempseg_usage中存在對應記錄,而且提交后不能釋放Temp LOB space

2.With event 60025 set (before and after commit):都未現v$tempseg_usage中存在對應記錄,證明提交后釋放Temp LOB space

Oracle研究中心解決方案

通過上面的試驗證明我們可以通過設置event 60025來解決該版本的會話提交后Temp LOB space不能被回收的問題.

我們可以通過在session級別使用”alter session set events ’60025 trace name context forever’;”來實現。如果想實現全庫級別的,但是因為event 60025不能通過system設置生效,所以我們可以通過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;

/

注意這個是ORCLE bug(Bug 5723140 – Temp LOB space not released after commit [ID 5723140.8]),從10.2.0.4開始雖然已經修復了該bug,但是默認情況下:為了更加高效的利用temp,在session未斷開前,不自動釋放temp 空間,可以通過設置event 60025來強制會話在commit之后就立即釋放temp space

-----------------溫馨提示--------------------

操作有風險,動手需謹慎

Oracle研究中心

http://www.oracleplus.net

本文由大師惜分飛原創分享,轉載請盡量保留本站網址

總結

以上是生活随笔為你收集整理的oracle 提示存在lob,案例:Oracle数据库临时文件特别大 commit后lob字段使用临时表空...的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。