Oracle:SQL查询在视图上返回不一致的结果集

发布于 2025-01-28 11:09:18 字数 405 浏览 4 评论 0原文

我有一个Oracle视图(例如v_myview_0),它是通过连接六个视图而创建的(v_myview_1,v_myview_2,v_myview_3,v_myview_4,v_myview_4,v_myview_5,v_myview_6)。这6个视图中的每一个都是使用不同模式上的表创建的。这些表中的数据通过基于微服务的应用程序更新。

我在v_myview_0上写了另一个查询,其中适当的位置,并期望此查询返回一行。

问题:通常查询返回预期结果(单行)。但是,有时需要几分钟的时间,该查询会交替返回一行和多行(主要是7至11行之间的任何行)。即使我每秒反复运行查询,结果仍在单行和多行之间切换。然后突然它将开始再次返回单行。

我仔细审查了所有加入和基础数据,但未能得到原因。

任何帮助都将受到赞赏。谢谢。

I have a Oracle view (e.g. v_myview_0) which is created by joining another six views (v_myview_1, v_myview_2, v_myview_3, v_myview_4, v_myview_5, v_myview_6). Each of these 6 views are created using tables on different schemas. The data in these tables is updated by a micro-service based application.

I have written another query on v_myview_0 with appropriate WHERE CLAUSE and expect this query returns a single row.

Problem: Usually the query returns expected result (single row). However sometimes for a span of few minutes, the query alternately returns a single row and multiple rows (mostly any no. of rows between 7 to 11 rows). Even though I run the query repeatedly every second, the result keep toggling between single row and multiple rows. And then suddenly it will start returning only single row again.

I carefully reviewed all the joins and underlying data but failed to get the cause.

Any help is appreciated. Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文