ORA-27300: OS system dependent operation:fork failed with status: 2、ORA-27301、ORA-27302

本文详细记录了一次Oracle数据库因进程数量接近上限导致的登陆失败问题,通过分析告警日志,确定了问题根源在于操作系统对Oracle用户进程数量的限制过低。通过修改Linux系统中的limits.conf文件,增加oracle用户的nproc值,成功解决了数据库无法登陆的问题。
部署运行你感兴趣的模型镜像

问题描述

业务人员反映应用程序无法登陆数据库,用PL/SQL登录时报错ORA-12537
在这里插入图片描述

  • 查看告警日志:
Mon Aug 03 14:12:19 2020
Process startup failed, error stack:
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_psp0_44053.trc:
ORA-27300: OS system dependent operation:fork failed with status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: skgpspawn5
Mon Aug 03 14:12:20 2020
Process J000 died, see its trace file
kkjcre1p: unable to spawn jobq slave process
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_cjq0_44290.trc:
Process startup failed, error stack:
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_psp0_44053.trc:
ORA-27300: OS system dependent operation:fork failed with status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: skgpspawn5
Process J000 died, see its trace file
kkjcre1p: unable to spawn jobq slave process
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_cjq0_44290.trc:
Process startup failed, error stack:
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_psp0_44053.trc:
ORA-27300: OS system dependent operation:fork failed with status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: skgpspawn5
Process J000 died, see its trace file
kkjcre1p: unable to spawn jobq slave process
Errors in file /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_cjq0_44290.trc:

出现很多ORA-27300ORA-27301ORA-27302错误

  • 切到oracle用户,会发生等待
[root@web ~]# su - oracle
-bash: fork: retry: Resource temporarily unavailable
-bash: fork: retry: Resource temporarily unavailable
-bash: fork: retry: Resource temporarily unavailable
-bash: fork: retry: Resource temporarily unavailable
  • 用sqlplus登录报错:
ORA-12536: TNS: 操作可能阻塞

报错原因

The error messages indicating that oracle has problem in forking more process, the maximum number of PROCESSES allowed per user could be too low.
This is configured by the following kernel settings:
AIX: maxuproc
HP and Solaris: maxuprc
Solaris 10/11: project.max-lwps
Linux: nproc (/etc/security/limits.conf)

主要原因就是oracle的用户进程数量已经几乎接近oracle用户的user processes数量,所以数据库日志里面频繁出现大量的ORA-27300,ORA-27301,ORA-27302,根据MOS:392006.1建议修改/etc/security/limits.conf文件里的oracle的 nproc值为更大的值

问题解决

  • 查看当前:
[oracle@web ~]$ ulimit -u
2047
[oracle@web ~]$ cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

# End of file
weblogic soft nproc 20470
weblogic hard nproc 16384
weblogic soft nofile 10240
weblogic hard nofile 65536

oracle    soft    nproc    2047                                                   
oracle    hard    nproc    16384                                              
oracle    soft    nofile    1024                                                          
oracle    hard    nofile    65536                                                   
oracle    soft    stack    10240         
  • 修改参数
[oracle@web ~]$ cat /etc/security/limits.conf
# /etc/security/limits.conf
#
#Each line describes a limit for a user in the form:
#
#<domain>        <type>  <item>  <value>
#
#Where:
#<domain> can be:
#        - a user name
#        - a group name, with @group syntax
#        - the wildcard *, for default entry
#        - the wildcard %, can be also used with %group syntax,
#                 for maxlogin limit
#
#<type> can have the two values:
#        - "soft" for enforcing the soft limits
#        - "hard" for enforcing hard limits
#
#<item> can be one of the following:
#        - core - limits the core file size (KB)
#        - data - max data size (KB)
#        - fsize - maximum filesize (KB)
#        - memlock - max locked-in-memory address space (KB)
#        - nofile - max number of open file descriptors
#        - rss - max resident set size (KB)
#        - stack - max stack size (KB)
#        - cpu - max CPU time (MIN)
#        - nproc - max number of processes
#        - as - address space limit (KB)
#        - maxlogins - max number of logins for this user
#        - maxsyslogins - max number of logins on the system
#        - priority - the priority to run user process with
#        - locks - max number of file locks the user can hold
#        - sigpending - max number of pending signals
#        - msgqueue - max memory used by POSIX message queues (bytes)
#        - nice - max nice priority allowed to raise to values: [-20, 19]
#        - rtprio - max realtime priority
#
#<domain>      <type>  <item>         <value>
#

#*               soft    core            0
#*               hard    rss             10000
#@student        hard    nproc           20
#@faculty        soft    nproc           20
#@faculty        hard    nproc           50
#ftp             hard    nproc           0
#@student        -       maxlogins       4

# End of file
weblogic soft nproc 20470
weblogic hard nproc 16384
weblogic soft nofile 10240
weblogic hard nofile 65536

oracle    soft    nproc    10240                                                   
oracle    hard    nproc    16384                                              
oracle    soft    nofile    10240                                                          
oracle    hard    nofile    65536                                                   
oracle    soft    stack    10240          

生效:

[oracle@web ~]$ ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 515685
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 40960
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 10240
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited
[oracle@web ~]$ ulimit -u
10240

但是依旧报错,又看了下内存
free已经是0了,cached占了113
在这里插入图片描述

手动释放缓存

在这里插入图片描述
而后恢复正常

您可能感兴趣的与本文相关的镜像

ACE-Step

ACE-Step

音乐合成
ACE-Step

