Solved

Error in creating a materialized view (ora-00942)

Posted on 2013-10-23
6
2,222 Views
Last Modified: 2013-10-25
I will like to create a materialized view on a schema tr which has select grant on a table cars on a different schema src
I used the following statement
CREATE MATERIALIZED VIEW tr.cars_mv
TABLESPACE xxxx
LOGGING
       REFRESH FAST
  WITH PRIMARY KEY
       AS
SELECT
Name,
Type
FROM src.cars
;

I am having the following  error:
ora-00942: table or view does not exist

I have done the following checks
•      the spelling of the table or view name.
•      that a view is not specified where a table is required.
•      that an existing table or view name exists.

In fact if I run the query under tr it functions that is without the create materialized view statement

What could be the source of the error. Could it be related to the characteristics of the materialized view (  REFRESH FAST ) to be created
0
Comment
Question by:diteps06
  • 3
6 Comments
 
LVL 77

Accepted Solution

by:
slightwv (䄆 Netminder) earned 480 total points
ID: 39593784
Try an explicit grant not through a view.

Log into src and execute:
grant select on cars to tr;
0
 
LVL 1

Author Comment

by:diteps06
ID: 39594221
I forgot to mention a detail the table cars have a materialized view log table created on it.
the schema tr doesn't yet have a grant select on it. Maybe this is cause of the error. I am still to verify it
0
 
LVL 1

Assisted Solution

by:hinpong
hinpong earned 20 total points
ID: 39599217
They are under two different schema, tr and src? If so, you need to grant select privilges

connect src
grant select on cars to tr;
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39599265
hinpong,

How is your post any different than what I have already posted?

Please read previous posts before responding.
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39599381
diteps06,

Mind if I ask why the "B" penalty grade?  What additional assistance did you need before providing an "A" grade.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question