今天在項目開發中,探索資料庫串連數過多,Oracle中存在很多逾時串連。導致新增用戶端無法串連到資料庫。所以設定了強制釋放oracle串連屬性。
在網上查詢了設定說明如下:
sqlplus /nolog
開啟sqlplus
connect system/bianqiwei@orcltns as sysdba
使用具有dba許可權得使用者登陸oracle
show parameter resource_limit
顯示資源限定是否開啟,value為true是開啟,為false是關閉
alter system set resource_limit=true
如果未開啟,則使用此命令開啟資源限定功能
create profile profileName limit connect_time 60 idle_time 30
建立profile檔案,profileName任意起,connect_time設定串連超過多少分鐘後強制釋放,idle_time設定連續不活動的會話超過多少分鐘後強制釋放
alter user oracleUser profile profileName
將profile檔案作用於指定使用者 【LINUX公社 www.LinuxIDC.com 】
在資料庫中的實際操作如下:
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
[oracle@nsn-db-server ~]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Tue Dec 22 16:14:11 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
SQL> show parameter resource
NAME TYPE
------------------------------------ ---------------------------------
VALUE
------------------------------
resource_limit boolean
FALSE
resource_manager_plan string
SQL> alter system set resource_limit=true;
System altered.
SQL> create profile sbaplimit20091222 limit connect_time 60 idle_time 30
2
SQL> create profile sbaplimit20091222 limit connect_time 60 idle_time 30
2
SQL>
SQL> create profile sbaplimit20091222 limit connect_time 60 idle_time 30;
Profile created.
SQL> alter user sbap profile sbaplimit20091222_;
User altered.
SQL> exit