在Oracle中增加使用者限制

來源:互聯網
上載者:User

今天在項目開發中,探索資料庫串連數過多,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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.