oracle modifies the maximum number of concurrent

SQL> show parameter processes;

 

NAME     TYPE VALUE

------------------------------------ ----------- ------------------------------

aq_tm_processes     integer 0

db_writer_processes     integer 2

gcs_server_processes     integer 0

global_txn_processes     integer 1

job_queue_processes     integer 0

log_archive_max_processes     integer 5

processes     integer 150

SQL> show parameter sessions;

 

NAME     TYPE VALUE

------------------------------------ ----------- ------------------------------

java_max_sessionspace_size     integer 0

java_soft_sessionspace_limit     integer 0

license_max_sessions     integer 0

license_sessions_warning     integer 0

sessions     integer 256

shared_server_sessions     integer

SQL> alter system set processes = 300 scope = spfile;

 

System altered.

 

SQL> alter system set processes = 1000 scope = spfile;

 

System altered.

 

SQL> alter system set sessions=1100  scope=spfile;

 

System altered.

 

SQL> shutdown immshutdown immediate;

SP2-0717: illegal SHUTDOWN option

SQL> 

SQL> 

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.

 

Total System Global Area 1.3429E+10 bytes

Fixed Size    2217992 bytes

Variable Size 8589936632 bytes

Database Buffers 4831838208 bytes

Redo Buffers    4661248 bytes

Database mounted.

Database opened.

SQL> 

 

 

The number of ORACLE connections (sessions) is related to the number of processes in its parameter file (process), and their relationship is as follows:

sessions=(1.1*process+5)

Extract (2)

Query the number of connections in the current process of the database:

select count(*) from v$process;

View the number of connections for the current session of the database:

elect count(*) from v$session;

Check the number of concurrent connections to the database:

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

View the session status established by the current database:

select sid,serial#,username,program,machine,status from v$session;

Query the maximum number of connections allowed to the database:

select value from v$parameter where name = 'processes';

Or: show parameter processes;

Modify the maximum number of connections allowed by the database:

alter system set processes = 300 scope = spfile;

(需要重启数据库才能实现连接数的修改)

重启数据库:

shutdown immediate;

startup;

查看当前有哪些用户正在使用数据:

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;

备注:UNIX 1个用户session对应一个操作系统process,而Windows体现在线程。

启动oracle

su - oracle

sqlplus system/pwd as sysdba   //进入sql

startup                                      //启动数据库

lsnrctl start                               //启动监听

sqlplus "/as sysdba"

shutdown immediate;

startup mount;

 

alter database open;

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326219219&siteId=291194637