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

How to query current and historically executed sql based on session

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

How to query the current and historically executed sql according to the session? aiming at this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Share two scripts, mainly through the Oracle session sid to query the currently executed sql and some historically executed sql.

Sql executed based on sid query history

Select sql_text from v$sqlarea a minute vain session b where a.SQL_ID=b.PREV_SQL_ID and b.SID=&sid

Query the currently executed sql based on sid

Select sql_text from v$sqlarea where (hash_value, address) = (select sql_hash_value, sql_address from v$session where sid = & sid)

This is the answer to the question about how to query the current and historically executed sql according to the session. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

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