【ORACLE】數據庫空閒1分鐘自動斷開

-- 開啓參數,建立概要文件
SQL> show parameter resource_limit;

NAME                                     TYPE         VALUE
------------------------------------ ----------- ------------------------------
resource_limit                             boolean         FALSE
SQL>
SQL> alter system set resource_limit=true;

System altered.

SQL> show parameter resource_limit;

NAME                                     TYPE         VALUE
------------------------------------ ----------- ------------------------------
resource_limit                             boolean         TRUE


SQL> create profile test_profile limit idle_time 1;

Profile created.

SQL> alter user scott profile test_profile;

User altered.
-- 測試登錄

[oracle@rac01 ~]$ sqlplus scott/redhat

SQL*Plus: Release 11.2.0.4.0 Production on 星期二 3月 6 17:02:38 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options

SQL> select * from dual;

D
-
X

SQL> /
select * from dual
*
ERROR at line 1:
ORA-02396: 超出最大空閒時間, 請從新鏈接

-- 刪除測試概要文件
SQL> select username,profile from dba_users where profile=' TEST_PROFILE';

USERNAME                       PROFILE
------------------------------ ------------------------------
SCOTT                                 TEST_PROFILE

SQL> drop profile test_profile cascade;

Profile dropped.





相關文章
相關標籤/搜索