Solved

Error in creating a materialized view (ora-00942)

Posted on 2013-10-23
6
2,104 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 76

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 76

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 76

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article describes some very basic things about SQL Server filegroups.
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

911 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now