SQL statement used to query connections in Oracle databases

Source: Internet
Author: User
Query the connection information in the database. SQL _COMMAND is an SQL statement that can release A process: selectA. SID, B. SPID, a. SERIAL #, A. lockwait, A. USERNAME,.

Query the connection information in the database. SQL _COMMAND is an SQL statement that can release A process: select A. SID, B. SPID, a. SERIAL #, A. lockwait, A. USERNAME,.

Query the connection information in the database. SQL _COMMAND is an SQL statement that can release a process:

Select. SID, B. SPID,. SERIAL #,. lockwait,. USERNAME,. OSUSER,. logon_time,. last_call_et/3600 LAST_HOUR,. STATUS,
'Orakill' | sid | ''| spid HOST_COMMAND,
'Alter system kill session ''' | A. sid | ',' | A. SERIAL # | ''' SQL _COMMAND
From v $ session A, V $ process B where A. PADDR = B. ADDR AND SID> 6 and a. USERNAME = 'sbapp ';
Query database connections by user and machine Name:
SELECT username, machine, program, status, COUNT (machine)
Number of connections
FROM v $ session
Group by username, machine, program, status
Order by machine;
In the end database, A connection statement is as follows: '192 3' is '| A. sid |', '| A. SERIAL # |'
Alter system kill session '2017 3'

,

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.