• <legend id='NDx9D'><style id='NDx9D'><dir id='NDx9D'><q id='NDx9D'></q></dir></style></legend>
  • <small id='NDx9D'></small><noframes id='NDx9D'>

    <i id='NDx9D'><tr id='NDx9D'><dt id='NDx9D'><q id='NDx9D'><span id='NDx9D'><b id='NDx9D'><form id='NDx9D'><ins id='NDx9D'></ins><ul id='NDx9D'></ul><sub id='NDx9D'></sub></form><legend id='NDx9D'></legend><bdo id='NDx9D'><pre id='NDx9D'><center id='NDx9D'></center></pre></bdo></b><th id='NDx9D'></th></span></q></dt></tr></i><div id='NDx9D'><tfoot id='NDx9D'></tfoot><dl id='NDx9D'><fieldset id='NDx9D'></fieldset></dl></div>
      • <bdo id='NDx9D'></bdo><ul id='NDx9D'></ul>
      <tfoot id='NDx9D'></tfoot>

      1. 为什么在创建这个简单的物化视图示例时会出现 ORA-12054 错误?

        时间:2023-11-28
        <legend id='PPlRY'><style id='PPlRY'><dir id='PPlRY'><q id='PPlRY'></q></dir></style></legend>

          1. <small id='PPlRY'></small><noframes id='PPlRY'>

            <tfoot id='PPlRY'></tfoot>
                  <tbody id='PPlRY'></tbody>

                  <bdo id='PPlRY'></bdo><ul id='PPlRY'></ul>
                  <i id='PPlRY'><tr id='PPlRY'><dt id='PPlRY'><q id='PPlRY'><span id='PPlRY'><b id='PPlRY'><form id='PPlRY'><ins id='PPlRY'></ins><ul id='PPlRY'></ul><sub id='PPlRY'></sub></form><legend id='PPlRY'></legend><bdo id='PPlRY'><pre id='PPlRY'><center id='PPlRY'></center></pre></bdo></b><th id='PPlRY'></th></span></q></dt></tr></i><div id='PPlRY'><tfoot id='PPlRY'></tfoot><dl id='PPlRY'><fieldset id='PPlRY'></fieldset></dl></div>

                  本文介绍了为什么在创建这个简单的物化视图示例时会出现 ORA-12054 错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  ALTER TABLE RECORDINGS ADD PRIMARY KEY (ID);
                  
                  CREATE MATERIALIZED VIEW LOG ON RECORDINGS TABLESPACE USERS NOLOGGING;
                  
                  DROP MATERIALIZED VIEW REC_SEARCH_TEST;
                  CREATE MATERIALIZED VIEW REC_SEARCH_TEST
                  REFRESH COMPLETE ON COMMIT
                  AS (
                      SELECT DISTINCT ID, TITLE FROM RECORDINGS
                  );
                  
                  
                  ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
                  

                  无法理解这里有什么问题,我知道如果我去掉 DISTINCT 子句它可以工作,但是如果我指定了必需的REFRESH COMPLETE ON COMMIT",为什么我不能使用DISTINCT".

                  Cannot understand what is wrong here, I know that if I take out the DISTINCT clause it works, but why can I not use 'DISTINCT' if I specify 'REFRESH COMPLETE ON COMMIT' which is required.

                  如果我按需使用 DISTINCT 和 REFRESH 没有问题,但这些不是要求.

                  If I use DISTINCT and REFRESH on demand there is no problem, but these are not the requirements.

                  推荐答案

                  似乎通过添加 DISTINCT,您使视图的底层 SQL 不符合快速刷新的条件,因此无法与 ON COMMIT (即使您指定刷新完成而不是快速刷新).来自 Oracle 文档:

                  Seems like with the addition of the DISTINCT, you've made your view's underlying SQL ineligible for fast refresh, and therefore not able to be used with ON COMMIT (even tho you specify refresh complete instead of refresh fast). From Oracle docs:

                  两种刷新执行模式是ON COMMIT 和ON DEMAND.依赖在您创建的物化视图上,某些选项可能不可用的.表 8-4 描述了刷新模式.

                  The two refresh execution modes are ON COMMIT and ON DEMAND. Depending on the materialized view you create, some of the options may not be available. Table 8-4 describes the refresh modes.

                  表 8-4 刷新模式

                  提交

                  当一个事务修改了其中之一时自动发生刷新物化视图的明细表提交.这个可以指定只要物化视图可以快速刷新(换句话说,不复杂).使用此模式需要 ON COMMIT 权限.

                  Refresh occurs automatically when a transaction that modified one of the materialized view's detail tables commits. This can be specified as long as the materialized view is fast refreshable (in other words, not complex). The ON COMMIT privilege is necessary to use this mode.

                  按需

                  当用户手动执行可用的其中之一时会发生刷新DBMS_MVIEW 包 (REFRESH,REFRESH_ALL_MVIEWS,REFRESH_DEPENDENT).

                  Refresh occurs when a user manually executes one of the available refresh procedures contained in the DBMS_MVIEW package (REFRESH, REFRESH_ALL_MVIEWS, REFRESH_DEPENDENT).

                  同一个文档链接也有快速刷新的限制列表.

                  The same document link has a list of restrictions for fast refresh as well.

                  这篇关于为什么在创建这个简单的物化视图示例时会出现 ORA-12054 错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Oracle:将字段规范化为 CSV 字符串 下一篇:INET6_ATON 和 NTOA 函数的 Oracle PL/SQL 版本?

                  相关文章

                  <tfoot id='rXWBH'></tfoot>

                • <legend id='rXWBH'><style id='rXWBH'><dir id='rXWBH'><q id='rXWBH'></q></dir></style></legend>
                • <small id='rXWBH'></small><noframes id='rXWBH'>

                      <i id='rXWBH'><tr id='rXWBH'><dt id='rXWBH'><q id='rXWBH'><span id='rXWBH'><b id='rXWBH'><form id='rXWBH'><ins id='rXWBH'></ins><ul id='rXWBH'></ul><sub id='rXWBH'></sub></form><legend id='rXWBH'></legend><bdo id='rXWBH'><pre id='rXWBH'><center id='rXWBH'></center></pre></bdo></b><th id='rXWBH'></th></span></q></dt></tr></i><div id='rXWBH'><tfoot id='rXWBH'></tfoot><dl id='rXWBH'><fieldset id='rXWBH'></fieldset></dl></div>
                        <bdo id='rXWBH'></bdo><ul id='rXWBH'></ul>