Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7076723
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:19:59+00:00 2026-05-28T06:19:59+00:00

ALTER TABLE RECORDINGS ADD PRIMARY KEY (ID); CREATE MATERIALIZED VIEW LOG ON RECORDINGS TABLESPACE

  • 0
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

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.

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:20:00+00:00Added an answer on May 28, 2026 at 6:20 am

    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:

    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.

    Table 8-4 Refresh Modes

    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.

    ON DEMAND

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run this query: ALTER TABLE table DROP PRIMARY KEY, ADD
Does MySQL's ALTER TABLE ADD PRIMARY KEY also cluster the data, or do I
create table EMP(Eid int primary key) insert into EMP values(11e3) --self referencing alter table
I have created a foreign key (in SQL Server) by: alter table company add
mysql> ALTER TABLE category ADD CONSTRAINT category_parent_category_id FOREIGN KEY (parent) REFERENCES category(id); ERROR 1005
From here ALTER TABLE ORDERS ADD FOREIGN KEY (customer_sid) REFERENCES CUSTOMER(SID); How do I
Alter table users Add { }; and if so how would i add all
ALTER TABLE `groups` ADD FOREIGN KEY ( `company_id` ) REFERENCES `summaries`.`companies` ( `id` )
Using: ALTER TABLE dbo.Table1Name ADD FOREIGN KEY (colname) REFERENCES dbo.Table2Name (colname) I get a
ALTER TABLE LAB_ADMIN_USER.TEST_TEMPLATE_ABBR ADD ( CONSTRAINT TEST_TEMPLATE_ABBR_R01 FOREIGN KEY (test_template_id) REFERENCES LAB_ADMIN.TEST_TEMPLATE (test_template_id) ON

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.