View the number of oracle connections

Source: Internet
Author: User

SQL> Select count (*) from v $ session where status = 'active ';
COUNT (*)
----------
20
SQL> Select count (*) from v $ session;
COUNT (*)
----------
187
SQL> show parameter processes;
NAME TYPE VALUE
---------------------------------------------------------
Aq_tm_processes integer 0
Db_writer_processes integer 1
Gcs_server_processes integer 0
Job_queue_processes integer 10
Log_archive_max_processes integer 2
Processes integer 450
SQL>
Concurrency refers to active, I SEE
SQL> select count (*) from v $ session # Number of connections
SQL> Select count (*) from v $ session where status = 'active' # number of concurrent connections
SQL> show parameter processes # maximum connection
SQL> alter system set processes = value scope = spfile; restart the database # modify the connection
One session of a unix user corresponds to an operating system process.
Windows is embodied in the thread
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, database resources will be consumed. in addition, DBAs 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
Where,
ID of the SID session (session;
SERIAL # session SERIAL number, which is used together with SID to uniquely identify a session;
USERNAME: the user name used to establish the session;
What tool is used to connect to the database using the PROGRAM session;
STATUS: the STATUS of the current session. ACTIVE indicates that the session is executing some tasks. INACTIVE indicates that the current session has not executed any operations;
If the DBA wants to manually disconnect a session, execute:
Alter system kill session \ 'sid, SERIAL #\';
Note: In the preceding example, sessions with SID ranging from 1 to 7 (the USERNAME column is empty) are the background processes 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.