ACE-Step是由中国团队阶跃星辰(StepFun)与ACE Studio联手打造的开源音乐生成模型。 它拥有3.5B参数量,支持快速高质量生成、强可控性和易于拓展的特点。 最厉害的是,它可以生成多种语言的歌曲,包括但不限于中文、英文、日文等19种语言

<think>嗯,用户这次询问的是Oracle数据库导出过程中的一系列错误代码解决方案。结合提供的三个引用资料来看,用户遇到的是expdp导出时常见的复合型错误:ORA-31693(表数据卸载失败)实际是结果性报错,核心问题在于ORA-02354(导出过程异常)和ORA-01555(快照过旧),偶尔伴随ORA-22924(快照过旧的特殊形态)。 用户可能正在执行数据库迁移或备份任务,从引用[3]提到的105GB大表导出失败来看,业务规模不小。ta连续遇到多个同类错误,说明不是偶发现象,需要系统化解决。尤其值得注意的是引用[1]和[3]都指向视图/同义词解析问题和大事务回滚段配置不足这两类根源。 深层需求其实是保证数据导出任务的可靠性。用户没有明说但可能隐含的痛点包括:生产环境停机时间有限、数据一致性要求高、以及对Oracle内部机制不熟悉带来的排查困难。 技术层面需要分三层处理: 首先是紧急应对措施,比如针对ORA-01555错误立即扩大UNDO表空间或调整参数,这类方案能在数分钟内生效; 其次要解决结构性问题,比如引用[1]提到的视图导出失败需要重建元数据; 最后是预防性优化,像引用[2][3]都提到的UNDO保留时间调整和大事务拆分策略。 特别要注意引用[3]揭示的陷阱——当导出大表时,如果存在并发DML操作,即使UNDO表空间总量足够,也可能因快照保留时间不足导致失败。这需要综合运用UNDO_RETENTION参数优化和导出时机的选择。 用户提供的错误代码组合很典型,正好构成完整的故障链条:ORA-02354是导出的通用异常包装器,ORA-31693是被跳过对象的报告,真正致命的底层错误是ORA-01555及其变种ORA-22924。这个诊断结论应该明确传达给用户。 </think>以下是针对Oracle数据库错误代码 **ORA-31693、ORA-02354、ORA-01555 和 ORA-22924** 的综合解决方案,结合引用内容和Oracle官方建议整理: --- ### **错误原因分析** 1. **ORA-31693 + ORA-02354** - 通常在`expdp`导出时发生,表示特定表(如 `YKSOFT.T_TEMP_U90915`)因元数据问题无法导出。 - **核心问题**:尝试导出**视图或同义词**(而非实际表),或对象元数据损坏(引用[1][^1])。 2. **ORA-01555: snapshot too old** - 导出过程中查询的数据版本被覆盖,因UNDO表空间不足或事务保留时间过短(引用[2][^2][^3])。 - 常见于导出超大表时(如引用[3]中105GB的表)。 3. **ORA-22924: snapshot too old** -ORA-01555的衍生错误,通常与LOB字段导出相关(引用[2][^2])。 --- ### **解决方案步骤** #### **1. 修复元数据问题(针对ORA-31693 + ORA-02354)** ```sql -- 检查对象类型(确认是表/视图/同义词) SELECT object_name, object_type FROM dba_objects WHERE owner='YKSOFT' AND object_name='T_TEMP_U90915'; -- 若为视图/同义词:重建或替换为实体表 CREATE TABLE YKSOFT.T_TEMP_U90915_ACTUAL AS SELECT * FROM T_TEMP_U90915; -- 导出新表替代原对象 ``` #### **2. 解决ORA-01555 / ORA-22924(快照过旧)** - **增大UNDO表空间**: ```sql ALTER TABLESPACE UNDOTBS1 ADD DATAFILE '/path/undotbs02.dbf' SIZE 10G AUTOEXTEND ON; ``` - **延长UNDO保留时间**: ```sql ALTER SYSTEM SET UNDO_RETENTION = 1800; -- 单位:秒(建议≥导出耗时) ``` - **优化导出参数**: ```bash expdp user/pwd DIRECTORY=dpump_dir DUMPFILE=exp.dmp LOGFILE=exp.log FLASHBACK_TIME=SYSTIMESTAMP -- 使用闪回保证一致性 PARALLEL=4 -- 降低并行度减少UNDO压力 ``` #### **3. 分治策略导出大表** - **单独导出失败的表**(避免全局失败): ```bash expdp user/pwd TABLES=SJTBK.INC_KETTLE_ETL_HIST, SJTBK.ECPS_EASY_LOGOUT DIRECTORY=dpump_dir DUMPFILE=large_tables.dmp ``` - **使用`QUERY`条件分批导出**: ```bash expdp ... QUERY="WHERE ROWNUM<=1000000" -- 分批导出 ``` #### **4. 预防性措施** - **监控UNDO使用**: ```sql SELECT BEGIN_TIME, TUNED_UNDORETENTION FROM V$UNDOSTAT; ``` - **避免导出高峰期操作**:减少并发DML对UNDO的争用。 - **改用物理备份**:对百GB级数据,RMAN比逻辑导出更可靠(引用[2][^2])。 --- ### **关键要点总结** | 错误码 | 主因 | 解决方案 | |-----------------|-----------------------|-----------------------------| | ORA-31693+02354 | 视图/同义词元数据异常 | 重建对象或导出实体表 | | ORA-01555 | UNDO空间或保留时间不足| 增大UNDO、延长保留时间 | | ORA-22924 | LOB字段导出快照过旧 | 分批导出+优化UNDO参数 | > ⚠️ 若问题持续,检查`alert.log`获取更详细的堆栈信息,并考虑使用Oracle Support收集诊断数据(RDA工具)[^3]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值