Subject: ORA-02396 when idle_time = unlimited

博客围绕Oracle出现的ORA-02396错误展开讨论。该错误在UNLIMITED idle_time且通过MTS连接时出现,建议检查DEFAULT profile设置。不同版本情况不同,如Oracle7相关问题在7.3.3修复,Linux特定版本有对应补丁。还提到设置IDLE_TIME = UNLIMITED可解决但并非理想方案。
Subject: ORA-02396 when idle_time = unlimited

RDBMS Version: 8.0.6.2.0
Operating System and Version: Solaris 2.6
Error Number (if applicable): ORA-02396
Product (i.e. SQL*Loader, Import, etc.): RDBMS
Product Version:

ORA-02396 when idle_time = unlimited

Hi,

My application has permanent connection to the database
thru dedicated server and issue SQL statement each 10 min.
The user account for this application has DEFAULT profile
and idle_time=unlimited.
The application has log file:

30-11-2000 23:30:15 execute SQL3 is OK
30-11-2000 23:40:15 execute SQL3 is OK
30-11-2000 23:50:16 execute SQL3 is OK
01-12-2000 00:00:16 Error while execute SQL3: ORA-02396: exceeded maximum idle time, please connect again (DBD/
ERROR: OCIStmtExecute)
Send email to pager 51102.
01-12-2000 00:00:18 Disconnect from dbi:Oracle:prod is okay
01-12-2000 00:00:19 Connected to dbi:Oracle:prod successfuly
01-12-2000 00:00:20 execute SQL3 is OK

Could you please explain why ORA-02396 received ?

We have resource_limit=true in the init.ora and profile
with idle_time=180 for other application users but this
user has no limitation.




Any comments would be appreciated.

Thank you in advance,
Boris Pishchick




From: Oracle, Reem Munakash 06-Dec-00 16:45
Subject: Re : ORA-02396 when idle_time = unlimited

The only report of ORA-02396 occurring with UNLIMITED idle_time is related to connecting through MTS. Double check your DEFAULT profile to make sure it is indeed set to UNLIMITED. If it is, we would need a reproducible test case.

Reem Munakash
Electronic Support



From: Daphne Clanton 19-Dec-00 20:59
Subject: Re : ORA-02396 when idle_time = unlimited

Reem,

We are having the same problem and we are running MTS. How can I stop this from happening?

Daphne Clanton




From: Oracle, Helen Schoone 22-Dec-00 14:35
Subject: Re : Re : ORA-02396 when idle_time = unlimited

Hi. Reem is out of the office. You do not mention your RDBMS version or platform. The confirmed report of this error related to MTS effected Oracle7 and was fixed in 7.3.3. Another report in Oracle8 was not reproducable by the customer.

As recommended by Reem, double check the profile limits and ensure that idle_time is set to unlimited. If it is, we would need a reproducable testcase.

Regards,
Helen
Oracle Support Services



From: John Donaldson 09-Jan-01 23:54
Subject: Re : ORA-02396 when idle_time = unlimited

Hi,
We're receiving the same problem. RESOURCE_LIMIT = TRUE,
and the IDLE_TIME = 66 in the default profile. Yet whenever a user connects they get disconnected after less than 1 minute. The only way to stop getting ORA-02396 is to set IDLE_TIME = UNLIMITED . This is not an acceptable solution for us.




From: Oracle, Helen Schoone 10-Jan-01 12:18
Subject: Re : Re : ORA-02396 when idle_time = unlimited

Hi. Per information in the iTAR referenced in your e-mail, a bug (1378168) has been identified. This bug is port-specific to Linux and is fixed in the 8.1.6.3 patchset release. There is also an individual patch which can be applied to 8.1.6.1.

It is best to use only one form of Support. That way we are not duplicating efforts and asking for the same information. As you have an iTAR open with support on this issue, I recommend you continue work with them.

Regards,
Helen
Oracle Support Services

