在oracle中增加用戶限制

     今天在項目開發中,發現數據庫連接數過多,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文件作用於指定用戶

 

 

在數據庫中的實際操作如下:

 

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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章