ORACLE查看并修改最大連接數(shù)的具體步驟
第一步,在cmd命令行,輸入sqlplus
第二步,根據(jù)提示輸入用戶名與密碼
1. 查看processes和sessions參數(shù)
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. 修改processes和sessions值
SQL> alter system set processes=300 scope=spfile;
系統(tǒng)已更改。
SQL> alter system set sessions=335 scope=spfile;
系統(tǒng)已更改。
3. 修改processes和sessions值必須重啟oracle服務器才能生效
ORACLE的連接數(shù)(sessions)與其參數(shù)文件中的進程數(shù)(process)有關,它們的關系如下:
sessions=(1.1*process+5)
摘(二)
查詢數(shù)據(jù)庫當前進程的連接數(shù):
select count(*) from v$process;
查看數(shù)據(jù)庫當前會話的連接數(shù):
elect count(*) from v$session;
查看數(shù)據(jù)庫的并發(fā)連接數(shù):
select count(*) from v$session where status='ACTIVE';
查看當前數(shù)據(jù)庫建立的會話情況:
select sid,serial#,username,program,machine,status from v$session;
查詢數(shù)據(jù)庫允許的最大連接數(shù):
select value from v$parameter where name = 'processes';
或者:show parameter processes;
修改數(shù)據(jù)庫允許的最大連接數(shù):
alter system set processes = 300 scope = spfile;
(需要重啟數(shù)據(jù)庫才能實現(xiàn)連接數(shù)的修改)
重啟數(shù)據(jù)庫:
shutdown immediate;
startup;
查看當前有哪些用戶正在使用數(shù)據(jù):
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對應一個操作系統(tǒng)process,而Windows體現(xiàn)在線程。
啟動oracle
su - oracle sqlplus system/pwd as sysdba //進入sql startup //啟動數(shù)據(jù)庫 lsnrctl start //啟動監(jiān)聽 sqlplus "/as sysdba" shutdown immediate; startup mount; alter database open;
相關文章
Oracle 輕量級實時監(jiān)控工具 oratop詳解
這篇文章主要介紹了Oracle 輕量級實時監(jiān)控工具 oratop,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2021-03-03

