View the maximum number of connections and current connections allowed for an Oracle database

Source: Internet
Author: User


Tags: Oracle database2017-01-04 14:40 6709 People read comments (0) favorite reports Classification:database (Wuyi)

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

It is useful to look at the connection of the data, finish writing the program while testing the code side to see the release of database connections to help optimize the analysis of a robust system program.

1. View the current number of database connections


Select COUNT (*) from v$process; --Current number of database connections

2. Maximum number of connections allowed by the database


Select value from v$parameter where name = ' processes '; --Maximum number of connections allowed for the database

3, Modify the maximum number of database connections

alter system SET processes = + scope = SPFile; --Modify the maximum number of connections:

4. Close/Restart the database

Shutdown immediate; --Close the database
Startup --Restart Database

5. see which users are currently using the data

Select Osuser, a.username, cpu_time/executions/1000000| | ' S ', B.sql_text, machine
From V$session A, V$sqlarea b
where A.sql_address =b.address
ORDER BY cpu_time/executions Desc; --See which users are currently using the data

6, --The current session connection number

Select COUNT (*) from V$session--current session connection number

7. Current number of concurrent connections


Select COUNT (*) from v$session where status= ' ACTIVE '; --Number of concurrent connections

V$process:


This view provides information that is information about the Oracle service process and does not have client program-related information
Service process is divided into two categories, one is the background, one is dedicate/shared server
PID, serial# This is the PID assigned by Oracle
SPID This is the PID of the operating system
Program This is the operating system process name that corresponds to the service process

V$session:


This view primarily provides information on a database connect,
This is primarily client-side information, such as the following fields:
Machines on which machine
Terminal what terminal to use
Who is the Osuser operating system user?
Program through what client programs, such as Toad
Process number assigned to toad by the processes operating system
Logon_time at what time
Username with what Oracle account is logged in
What type of SQL command was executed by command
Sql_hash_value SQL statement Information

Some are server-side information:
Paddr is the addr of the server process in V$process
Server server is dedicate/shared

View the maximum number of connections and current connections allowed for an Oracle database

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.