你遇到的错误: ``` RMAN-03002: failure of startup command at 10/21/2025 10:30:52 RMAN-04014: startup failed: ORA-00845: MEMORY_TARGET not supported on this system ``` ### 错误解释: **ORA-00845: MEMORY_TARGET not supported on this system** 这个错误通常出现在使用 `MEMORY_TARGET` 或 `SGA_TARGET` 参数启动 Oracle 实例时,但系统的 `/dev/shm`(共享内存文件系统)大小不足或未正确挂载。 在 Linux 系统中,Oracle 使用 `/dev/shm` 来支持 Automatic Memory Management (AMM),即当设置了 `MEMORY_TARGET` 或 `MEMORY_MAX_TARGET` 时,Oracle 需要足够的共享内存空间。如果 `/dev/shm` 太小或者没有挂载,就会报 ORA-00845 错误。 --- ### 解决方案 #### ✅ 方法一:临时增加 `/dev/shm` 大小(重启后失效) 以 root 用户运行以下命令: ```bash # 查看当前 /dev/shm 挂载情况 df -h /dev/shm # 重新挂载 /dev/shm,增大容量(例如设为 2G) mount -o remount,size=2G /dev/shm ``` > 注意:`size=2G` 可根据你的 `MEMORY_TARGET` 值调整,建议大于 `MEMORY_TARGET` 的设置值。 然后再次尝试启动: ```rman RMAN> startup nomount pfile='$ORACLE_HOME/dbs/initORCL.ora'; ``` ✅ 如果成功,说明问题已解决。 --- #### ✅ 方法二:永久修改 `/etc/fstab` 中 `/dev/shm` 的大小 编辑 `/etc/fstab` 文件: ```bash sudo vi /etc/fstab ``` 找到类似这行的内容: ``` tmpfs /dev/shm tmpfs defaults 0 0 ``` 修改为指定大小(如 4G): ``` tmpfs /dev/shm tmpfs defaults,size=4G 0 0 ``` 保存退出后,重新挂载: ```bash sudo mount -o remount /dev/shm ``` 验证是否生效: ```bash df -h /dev/shm ``` 输出应显示新的大小。 --- #### ✅ 方法三:禁用 AMM(Automatic Memory Management),改用手动 SGA/PGA 管理 如果你不想依赖 `/dev/shm`,可以修改你的 PFILE(`initORCL.ora`),**禁用 `MEMORY_TARGET`**,转而使用手动内存管理。 编辑 `$ORACLE_HOME/dbs/initORCL.ora` 文件,做如下修改: ```ini # 注释或删除这两项 # memory_target = 1G # memory_max_target = 1G # 改为手动设置 SGA 和 PGA sga_target = 800M pga_aggregate_target = 200M shared_pool_size = 100M large_pool_size = 20M java_pool_size = 30M db_cache_size = 500M ``` > ⚠️ 注意:具体数值需根据你的系统内存和需求调整。 然后重启实例: ```rman RMAN> startup nomount pfile='$ORACLE_HOME/dbs/initORCL.ora'; ``` 这种方式不再使用 AMM,因此不需要大 `/dev/shm`,可避免 ORA-00845。 --- ### 补充说明 - **`MEMORY_TARGET` 要求:** - 必须有足够大的 `/dev/shm` - 文件系统必须是 `tmpfs` - 不支持 NFS 或其他网络文件系统作为共享内存 - **查看当前参数设置:** 若你能进入 SQL*Plus,可查: ```sql show parameter memory_target; show parameter sga_target; ``` - **检查内核版本和 tmpfs 支持:** Oracle 11g+ 要求较新的内核支持 `tmpfs` 扩展功能。老版本内核可能不支持动态大小。 --- ### 总结 | 方案 | 是否推荐 | 说明 | |------|---------|------| | 增大 `/dev/shm` 临时 | ✅ 推荐测试环境 | 快速验证问题根源 | | 修改 `/etc/fstab` 永久生效 | ✅✅ 生产推荐 | 根本性解决 AMM 问题 | | 改用 SGA/PGA 手动管理 | ✅✅ 推荐 | 绕开 AMM 限制,更稳定可控 | ---
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值