最近在用weblogic部署專案,同時用的是oracle資料庫,然後今天遇到一個問題:多個使用者連線資料庫連線不成功,有時提示被鎖住,經檢查發現一方面weblogic控制檯中資料來源的連線池配置沒有配置足夠的容量,另一方面是oracle資料庫沒有配足夠的連線數
1.weblogic控制檯修改如下
2.通過cmd命令修改資料庫連線數並重啟資料庫
C:\Users\Administrator>sqlplus sys/sys@192.168.13.211/oanet as sysdba SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 2月 9 11:57:01 2017 Copyright (c) 1982, 2005, Oracle. All rights reserved. ERROR: ORA-12560: TNS: 協議介面卡錯誤 請輸入使用者名稱: ERROR: ORA-12560: TNS: 協議介面卡錯誤 請輸入使用者名稱: ERROR: ORA-12560: TNS: 協議介面卡錯誤 SP2-0157: 在 3 次嘗試之後無法連線到 ORACLE, 退出 SQL*Plus C:\Users\Administrator>d: D:\>cd app D:\app>cd Administrator D:\app\Administrator>cd product D:\app\Administrator\product>cd 11.2.0 D:\app\Administrator\product\11.2.0>cd dbhome_1 D:\app\Administrator\product\11.2.0\dbhome_1>cd BIN D:\app\Administrator\product\11.2.0\dbhome_1\BIN>sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 Production on 星期四 2月 9 11:57:25 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. 連線到: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> show parameter processes NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ aq_tm_processes integer 1 db_writer_processes integer 1 gcs_server_processes integer 0 global_txn_processes integer 1 job_queue_processes integer 1000 log_archive_max_processes integer 4 processes integer 150 SQL> select count(*) from v$process; COUNT(*) ---------- 85 SQL> show parameter session 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 session_cached_cursors integer 50 session_max_open_files integer 10 sessions integer 248 shared_server_sessions integer SQL> select count(*) from v$session; COUNT(*) ---------- 82 SQL> alter system set processes=300 scope=spfile; 系統已更改。 SQL> alter system set sessions=300 scope=spfile; 系統已更改。 SQL> shutdown immediate 資料庫已經關閉。 已經解除安裝資料庫。 ORACLE 例程已經關閉。 SQL> startup ORACLE 例程已經啟動。 Total System Global Area 1352876032 bytes Fixed Size 2281056 bytes Variable Size 922747296 bytes Database Buffers 419430400 bytes Redo Buffers 8417280 bytes 資料庫裝載完畢。 資料庫已經開啟。 SQL> 修改linux系統下的oracle資料庫連線數: [oracle@localhost ~]$ sqlplus /nolog SQL*Plus: Release 11.2.0.4.0 Production on Fri May 5 10:26:24 2017 Copyright (c) 1982, 2013, Oracle. All rights reserved. SQL> conn /as sysdba ???? SQL> show parameter session 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 session_cached_cursors integer 50 session_max_open_files integer 10 sessions integer 248 shared_server_sessions integer SQL> show parameter process NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ aq_tm_processes integer 1 cell_offload_processing boolean TRUE db_writer_processes integer 1 gcs_server_processes integer 0 global_txn_processes integer 1 job_queue_processes integer 1000 log_archive_max_processes integer 4 processes integer 150 processor_group_name string SQL> alter system set processes=400 scope=spfile; ?????? SQL> alter system set sessions=450 scope=spfile; ?????? SQL> show parametersession SP2-0735: ??? SHOW ???? "parameters..." SQL> shutdown immediate; ???????? ???????? ORACLE ??????? SQL> startup ORACLE ??????? Total System Global Area 784998400 bytes Fixed Size 2257352 bytes Variable Size 599789112 bytes Database Buffers 176160768 bytes Redo Buffers 6791168 bytes ???????? ???????? SQL>