滴落后重新创建甲骨文物质的视图失败

发布于 2025-02-10 00:15:55 字数 778 浏览 4 评论 0原文

我有一个实现的视图,该视图是通过每天连接外部方加载的表格,具有不同的结构(例如新列)。为了调整表结构的更改,我建立了每日批次,该批量根据最新表格掉落并重新创建了实现的视图,然后进行完整的刷新。

批处理失败有时带有错误ora-00001:唯一约束(sys.i_obj1)被称为drop drop a droped View的视图,然后尝试尝试,然后尝试尝试重新创建它。但是,如果失败后一秒钟左右,重新创造将成功。

sys.i_obj1sys.obj $(obj#,所有者#,类型#)的唯一索引

是sql批次运行以分别掉落并重新创建mview :

掉落材料的视图T_MV

create materialized view t_mv
build deferred
using no index
enable query rewrite
as
    select /*+ full(a) full(b) parallel(a, 8) parallel(b, 8) */
        a.*
        b.col1,
        b.col2
    from tbl_a a, tbl_b b
    where a.id_col = b.id_col

我怀疑当Oracle仍在完成现有MView的删除时发生错误,而娱乐启动。但是我找不到证明这一点的方法。我在Oracle 19C数据库中。

有人可以在这里放一些灯吗?

I have a Materialized View that is built by joining tables loaded by external party every day, with potential different structure (such as new columns). To adapt table structure changes, I built a daily batch that drops and recreates the Materialized View based on latest tables, followed by Complete Refresh.

The batch failed sometimes with error ORA-00001: unique constraint (SYS.I_OBJ1) violated after it called drop materialized view, and then attempted to recreate it. However, the re-creation will succeed if it is retried one second or so after the failure.

The SYS.I_OBJ1 is an unique index on SYS.OBJ$(OBJ#, OWNER#, TYPE#)

Below are SQL the batch runs to drop and recreate the Mview respectively:

drop materialized view t_mv

create materialized view t_mv
build deferred
using no index
enable query rewrite
as
    select /*+ full(a) full(b) parallel(a, 8) parallel(b, 8) */
        a.*
        b.col1,
        b.col2
    from tbl_a a, tbl_b b
    where a.id_col = b.id_col

I suspect the error occurred when Oracle is still finishing the removal of the existing MView, while the recreation is kicked off. But I can't find a way to prove it. I am with Oracle 19c database.

Can anyone please shed some lights here?

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

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

发布评论

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