Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction to two modes of oracle global temporary table

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article introduces the knowledge of "introduction of two modes of oracle Global temporary Table". Many people will encounter such a dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

There are two modes of the global temporary table, one is based on the session level, the data between the session and the session is isolated, when the session segment is dropped, the data will be emptied, and the other is based on the transaction level, the global temporary table uses the location of the temporary table space when executing commit or rollback data.

Global temporary tables are not logged, but they are not secure for data.

-construct a global temporary table based on SESSION (if you exit session, the table record will be emptied automatically)

Drop table ljb_tmp_session

Create global temporary table ljb_tmp_session on commit preserve rows as select * from dba_objects where 1: 2;-- temporary table based on session

Select table_name,temporary,duration from user_tables where table_name='LJB_TMP_SESSION'

-- construct a global temporary table based on transactions (after commit commits, the records in the table will be emptied automatically if session is exited)

Drop table ljb_tmp_transaction

Create global temporary table ljb_tmp_transaction on commit delete rows as select * from dba_objects where 1item2;-transaction-based temporary tables

Select table_name, temporary, DURATION from user_tables where table_name='LJB_TMP_TRANSACTION'

Insert all

Into ljb_tmp_transaction

Into ljb_tmp_session

Select * from dba_objects

Select session_cnt,transaction_cnt from (select count (*) session_cnt from ljb_tmp_session)

(select count (*) transaction_cnt from ljb_tmp_transaction)

Commit

Select session_cnt,transaction_cnt from (select count (*) session_cnt from ljb_tmp_session)

(select count (*) transaction_cnt from ljb_tmp_transaction)

Disconnect

Connect ljb/ljb

Select session_cnt,transaction_cnt from (select count (*) session_cnt from ljb_tmp_session)

(select count (*) transaction_cnt from ljb_tmp_transaction)

This is the end of the introduction to the two modes of the oracle global temporary table. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report