Creating a materialized view for another user

I don't seem to find the correct setup for this....
With the user "dummy"
CREATE MATERIALIZED VIEW dummy.thetable BUILD IMMEDIATE REFRESH FORCE ON DEMAND AS select * from real.thetable;
And the materialized view is created ok.
With a DBA user:
CREATE MATERIALIZED VIEW dummy.thetable BUILD IMMEDIATE REFRESH FORCE ON DEMAND AS select * from real.thetable;
ORA-01031: insufficient privileges
I don't want to be switching back and forth from the user to create materialized views, am I missing a permission here? DBA of course has create any materialized view

From the SQL Reference Guide:
To create a materialized view in another user’s schema:
- You must have the CREATE ANY MATERIALIZED VIEW system privilege.
- The owner of the materialized view must have the CREATE TABLE system privilege. The owner must also have access to any master tables of the materialized view that the schema owner does not own (for example, if the master tables are on a remote database), and to any materialized view logs defined on those master tables, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.
I suspect that, if you first GRANT CREATE TABLE TO DUMMY, you will be able to create the MV.

Similar Messages

  • Creating a short cut for another users calendar

    Hello,
    I don't know if you can do this but it would really help if it is possible.
    I created a calendar for travel information. It is planned that all in the office will use it when out of the office. They will create an entry in their calendar and use the travel calendar as a resource so all travel appears in one resource (travel calendar).
    In order to open this calendar for viewing I have to goto file- open -other users folder. Then the travel calendar opens. I would like to create this calendar as a shortcut or icon so I dont need to open it from the file open...... each time. Is this possible? anyone have another idea?
    thanks for any help.
    Jason

    You cannot do shortcuts of this type with the current 9.0.4.x release. However, the future 10gR1 will make things significantly better.
    With the 10gR1 release, shortcuts will be supported. You will be able to browse through your folderlist to access users calendars (rather than going through the FILE | OPEN every time). And if you use Outlook 2003, the 10gR1 release will also support the 'side-by-side' calendar views and the 'My Calendar' shortcuts.
    OCFO 10gR1 is currently in beta, and is expected out later this year.
    Hope that helps,
    --Marc

  • Issue creating a MatView for another user w/ a private DB Link

    I am having an issue creating a materialized view for another user where the select statement for the MV uses a private db link. Looks like the following:
    Logged in as user X, I run:
    create materialzied view Y.foo
    (select blah
    from tbl@y_priv_db_link_here);
    When I try to run this, I get a permission issue. User X has DBA privilege, user Y has create MV priv and has select priv on the table in the db link.
    I can create this MV logged in as user Y. Cant create this logged in a user Y in test or prod environment, so this isn't an option.
    Any ideas on how I can create this logged in a user X? I believe the issue here is that since this is a private db link owned by user Y, user X doesn't have access to this db link.
    thanks.

    Here is what I was trying to do:
    SQL> CREATE MATERIALIZED VIEW extract.ADDRESS
    2 TABLESPACE xxx
    3 BUILD IMMEDIATE
    4 REFRESH
    5 COMPLETE
    6 ON DEMAND
    7 WITH PRIMARY KEY
    8 AS
    9 ( SELECT ... FROM address@CM_TO_CPD);
    FROM pwb_address@CM_TO_CPD)
    ERROR at line 11:
    ORA-01031: insufficient privileges
    Message was edited by:
    Jim S

  • Creating a Materialized View in Oracle 8i

    Hello -
    What are the steps and privileges required to create a materialized view in Oracle 8i?
    Thanks

    To create a materialized view in your own schema:
    You must have been granted the CREATE MATERIALIZED VIEW system privilege and either the CREATE TABLE or CREATE ANY TABLE system privilege.
    You must also have access to any master tables of the materialized view that you do not own, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.
    To create a materialized view in another user's schema:
    You must have the CREATE ANY MATERIALIZED VIEW system privilege.
    The owner of the materialized view must have the CREATE TABLE system privilege. The owner must also have access to any master tables of the materialized view that the schema owner does not own (for example, if the master tables are on a remote database), and to any materialized view logs defined on those master tables, either through a SELECT object privilege on each of the tables or through the SELECT ANY TABLE system privilege.
    Thanks
    Manish

  • Disco 4i Error 'This user requires Create Any Materialized View Sys Priv'

    Hi,
    Firstly I will say we are late with moving to Disco 10g, fully understood and constantly remind people of need to upgrade.
    Oracle Apps 11i instance, we have upgraded the database 10g.
    In Disco 4i Admin, Import folder from Database, we receive Error Message:
    *'This user requires Create Any Materialized View System Priviledge'*
    Have spoken to number of our DBA's but been unable to resolve this. I have read loads of stuff about similar issues, but no direct hits really help me.
    I am guessing we need to logon as SYSTEM db user and execute
    h5. SQL> grant create materialized view to <username>;
    h5. SQL> grant alter any materialized view to <username>;
    Please can anyone advise, I am sure it's going to be a DB/Schema owner, as the username; i.e. APPS or EUL_US?
    I cannot see it being the fnd_user for the Disco EUL owner, e.g. SYSADMIN or PatStock.
    Thanks
    Mike

    Hi,
    If you are doing the import as SYSADMIN then you are connected as APPS so this is the database user that needs additional privilege.
    However, the APPS user only needs create materialized view privileges if there are manually created summary folders in the EUL, i.e. summary folders based on materialized views. If you are not using these then the privilege is not required.
    The EUL_US user just needs to give Discoverer Administrator privileges to the SYS_ADMIN user. Nothing else should be needed.
    Rod West

  • Created help file either won't open or opens blank when emailed or copied for another user to see it.

    Created help file either won't open or opens blank when emailed or copied for another user to see it.
    Our HR person made a help file she wants to email to someone or copy to a network share.
    -If she emails it the other person cannot open it.
    -If she copies it even from her desktop where she saved it to the folder with all the other files, it opens blank.
    Any help would be appreciated.

    I think they must be swapping out .html for .chm in DW or something. What the OP describes sure sounds like what happens when you do that.
    @dfiore27101
    DW doesn't support .chm file types. Adding the extension doesn't compress the images into the file to create a true .chm.
    Adding .chm will make a perfectly good .html file stop displaying in DW though.
    An easier way to send someone .html help files would be to archive their folder as a .zip then email the .zip. The recipient would then need to extract the archive to view the files in their browser.
    I don't know of any way to create real .chm files in DW.

  • How to create a special view for sharepoint list A and deploy this view to specific user personal view?

    How to create a public view for sharepoint list A and deploy this view to specific user personal view? Is that possible OOTB?

    Views cannot be exported or moved. Can you elaborate your requirement?
    --Cheers

  • Privilege to allow a user to create a view in another user's schema

    Hello,
    I need to allow a user to create a view in another user's schema.
    Say, to connect as USER_A and run statement: 'create view USER_B_SCHEMA.myview as select...'
    Is there any way to accomplish that without granting USER_A privilege to CREATE ANY VIEW? I want to keep USER_A at the lowest profile possible.
    Thanks!

    You have the option to create an stored procedure, here a test case (no optimized, no bug free):
    SYS@orcl > create user sp_owner identified by sp_owner;
    SYS@orcl > grant create any view to sp_owner;
    SYS@orcl> create procedure sp_owner.create_view (
      2  view_name varchar2, view_sql varchar2 ) is
      3  begin
      4    execute immediate 'create view '||view_name||' as '||view_sql;
      5  end;
      6  /
    Procedure created.
    SYS@orcl > create user test identified by test;
    SYS@orcl > grant create session to test;
    SYS@orcl > grant execute on sp_owner.create_view to test;
    TEST@orcl> execute sp_owner.create_view('scott.emp_vw','select * from scott.emp')
    PL/SQL procedure successfully completed.HTH
    Enrique
    PS. If your problem was solved, consider marking the question as answered.

  • Create a materialized view :-

    How do I create a materialized view on a view ,so that it will refresh automatically on every commit in base table where the view having more that 9 function ?

    Read Materialized View Refresh for complete information.
    For a Jist:
    Refresh Mode Description
    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).
    When a materialized view is maintained using the ON COMMIT method, the time required to complete the commit may be slightly longer than usual. This is because the refresh operation is performed as part of the commit process. Therefore this method may not be suitable if many users are concurrently changing the tables upon which the materialized view is based.
    If you anticipate performing insert, update or delete operations on tables referenced by a materialized view concurrently with the refresh of that materialized view, and that materialized view includes joins and aggregation, Oracle recommends you use ON COMMIT fast refresh rather than ON DEMAND fast refresh.
    If you think the materialized view did not refresh, check the alert log or trace file.
    If a materialized view fails during refresh at COMMIT time, you must explicitly invoke the refresh procedure using the DBMS_MVIEW package after addressing the errors specified in the trace files. Until this is done, the materialized view will no longer be refreshed automatically at commit time.

  • Creating a materialized view

    I am attempting to create a materialized view to replicate tables with spatial columns to another server. I get to the following statement when I get the error:
    CREATE MATERIALIZED VIEW fedpro.mtr_descr_geometry
    REFRESH FAST WITH PRIMARY KEY FOR UPDATE
    AS SELECT * FROM fedpro.mtr_descr_geometry@fpdev;
    Error:
    AS SELECT * FROM fedpro.mtr_descr_geometry@fpdev
    ERROR at line 3:
    ORA-12008: error in materialized view refresh path
    ORA-00600: internal error code, arguments: [4882], [0x385184210], [0x383F78B60], [0x386CBA9E0], [], [], [], []
    I have created materialized views on non-spatial tables and on a small spatial test table successfully. The tables I am having problems with all have spatial indexes on them (which I have tried dropping and still get the error).
    I am using 9i.
    Thanks.
    Michael Joyce

    Hi,
    The following works. Note, I'm not sure it makes sense (or if you are allowed) to use materialized views as
    a replication mechanism with objects. For instance, I'm not sure it database links are supported with objects.
    Replication is supported with , and might be the better option. In any case, this is what I got to work:
    create table TT (id number primary key, geom mdsys.sdo_geometry);
    create materialized view log on TT
    with
    (GEOM)
    including new values;
    CREATE MATERIALIZED VIEW TT_MVIEW
    REFRESH FAST WITH PRIMARY KEY FOR UPDATE
    AS SELECT * FROM TT;
    insert into user_sdo_geom_metadata values
    ('TT',
    'GEOM',
    mdsys.sdo_dim_array(
    mdsys.sdo_dim_element('X',-180,180,0.05),
    mdsys.sdo_dim_element('Y',-90,90,0.05)),
    8265);
    insert into user_sdo_geom_metadata values
    ('TT_MVIEW',
    'GEOM',
    mdsys.sdo_dim_array(
    mdsys.sdo_dim_element('X',-180,180,0.05),
    mdsys.sdo_dim_element('Y',-90,90,0.05)),
    8265);
    create index TT_SIDX on TT(geom)
    indextype is mdsys.spatial_index;
    create index TT_MVIEW_SIDX on TT_MVIEW(geom)
    indextype is mdsys.spatial_index;
    insert into TT values (1,mdsys.sdo_geometry(2001,8265,
    mdsys.sdo_point_type(-40,125,null),null,null));
    execute DBMS_MVIEW.REFRESH ('TT_MVIEW','F');

  • Unable to create a Materialized View

    I have this query to generate continous dates for the given number of months (12 in this case).
    (SELECT ADD_MONTHS(TO_DATE('2007-01-01', 'yyyy-mm-dd'), rownum - 1) Transaction_Date_Month
      FROM DUAL
              CONNECT BY level <= 12)I am using this query alongside with another query to get some results. I want to put the whole query what i have in a "Materialized View". But it is not allowing me to create the materialized view becuase of using "rownum". So how can i avoid "rownum" for getting all the dates and also use it in Materialized View.

    Why do you want to create this a materialized view?
    I presume the date changes dynamically somehow otherwise you'd want to use a table
    What is the actual date range you want to use?
    Would you be better off using a materialized subquery using WITH?
    WITH subq_months AS
    (SELECT /*+materialize */ADD_MONTHS(TO_DATE('2007-01-01', 'yyyy-mm-dd'), rownum - 1) Transaction_Date_Month  FROM DUAL          CONNECT BY level <= 12)
    SELECT -- use months here somehow --
    FROM   subq_months

  • Materialized view log and user....

    Hi,
    Assume that a user , let's call him A owns a table and another user B needs to create a materialized view log on the table who owns the A user.
    Whereas the user B do have all object privileges(direct priv insert, update, delete.. not via a role) on the table of user A he cannot create a mv log on this table on his schema....
    So, the stmts insert/update/delete on <tab_name> are successfully executed (having connected as user B).
    The error message "ORA-00942: table or view does not exist " appears when i issue the command:
    connect B/B;
    create materialized view log on tab_name with sequence including new values;
    Note: I use ORADB 10.2.0.4 and there is a synonym of tab_name to the user B (who tries to create the mv log on)...
    Is the above req. possible in any way...???
    Thank you,
    Sim

    The documentation says the following:
    The materialized view log is created in the same schema as the target master.HTH!

  • Can create view, but cannot create table / materialized view: Xpath is null

    Hi all,
    We recently moved some XML documents into the database in an XMLType column and want to query the data. I've been writing some queries and turning them into materialized views. I got to one query, and something really strange is happening. My query returns the expected results, but I am getting an error when I try to create a materialized view out of it. Even stranger, I can create a view out of it, and I can manually insert its data into an existing table, but I cannot create a materialized view out of it and I cannot create a table out of it. Here is a brief summary, please let me know if anyone has suggestions.
    Issuing the following commands fails in SQLDeveloper
    -- Creating a materialized view out of the query fails:
    create materialized view element REFRESH COMPLETE ON DEMAND as [query];
    Error at Command Line:1 Column:1 SQL Error: ORA-31063: XPath compilation failed: Xpath is null.
    -- Creating a table out of the query with the following shortcut fails:
    create table element as [query];
    Error at Command Line:1 Column:1 SQL Error: ORA-31063: XPath compilation failed: Xpath is null.
    Issuing the following commands in SQLDeveloper works fine:
    -- Creating a view out of the query works:
    create or replace view element as [query];
    -- Creating a blank table from the query and then inserting data works:
    create table element as select * from [query] where 1 = 2;
    insert into element select * from [query];
    Here is a simplified version of the query...
    I have changed the names around, and cut the query down so maybe it will be a little easier to understand. I did confirm that this query is also having the same symptoms described above. Since I changed the names, executing the query returns no results. However creating a materialized view out of the query still fails with the 'Xpath is null' error.
    create materialized view element REFRESH COMPLETE ON DEMAND as
    select
    m.resource_id,
    xml.*
    from metadata_sources m,
    xmltable(
    'for $i in /metadata/app//*[(self::elem1 or self::elem2) and (parent::form or parent::subform)]
    let $formName := if($i/parent::subform) then $i/../../@name else $i/../@name
    let $subformName := if($i/parent::subform) then $i/../@name else ""
    return <data
    appId="{$i/ancestor::app[1]/idField}"
    formName="{$formName}"
    subformName="{$subformName}"
    elemName="{$i/@name}"></data>' passing m.xml_content
    columns
    app_id NUMBER path '@appId',
    form_name VARCHAR2(50 char) path '@formName',
    subform_name VARCHAR2(50 char) path '@subformName',
    elem_name VARCHAR2(50 char) path '@elemName'
    ) xml;
    Edited by: user11949534 on Feb 22, 2013 1:55 PM

    As far as creating a structured index, I was under the impression that I would need to then register an XSD. No, you can use it without an XML schema.
    How about a regular relational view, with an underlying xml index?
    That way you also eliminate the need for an explicit refresh step as you would then be querying real-time data, as if it were relational data.
    For example :
    Connected to:
    Oracle Database 11g Express Edition Release 11.2.0.2.0 - Production
    SQL> create table tmp_xml of xmltype ;
    Table created.
    SQL> insert into tmp_xml values (
      2    xmlparse(document '<root><item id="1">ABC</item><item id="2">DEF</item></root>')
      3  ) ;
    1 row created.
    SQL> insert into tmp_xml values (
      2    xmlparse(document '<root><item id="3">GHI</item><item id="4">JKL</item></root>')
      3  ) ;
    1 row created.
    SQL> create or replace view tmp_xml_v as
      2  select x.item_id, x.item_val
      3  from tmp_xml
      4     , xmltable(
      5         '/root/item' passing object_value
      6         columns item_id  number      path '@id'
      7               , item_val varchar2(3) path '.'
      8       ) x
      9  ;
    View created.
    SQL> create index tmp_xml_sxi on tmp_xml (object_value)
      2  indextype is xdb.xmlindex
      3  parameters (q'#
      4  XMLTABLE tmp_xml_xtb '/root/item'
      5  COLUMNS item_id  number      path '@id'
      6        , item_val varchar2(3) path '.' #'
      7  ) ;
    Index created.
    SQL> exec dbms_stats.gather_table_stats(user, 'TMP_XML');
    PL/SQL procedure successfully completed.
    SQL> set autotrace on explain
    SQL> set lines 200
    SQL> select * from tmp_xml_v ;
       ITEM_ID ITE
             3 GHI
             4 JKL
             1 ABC
             2 DEF
    Execution Plan
    Plan hash value: 4168126828
    | Id  | Operation                    | Name                   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT             |                        |     4 |   164 |     3   (0)| 00:00:01 |
    |   1 |  NESTED LOOPS                |                        |       |       |            |          |
    |   2 |   NESTED LOOPS               |                        |     4 |   164 |     3   (0)| 00:00:01 |
    |   3 |    INDEX FULL SCAN           | SYS_C009273            |     2 |    34 |     1   (0)| 00:00:01 |
    |*  4 |    INDEX RANGE SCAN          | SYS30366_30367_OID_IDX |     2 |       |     0   (0)| 00:00:01 |
    |   5 |   TABLE ACCESS BY INDEX ROWID| TMP_XML_XTB            |     2 |    48 |     1   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       4 - access("TMP_XML"."SYS_NC_OID$"="SYS_SXI_0"."OID")

  • How to create a help view for a customized error message

    Hi all,
    Can you guide me how to create a help view for a customized error message, we need to put some suggestions in it so that user can can resolve this issue with this guide. ( the short text is too short to describe all situations via TC:SE91)
    Thanks very much!
    Bruce, Wen

    Hi Bruce,
    Could you brief your concerns again.
    Why don't you maintain long text in message class for long description.
    Regards,
    Ranjith N

  • Create a materialized view on a base view

    I want to create a materialized view on a master view (ordinary view, not a mat. view). But i can not make it work. can it work? I have created a primary key on the master view as:
    create or replace force view v_xxx(a, b)
    unique rely disable novalidate,
    constraint a_pk primary key (a) rely disable novalidate)
    as select a ,b
    from xxx
    When I then try to create the mat. view:
    create materialized view mv_xxx refresh complete
    with primary key
    as
    select * from [email protected]
    I get:
    ORA-12014: table 'V_xxx' does not contain a primary key constraint
    What am I doing wrong?

    I suppose OP is on a 9i db (cause I can't reproduce on 11gr2) and the error is because of the database link:
    SQL> create table emp_t
    as
       select * from emp
    Table created.
    SQL> create or replace view v_emp_t
       empno   constraint v_emp_t_pk primary key rely disable novalidate,
       ename
    as
       select empno, ename from emp_t
    View created.
    SQL> create materialized view mv_emp_t refresh complete
    with primary key
    as
    select * from v_emp_t
    Materialized View created.
    SQL> drop materialized view mv_emp_t
    Materialized View dropped.
    SQL> create materialized view mv_emp_t refresh complete
    with primary key
    as
    select * from v_emp_t@loopback
    Error at line 32
    ORA-12014: table 'V_EMP_T' does not contain a primary key constraintYou can wrap the view with the db link in another view though:
    SQL> create or replace view v_emp_t2
       empno   constraint v_emp_t2_pk primary key rely disable novalidate,
       ename
    as
       select empno, ename from v_emp_t@loopback
    View created.
    SQL> create materialized view mv_emp_t refresh complete
    with primary key
    as
    select * from v_emp_t2
    Materialized View created.

Maybe you are looking for

  • Can I add a second line?

    Can you add a second line to Blackberry? If so, how do I do it??

  • Error: 500    Cannot create bean of class Simulation

    Hello, I was working with J2ee 1.2 and suddenly I got this error. Any one has an idea about it?, I can't continue working. Thanks... Error: 500 Internal Servlet Error: javax.servlet.ServletException: Cannot create bean of class Simulation      at org

  • Can I control the genie effect for the editing toolbar?

    On my laptop I notice that the photo editing toolbar at the bottom comes up when I move the cursor to the bottom of the screen but on my 27" iMac it is always up at the bottom. Is there a way to turn on the genie effect so the toolbar is not seen on

  • Web service proxy on security issue

    Using jdeveloper 11g R1(11.1.1.2.0)+fusion middleware em : 1.I protected a web service with wss policy of wss_user_name_token_service_policy then deployed to in independent WLS 10.3.2 2.Created a web service proxy with wss policy of wss_user_name_tok

  • Why cant i see icloud in system preferences?

    why cant i see icloud in my system preferences?