時(shí)間:2015-06-28 00:00:00 來源:IT貓撲網(wǎng) 作者:網(wǎng)管聯(lián)盟 我要評(píng)論(1)
Oracle服務(wù)器連接數(shù)過多會(huì)當(dāng)?shù)?,把連接數(shù)過多的客戶機(jī)網(wǎng)線拔出后,在遠(yuǎn)程Oracle上依然還會(huì)保留此用戶的連接數(shù),久久不能釋放,上網(wǎng)查了下可以以下面方法解決。
通過profile可以對(duì)用戶會(huì)話進(jìn)行一定的限制,比如IDLE時(shí)間。
將IDLE超過一定時(shí)間的會(huì)話斷開,可以減少數(shù)據(jù)庫端的會(huì)話數(shù)量,減少資源耗用。
使用這些資源限制特性,需要設(shè)置resource_limit為TRUE:
[oracle@test126 udump]$ sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Fri Oct 13 07:58:21 2006
Copyright (c) 1982, 2005, Oracle.? All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning and Data Mining options
SQL> show parameter resource
NAME? TYPE? VALUE
------------------------------------ ----------- ------------------------------
resource_limit??? boolean??? TRUE
resource_manager_plan??? string
該參數(shù)可以動(dòng)態(tài)修改:
SQL> alter system set resource_limit=true;
System altered.
數(shù)據(jù)庫缺省的PROFILE設(shè)置為:
SQL> SELECT * FROM DBA_PROFILES;
PROFILE? RESOURCE_NAME? RESOURCE LIMIT
-------------------- -------------------------------- -------- ---------------
DEFAULT? COMPOSITE_LIMIT????? KERNEL? UNLIMITED
DEFAULT? SESSIONS_PER_USER??? KERNEL? UNLIMITED
DEFAULT? CPU_PER_SESSION????? KERNEL? UNLIMITED
DEFAULT? CPU_PER_CALL? KERNEL? UNLIMITED
DEFAULT? LOGICAL_READS_PER_SESSION? KERNEL? UNLIMITED
DEFAULT? LOGICAL_READS_PER_CALL??? KERNEL? UNLIMITED
DEFAULT? IDLE_TIME????? KERNEL? UNLIMITED
DEFAULT? CONNECT_TIME? KERNEL? UNLIMITED
DEFAULT? PRIVATE_SGA??? KERNEL? UNLIMITED
DEFAULT? FAILED_LOGIN_ATTEMPTS????? PASSWORD 10
DEFAULT? PASSWORD_LIFE_TIME? PASSWORD UNLIMITED
PROFILE? RESOURCE_NAME? RESOURCE LIMIT
-------------------- -------------------------------- -------- ---------------
DEFAULT? PASSWORD_REUSE_TIME? PASSWORD UNLIMITED
DEFAULT? PASSWORD_REUSE_MAX? PASSWORD UNLIMITED
DEFAULT? PASSWORD_VERIFY_FUNCTION? PASSWORD NULL
DEFAULT? PASSWORD_LOCK_TIME? PASSWORD UNLIMITED
DEFAULT? PASSWORD_GRACE_TIME? PASSWORD UNLIMITED
16 rows selected.
創(chuàng)建一個(gè)允許3分鐘IDLE時(shí)間的PROFILE:
SQL> CREATE PROFILE KILLIDLE LIMIT IDLE_TIME 3;
Profile created.
新創(chuàng)建PROFILE的內(nèi)容:
SQL> col limit for a10
SQL> select * from dba_profiles where profile='KILLIDLE';
PROFILE????? RESOURCE_NAME? RESOURCE LIMIT
------------------------------ -------------------------------- -------- ----------
KILLIDLE??? COMPOSITE_LIMIT????? KERNEL? DEFAULT
KILLIDLE??? SESSIONS_PER_USER??? KERNEL? DEFAULT
KILLIDLE??? CPU_PER_SESSION????? KERNEL? DEFAULT
KILLIDLE??? CPU_PER_CALL? KERNEL? DEFAULT
KILLIDLE??? LOGICAL_READS_PER_SESSION? KERNEL? DEFAULT
關(guān)鍵詞標(biāo)簽:Oracle連接數(shù)
相關(guān)閱讀
熱門文章 Oracle中使用alter table來增加,刪除,修改列的語法 oracle中使用SQL語句修改字段類型-oracle修改SQL語句案例 誤刪Oracle數(shù)據(jù)庫實(shí)例的控制文件 為UNIX服務(wù)器設(shè)置Oracle全文檢索
人氣排行 oracle中使用SQL語句修改字段類型-oracle修改SQL語句案例 Oracle中使用alter table來增加,刪除,修改列的語法 ORACLE SQL 判斷字符串是否為數(shù)字的語句 ORACLE和SQL語法區(qū)別歸納(1) oracle grant 授權(quán)語句 ORACLE修改IP地址后如何能夠使用 如何加速Oracle大批量數(shù)據(jù)處理 Oracle刪除表的幾種方法