萬盛學電腦網

 萬盛學電腦網 >> 數據庫 >> oracle教程 >> 如何修改Oracle並發連接數的設置

如何修改Oracle並發連接數的設置

   不能連接Oracle數據庫了,提示相關的錯誤

  OERR: ORA-12519 TNS:no appropriate service handler found

  客戶端連接間歇性失敗,報錯ORA-12519

  Cause: the listener could not find any available service handlers that are

  appropriate for the client connection.

  Action: run "lsnrctl services" to ensure that the instance(s) have registered

  with the listener, and are accepting connections. 檢查lsnrctl service ,instance已經注冊,

  狀態顯示ready時,可以連接。

  When the listener believes the current number of connections has reached maximum load,

  it may set the state of the service handler for an instance to "blocked" and begin refusing

  incoming client connections with either of the following errors: ora-12519 or ora-12516

  采用服務動態注冊的方式,由PMON 通過SERVICE_UPDATE 來得到目前連接情況,但SERVICE_UPDATE 有時間間隔,

  所以,listener顯示的連接數和當前實際的連接數可能不同。

  查詢解決方法:

  查看一下數據庫現有的進程數,是否已經達到參數processes的大小。

  1.select count(*) from v$process; 取得數據庫目前的進程數。

  2.select value from v$parameter where name = 'processes'; 取得進程數的上限。

  3.如已達到上限,修改initSID.ora中的processes的大小。

  4.重新啟動數據庫到nomount狀態下,執行create spfile from pfile; 並startup open。

  查詢數據庫自啟動以來最大的並發數量

  修改最大連接數:

  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;

copyright © 萬盛學電腦網 all rights reserved