Query SQL statements being executed by Oracle

Source: Internet
Author: User
Query the SQL statement being executed by Oracle and the user who executes this statement. view the calling program of the initiator of the SQL statement being executed. Check that the current oracle Lock Object ends and the current Lock Object does not have SELECTb. sidoracleID, B. username: the username used to log on to Oracle. serial #, spid Operating System ID, paddr, SQL _text SQL being executed, B. ma

Query the SQL statement being executed by Oracle and the user who executes this statement. view the calling program of the initiator of the SQL statement being executed. Check that the current oracle Lock Object ends and the current Lock Object does not have SELECT B. sid oracleID, B. username: the username used to log on to Oracle. serial #, spid Operating System ID, paddr, SQL _text SQL being executed, B. ma

Query the SQL statement being executed by Oracle and the user who executes the statement
View the calling program of the initiator of the SQL statement being executed
Find the current oracle locked object
End the current Lock Object <无>
SELECT B. sid oracleID, B. username: the username used to log on to Oracle. serial #, spid Operating System ID, paddr, SQL _text SQL being executed, B. machine computer name FROM v $ process a, v $ session B, v $ sqlarea cWHERE. addr = B. paddr AND B. SQL _hash_value = c. hash_value
Select osuser computer logon identity, PROGRAM where PROGRAM initiates a request, USERNAME used to log on to the system, SCHEMANAME, B. cpu_Time cpu time, STATUS, B. SQL _TEXT: sqlFROM V $ session aleft join v $ SQL B ON. SQL _ADDRESS = B. address and. SQL _HASH_VALUE = B. HASH_VALUEORDER BY B. cpu_time DESC
SELECT l. session_id sid, s. serial #, l. locked_mode lock mode, l. oracle_username Login User, l. OS _user_name: username of the login machine, s. machine name, s. terminal user name, o. object_name: name of the locked object, s. logon_time log on to the database FROM v $ locked_object l, all_objects o, v $ session sWHERE l. object_id = o. object_id AND l. session_id = s. sidORDER BY sid, s. serial #;
alter system kill session 'sid, s.serial#‘;

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.