Turn: Check oracle database allows the maximum number of connections and the current number of connections

In view data connection is useful, written test code while checking procedures while releasing the database connection helps to analyze the system to optimize a robust program to.

1, view the current number of database connections

 select count (*) from v $ process; - the current number of database connections

2, the maximum number of connections allowed by the database

 select value from v $ parameter where name = 'processes'; - the maximum number of connections allowed by the database

3, the maximum number of connections that modify the database
 alter system set processes = 300 scope = spfile; - modify the maximum number of connections:

4, close / reopen the database
 shutdown immediate; - close the database
 startup; - restart the database

5, to see which users are currently using the data

OSUSER SELECT, a.username, CPU_TIME / Executions / 1000000 || 'S', b.sql_text, Machine
from the session $ V A, V B $ SQLAREA
WHERE a.sql_address = b.address 
Order by CPU_TIME / desc Executions; - see which users are currently using the data

6, - the current session connections

select count (*) from v $ session - the current session connections

7, the current number of concurrent connections

 select count (*) from v $ session where status = 'ACTIVE'; - concurrent connections

v$process:

This view provides information, are information oracle service process, there is no client-related information
service process divided into two categories, one back, one Dedicate / Shared Server
pid, Serial # This is the oracle assigned PID
SPID this is the operating system of pid
Program this is a process corresponding to the service operating system process name


v$session:

This view is mainly to provide information, a database connect, the
main message the client side, such as the following fields:
Machine on which machine
terminal using any terminal
osuser operating system users who
program what the client program through, such as TOAD
Process operating system assigned to the TOAD process ID
logon_time at what time
username to account to log what the oracle
command execution what type of SQL command
sql_hash_value SQL statement you

have some information about server-side:
PADDR ie server process v $ process in addr
server server dedicate / shared

Guess you like

Origin www.cnblogs.com/shirleyxuezi/p/11596601.html
Recommended