【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.






posted @   __初  阅读(1689)  评论(0编辑  收藏  举报
编辑推荐:
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· 展开说说关于C#中ORM框架的用法!
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
点击右上角即可分享
微信分享提示