View the connection status of the Oracle database

Source: Internet
Author: User

 

DBAs should regularly check the database connection to check whether the number of sessions established with the database is normal. If too many connections are established, the database resources will be consumed. At the same time, DBA may need to manually clean up some "dead" connections. The following SQL statements List the sessions created by the current database: Select Sid, serial #, username, program, machine, status
From v $ session; output result: Sid serial # username program machine status
-------------------------------------------------------
1 1 oracle. EXE work3 active
2 1 oracle. EXE work3 active
3 1 oracle. EXE work3 active
4 1 oracle. EXE work3 active
5 3 oracle. EXE work3 active
6 1 oracle. EXE work3 active
7 1 oracle. EXE work3 active
8 27 sys sqlplus. EXE workgroup/work3 active
11 5 Dbsnmp dbsnmp.exe workgroup/work3 inactive
The ID of the Sid session (Session); serial # session serial number, which is used together with Sid to uniquely identify a session; username is the user name used to establish the session; the tool used by the program session to connect to the database; Status indicates the current session status. Active indicates that the session is executing some tasks, and inactive indicates that the current session has not performed any operations; if the DBA wants to manually disconnect a session, execute: Alter system kill session 'sid, serial # '; note: In the preceding example, the session whose Sid is 1 to 7 (the username column is empty, is the background process of Oracle. do not perform any operations on these sessions.
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.