Pick (a)
1. View processes and Sessions parameters
Sql> Show parameter processes
NAME TYPE VALUE
Db_writer_processes Integer 1
Gcs_server_processes integer 0
Job_queue_processes Integer 10
Log_archive_max_processes Integer 2
Processes integer 50
Sql> Show Parameter Sessions
NAME TYPE VALUE
License_max_sessions integer 0
license_sessions_warning integer 0
Logmnr_max_persistent_sessions Integer 1
Sessions Integer 60
Shared_server_sessions integer
2. Modify processes and Sessions values
Sql> alter system set PROCESSES=300 Scope=spfile;
The system has changed.
Sql> alter system set sessions=335 Scope=spfile;
The system has changed.
3. Modify the processes and sessions values must restart the Oracle server to take effect
The number of connections to Oracle (sessions) is related to the number of processes (process) in its parameter file, and their relationships are as follows:
Sessions= (1.1*process+5)
Pick (ii)
Query the current process of the database for the number of connections:
Select COUNT (*) from v$process;
-----------------------------
To view the number of connections for the current session of the database:
Select COUNT (*) from v$session;
----------------------------------
To view the current number of connections for a user in a database:
Select COUNT (*) from v$session t where t.schemaname= ' username '
----------------------------------------
To view the number of concurrent connections for a database:
Select COUNT (*) from v$session where status= ' ACTIVE ';
-------------------------------------------
To view the session established by the current database:
Select Sid,serial#,username,program,machine,status from V$session; Maximum number of connections allowed for the query database:
Select value from v$parameter where name = ' processes ';
Or: Show parameter processes;
To modify the maximum number of connections allowed for a database:
alter system SET processes = Scope = SPFile;
(Need to restart the database to achieve the number of connections to modify)
To restart the database:
Shutdown immediate;
Startup
See which users are currently using the data:
Select Osuser,a.username,cpu_time/executions/1000000| | ' S ', Sql_fulltext,machine
From V$session A,v$sqlarea b
where a.sql_address = b.address
ORDER BY cpu_time/executions Desc;
Note: UNIX 1 user sessions correspond to one operating system process, while Windows embodies the thread.
Start Oracle
Su-oracle
Sqlplus system/pwd as SYSDBA/Enter SQL
Startup/Start Database
Lsnrctl start//start listening
Sqlplus "/as sysdba"
Shutdown immediate;
startup Mount;
ALTER DATABASE open;