Oracle:SQL查询在视图上返回不一致的结果集
我有一个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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论