简体   繁体   English

Oracle 12c:SQL查询只会偶尔挂起

[英]Oracle 12c: SQL query hangs forever only occasionally

I have a SQL query that fetches roughly 200 columns from multiple tables and normally runs in a matter of minutes. 我有一个SQL查询,该查询从多个表中获取大约200列,并且通常在几分钟内即可运行。

A Java program kicked off by cron calls the SQL every 4 hours, but occasionally hangs forever(=not fetching any data. Neither updates nor inserts are involved). 由cron启动的Java程序每4小时调用一次SQL,但偶尔会永远挂起(=不获取任何数据。不涉及更新或插入)。

Here are some outputs from V$SESSION . 这是V$SESSION一些输出。

STATUS : ACTIVE 状态 :有效
ROW_WAIT_OBJ# : 22392 ←not changing ROW_WAIT_OBJ# :22392←不变
ROW_WAIT_FILE# : 6 ←not changing ROW_WAIT_FILE# :6←不变
ROW_WAIT_BLOCK# : 8896642 ←not changing ROW_WAIT_BLOCK# :8896642←不变
ROW_WAIT_ROW# : 0 ←not changing ROW_WAIT_ROW# :0←不改变
LAST_CALL_ET : 5632 ←keeps incresing LAST_CALL_ET :5632←不断增加

★No other heavy SQL queries are running at the same time ★没有其他繁重的SQL查询同时运行

What could be the cause of this and what should I look into to solve it? 造成这种情况的原因可能是什么,我应该考虑解决什么?

You can use TKPROF or SQL Profiler. 您可以使用TKPROF或SQL Profiler。 This reports can help you. 此报告可以为您提供帮助。 We can not replay your question now. 我们现在无法重播您的问题。

If you attach your tuning reports, we can help you. 如果您附上调整报告,我们可以为您提供帮助。 Because many things can cause performance problems. 因为很多事情都会导致性能问题。 A comprehensive study is needed to understand this. 需要进行全面的研究才能理解这一点。

Follow this link; 点击此链接;

https://docs.oracle.com/cd/E11882_01/server.112/e41573/perf_overview.htm https://docs.oracle.com/cd/E11882_01/server.112/e41573/perf_overview.htm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM