OERR: ORA 60 "deadlock detected while waiting for resource" [ID 18251.1](oracle deadlock 学习资料-03 死锁分析步骤)

本文详细解析了Oracle数据库中ORA-60错误,该错误通常由于事务间的资源竞争导致死锁而引发。文章提供了诊断步骤及解决建议,包括检查锁定类型、模式和涉及的事务,并给出了几种常见场景及其可能的原因。
Error:  ORA 60

Text: deadlock detected while waiting for resource

-------------------------------------------------------------------------------

Cause: Transactions deadlock one another waiting for resources

Action: Look at the trace file to see the transactions and resources

involved. Retry if necessary.



*** Important: The notes below are for experienced users - See Note:22080.1




** For CUSTOMER issues with ORA-60 send them: Note:62365.1


This details the most common ORA-60 scenarios.



Explanation:

A deadlock has been detected so your statement has been rolled

back to allow the other party to continue.



Diagnosis:

Note the lock TYPES and MODES in the DEADLOCK graph.

The most common deadlocks involve one of the following:

Lock type Mode Problem

TX X Application row lock deadlock.See below.

TX S Many reasons - see Note:62354.1


TM SSX Usually unindex foreign key constraints.





TX requested X mode:

~~~~~~~~~~~~~~~~~~~~~

This is usually an application design issue in that transactions

are modifying tables A and B in opposite orders.

Eg: 1 updates A

2 updates B

1 tries to update B but blocks

2 tries to update A but blocks

** Deadlock as neither 1 nor 2 will ever complete.



a) Has ANYTHING in the schema been changed (Eg: A foreign key INDEX

may have been dropped) as this could affect locking of tables.



b) There should be a user trace with the deadlock TX information

in USER_DUMP_DEST. This will indicate who was involved in the

deadlock



c) Is the insert into a clustered table ? If so see Bug:197942




d) What are MAXTRANS / INITRANS for the tables in the deadlock ?





Articles / Known Issues:

ORA-60 against UET$ (Fixed 7.2) Bug:231455


ORA-60 from ANALYZE ... VALIDATE ... command:

NOTE: It is possible to get this if the dictionary has

been analyzed and has statistics present. Delete

the statistics.



V6: If this occurs on startup it is likely that a file may be missing.

There should be a trace file produced and an entry in the alert log

which will tell you the location of the problem file. Either:

a) restore access to the datafiles

OR b) offline the datafiles and drop the tablespace when it

opens to clean up the data dictionary.

(obviously you have lost all the data in this case)





