How to find out the SQL statements being issued at the front end

Source: Internet
Author: User

Q: How can I find out the SQL statement being issued at the front end?

A:The procedure is as follows:

Software environment:

1. Windows 2000 + ORACLE 8.1.6
2. ORACLE installation path: C: \ ORANT

Implementation Method:

You can use the following statement:

select user_name,sql_text 
from v$open_cursor
where sid in (select sid from
(select sid,serial
from v$session
where status=''''ACTIVE''''))

Subquery:

select sid,serial from v$session 
where status=''''ACTIVE''''

This is the sid of the non-active session.

SQL> desc v $ open_cursor
Name null type
------------------------------------
Saddr raw (4)
SID NUMBER
USER_NAME VARCHAR2 (30)
Address raw (4)
HASH_VALUE NUMBER
SQL _TEXT VARCHAR2 (60)

Related Articles]

  • How to share the identity space of an Oracle Database
  • Understand Oracle database structure components from the inside
  • Oracle basic syntax collection

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.