今天在項目開發中,發現數據庫連接數過多,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
本文出自:億恩科技【www.laynepeng.cn】
服務器租用/服務器托管中國五強!虛擬主機域名注冊頂級提供商!15年品質保障!--億恩科技[ENKJ.COM]
|