使用Oracle基於session的暫存資料表要注意的問題

來源:互聯網
上載者:User

使用Oracle基於session的暫存資料表要注意的問題

在Oracle中有兩種暫存資料表,一種是基於session,就是當出現commit之後,資料就會被清空;一種是基於session,當session斷開後,資料會被清空。

--基於事務的暫存資料表

create global temporary table test
(
  ID  number
)
on commit delete rows;


--基於session的暫存資料表
create global temporary table test
(
  ID  number
)

on commit preserve rows;

  如果你的系統架構是三層架構,有串連池的,如  weblogic+oracle這種架構,其實session是不會退出的,只是請求完畢後,將session還給串連池。如果你操作基於session的暫存資料表,每次操作完表後不做刪除操作,那資料會累積。最好的做法是使用完以後truncate,今天在測試環境上使用系統測試發現的問題。

在CentOS 6.4下安裝Oracle 11gR2(x64)

Oracle 11gR2 在VMWare虛擬機器中安裝步驟

Debian 下 安裝 Oracle 11g XE R2

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.