<think>好的,我现在需要回答用户关于D:\oracle-client\product\21.0.0\client_1\bin\procob.exe的作用的问题。首先,我要确定procob.exe是什么,可能与Oracle和COBOL有关。用户之前问过NetCOBOL的编译,可能现在涉及到Oracle数据库和COBOL程序的交互。 首先,procob.exe这个文件名中的“procob”可能是Pro*COBOL的缩写。Pro*COBOL是Oracle的一个预编译器,用于在COBOL程序中嵌入SQL语句。类似于Pro*C和Pro*Fortran,它允许在宿主语言中直接写SQL,然后预编译器将这些语句转换为宿主语言的代码,并生成数据库访问相关的代码。 接下来,我需要确认这个路径是否属于Oracle客户端安装的一部分。用户的路径是D:\oracle-client\product\21.0.0\client_1\bin\procob.exe,看起来像是Oracle Client 21c的安装路径下的二进制文件。通常,Oracle的预编译器如Pro*COBOL会包含在客户端工具中,尤其是开发版本。 所以,procob.exe的作用应该是将包含嵌入式SQL的COBOL程序转换为纯COBOL代码,同时生成必要的数据库访问代码。这样,开发人员可以在COBOL中直接使用SQL语句操作Oracle数据库,而预编译器处理这些语句,生成与Oracle库兼容的代码。 此外,需要说明使用procob.exe的典型流程:编写包含EXEC SQL的COBOL源文件,运行procob预处理,生成修改后的COBOL文件,然后使用NetCOBOL或其他编译器进行编译链接,最后生成可执行文件。可能还需要配置相关的数据库连接参数,比如用户名、密码、服务名等。 同时,用户可能想知道这个工具的基本用法,比如命令行参数,或者如何集成到构建过程中。例如,可能需要指定输入文件、输出目录、包含路径,或者数据库连接信息。可能还需要提到配置文件如PCBCFG,或者环境变量的设置,比如ORACLE_HOME是否正确指向安装目录。 另外,常见的问题可能包括路径错误、环境变量未设置,或者预处理后的代码编译错误,这时候需要检查SQL语法或预编译步骤是否正确。还可能提到文档资源,比如Oracle官方文档或者Pro*COBOL的用户指南,供用户进一步查阅。 最后,要确保回答结构清晰,分点说明作用、使用场景、基本用法和注意事项,帮助用户全面理解procob.exe的功能和用法。</think>`D:\oracle-client\product\21.0.0\client_1\bin\procob.exe` 是 **Oracle Pro*COBOL 预编译器**的可执行文件,主要用于在 COBOL 程序中实现与 Oracle 数据库的交互。以下是详细说明: --- ### **核心作用** 1. **嵌入式 SQL 处理** 允许在 COBOL 源代码中直接编写 SQL 语句(通过 `EXEC SQL` 语法),例如: ```cobol EXEC SQL SELECT ENAME INTO :NAME FROM EMP WHERE EMPNO = :ID ``` `procob.exe` 会将这些 SQL 语句转换为 COBOL 可识别的数据库访问代码。 2. **代码转换** - 输入:包含嵌入式 SQL 的 `.pco` 或 `.cob` 文件 - 输出:纯 COBOL 源文件(扩展名通常为 `.cob`) - 同时生成 `SQLCA`(SQL 通信区)等数据库通信结构。 3. **数据库兼容性适配** 封装 Oracle 数据库调用接口(如 OCI),使 COBOL 程序能直接操作 Oracle 数据库。 --- ### **典型使用场景** 1. **开发阶段** 将 COBOL 程序中的 SQL 操作与 Oracle 数据库绑定,例如: - 数据查询(`SELECT`) - 事务操作(`COMMIT`/`ROLLBACK`) - 存储过程调用 2. **编译流程** 典型步骤: ```plaintext COBOL源文件 (.pco) → procob.exe 预处理 → 生成纯COBOL文件 (.cob) → NetCOBOL编译器 → 可执行文件 ``` --- ### **基本用法示例** ```bat rem 设置 Oracle 环境变量 set ORACLE_HOME=D:\oracle-client\product\21.0.0\client_1 set PATH=%ORACLE_HOME%\bin;%PATH% rem 运行预编译 procob.exe INAME=your_program.pco ONAME=output.cob ``` **关键参数**: - `INAME`:输入文件名 - `ONAME`:输出文件名 - `USERID`:数据库连接(例如 `scott/tiger@orcl`) - `PARSE=NONE|PARTIAL|FULL`:控制 SQL 语法解析严格性 --- ### **注意事项** 1. **依赖配置** - 需正确配置 `ORACLE_HOME` 环境变量指向 Oracle 客户端目录。 - 确保 `sqlnet.ora`/`tnsnames.ora` 中定义了数据库连接信息。 2. **输入文件要求** - SQL 语句需符合 Oracle 语法规范。 - 宿主变量(如 `:ID`)需在 COBOL 的 `WORKING-STORAGE` 中声明。 3. **错误排查** - 若预编译失败,检查生成的 `.lis` 日志文件。 - 常见错误代码可通过 `oerr` 工具查询(如 `oerr procob 123`)。 --- ### **与 NetCOBOL 的协作** 若使用 NetCOBOL 编译预处理后的文件,需: 1. 在批处理脚本中依次调用: ```bat procob.exe INAME=program.pco cobol32w.exe program.cob ``` 2. 链接 Oracle 客户端库(如 `orasql21.lib`)。 --- 如需进一步了解具体参数,可运行: ```bat procob.exe HELP=YES ``` 或查阅 Oracle 官方文档《Pro*COBOL Programmer's Guide》。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值