dbTalk Databases Forums  

Refresh materialized view by other user then owner

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Refresh materialized view by other user then owner in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default Refresh materialized view by other user then owner - 04-29-2006 , 05:01 PM






Hello,

I have problem. I'm trying to refresh materialized view and I have
error that some pirivileges are needed but I dont have idea what more
can be needed

I'm trying to execute from User2:

begin
DBMS_MVIEW.REFRESH('sys.My_View','c');
end;

and Oracle gives me back error:

begin
*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 794
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 851
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 832
ORA-06512: at line 2


Table, materialized view and privileges are made in this way:

create or replace table My_Table (aa integer primary key);
create materialized view My_View as select * from My_Table ;

CREATE USER User2;
IDENTIFIED BY ThisIsMySecretPassword;
GRANT ALL ON My_View TO User2;
GRANT SELECT ON My_Table TO User2;
GRANT CREATE SESSION TO User2;
GRANT ALTER ANY MATERIALIZED VIEW to User2;
GRANT SELECT ANY TABLE to User2;
GRANT CREATE ANY MATERIALIZED VIEW to User2
GRANT DROP ANY MATERIALIZED VIEW to User2


--END

This table and materialized view have been made by user System

I also try to give the same Roles that have System but this is still
the same error.
Refresh works fine executed by owner of this View

What privileges are missing?

Thanks for any help

varciasz


Reply With Quote
  #2  
Old   
DA Morgan
 
Posts: n/a

Default Re: Refresh materialized view by other user then owner - 05-03-2006 , 11:14 AM






varciasz (AT) gmail (DOT) com wrote:
Quote:
Hello,

I have problem. I'm trying to refresh materialized view and I have
error that some pirivileges are needed but I dont have idea what more
can be needed

I'm trying to execute from User2:

begin
DBMS_MVIEW.REFRESH('sys.My_View','c');
end;

and Oracle gives me back error:

begin
*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 794
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 851
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 832
ORA-06512: at line 2


Table, materialized view and privileges are made in this way:

create or replace table My_Table (aa integer primary key);
create materialized view My_View as select * from My_Table ;

CREATE USER User2;
IDENTIFIED BY ThisIsMySecretPassword;
GRANT ALL ON My_View TO User2;
GRANT SELECT ON My_Table TO User2;
GRANT CREATE SESSION TO User2;
GRANT ALTER ANY MATERIALIZED VIEW to User2;
GRANT SELECT ANY TABLE to User2;
GRANT CREATE ANY MATERIALIZED VIEW to User2
GRANT DROP ANY MATERIALIZED VIEW to User2


--END

This table and materialized view have been made by user System

I also try to give the same Roles that have System but this is still
the same error.
Refresh works fine executed by owner of this View

What privileges are missing?

Thanks for any help

varciasz
Should I understand from your example that you built a materialized
view as SYS? What schema are you in when you execute the REFRESH?
Does that schema have EXECUTE on DBMS_MVIEW? Granted how?

Daniel Morgan
www.psoug.org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.