Creating Material Under three categories
Hi All
I have question about assigning a material to several groups while creating material master.
While creating a material, a material has to be assigned to 3 groups.
1) Material group such as Rubber, Plastic etc, Metal
2) u201CMarketing categoryu201D for discount purpose, eg. Consumables, High value item
3) Another group to say where this items fits, such as TV, Bicycle etc.
For example, if a Material Master has to be created for a small screw which fits into a TV, it has to be assigned to three categories (1) Metal, (2) Low value item (3) TV.
Serial number 1 i.e. Metal can be taken care by mapping to Standard SAP u201CMaterial groupu201D. But I am not able to make out where we can accommodate the remaining two categories. Please suggest me two other fields in SAP to map the remaining two categories.
Please note, DIVISION and PRODUCT HIERARCHY can not be used as they are already taken up for different purpose.
Hi,
You can go for MPN number for your case.
You can create 1 Inventorized material where the stock will update during the GR
and for this you need to create 3 MPN numbers which can be used during the Procurement
3 MPN for Three categories (1) Metal, (2) Low value item (3) TV.
& link these to your main inventorized material, so that while procurement you can use 1 category for 1 time & 2nd category for 2nd time but the stock will update in the inventorized material.
rgds
gsc
Similar Messages
-
How to create materialized view based on a view?
Hi,
I hope this is not very far fetched idea.
I have a very complex view and I would like to replicate it 'in place' that is I would like to make a materialized view that is based on this view complex view. I would like to use this materialized view (i.e table) to query data instead of using the original view, since it takes Oracle some 10-15 seconds to execute my query on the original view and I am not allowed to create indexes on most of the tables that are included in the original view.
Can this be done?
Best regards,
Tamas SzecsyThe best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
select text
from user_views
where view_name = 'NAME_OF_VIEW'
You can then cut and paste the sql statement into your create materialized view statement.
Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
SQL> set long 2048 -
How to create materialized view based on a synonym
Hi all,
I am trying to create simple materialized view based on a synonym and that synonym is pointing a view in other database (using dblink). I am getting table or view not found error . I am able to select synonym if i use select but not in materialized view. Please help me.
Thanks,The best way to do this is to create a materialzed view based on the underlying code of the original view. If you don't have this handy, issue the following in sqlplus:
select text
from user_views
where view_name = 'NAME_OF_VIEW'
You can then cut and paste the sql statement into your create materialized view statement.
Please note, you will probable have to set the long parameter to a higher value to reveal the complete statement for example:
SQL> set long 2048 -
Issue with creating materialized view
Hi,
We have a select query (containing joins, aggregates and UNION ALL’s) using which we are creating materialized views. We were able to create these mat views in development environment, however when tried to run the same scripts in a higher environment the creation never completes. The higher environment has three times more data than in Dev currently.
The below operations complete well in time , but when we add “CREATE MATERIALIZED VIEW MAT_VIEW_NAME” to the select query it takes forever (we have cancelled the operation after waiting for more 1 hour)
Select count(1) from the complete Mat. View query - takes 3.2 min to complete - the query resullts in 3,010,068 rows
Create Normal VIEW using complete Mat. View select query - takes 3.06 sec to complete
Create table using complete Mat. View select query takes 5.75 min to complete - the query resullts in 3,010,068
Does anyone have an idea why this could be happening ? if you have ever faced this kind of issue, can you please provide pointers on how you were able to solve the problem. We are using Oracle 11g.
Let me know if I have to provide any other information for you to understand the issue better.
ThanksSELECT vis.uid, findet.yr, findet.ect, vis.ind,
tm_view.col1_id, tm_view.col1_name,
tm_view.col2_id, tm_view.col2_name,
tm_view.col3_id, tm_view.col3_name,
clnt.cl_id, clnt.cl_nm,
prodparent_view.parent_cd,
prodparent_view.parent_desc,
prod_view.parent_cd,
prod_view.parent_desc,
prod_view.child_cd,
prod_view.child_desc,
SUM (value1), SUM (value2),
SUM (value3), SUM (value4),
SUM (value5), SUM (value6),
SUM (value7), SUM (value8),
SUM (value9), SUM (value10),
SUM (value11), SUM (value12)
FROM vis,
(SELECT *
FROM analytic_e,
(SELECT table_val
FROM TAB_CHECK s
WHERE s.tgt_table_nm = 'ANALYTIC'
AND s.table_val = 'ANALYTIC_E')
WHERE table_val = 'ANALYTIC_E'
UNION ALL
SELECT *
FROM analytic_o,
(SELECT switch_val
FROM tab_check s
WHERE s.tgt_table_nm = 'ANALYTIC'
AND s.switch_val = 'ANALYTIC_O')
WHERE switch_val = 'ANALYTIC_O') findet,
prod_view,
prodparent_view,
tm_view,
clnt,
(select to_number(to_char(ref_dt,'yyyy'))-1 year_agg from DATE_TABLE) tbabt
WHERE tbabt.yr = findet.yr
AND vis.cl_key = findet.cl_key
AND tm_view.hi_key = findet.hi_key
AND prod_view.child_cd = findet.prod_cd
AND clnt.cl_key = findet.cl_key
AND prodparent_view.child_cd = prod_view.parent_cd
GROUP BY vis.uid, findet.yr, findet.ect, vis.ind,
tm_view.col1_id, tm_view.col1_name,
tm_view.col2_id, tm_view.col2_name,
tm_view.col3_id, tm_view.col3_name,
clnt.cl_id, clnt.cl_nm,
prodparent_view.parent_cd
prodparent_view.parent_desc
prod_view.parent_cd
prod_view.parent_desc
prod_view.child_cd
prod_view.child_desc
Higher Environment
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 57M| 65G| | 20M (1)| 66:48:28 | | |
| 1 | HASH GROUP BY | | 57M| 65G| 73G| 20M (1)| 66:48:28 | | |
|* 2 | HASH JOIN | | 57M| 65G| | 109K (2)| 00:21:58 | | |
| 3 | TABLE ACCESS BY INDEX ROWID | HIER | 2100 | 244K| | 172 (0)| 00:00:03 | | |
|* 4 | INDEX RANGE SCAN | UK_HIER | 2100 | | | 16 (0)| 00:00:01 | | |
|* 5 | HASH JOIN | | 57M| 59G| | 109K (1)| 00:21:52 | | |
| 6 | VIEW | VW_GBF_25 | 1908 | 868K| | 2612 (1)| 00:00:32 | | |
| 7 | HASH GROUP BY | | 1908 | 141K| | 2612 (1)| 00:00:32 | | |
| 8 | VIEW | | 45107 | 3347K| | 2609 (1)| 00:00:32 | | |
| 9 | UNION-ALL | | | | | | | | |
| 10 | HASH UNIQUE | | 22518 | 1473K| 1872K| 1010 (1)| 00:00:13 | | |
|* 11 | TABLE ACCESS FULL | HIER | 22518 | 1473K| | 650 (1)| 00:00:08 | | |
| 12 | HASH UNIQUE | | 22518 | 1165K| 1512K| 947 (1)| 00:00:12 | | |
|* 13 | TABLE ACCESS FULL | HIER | 22518 | 1165K| | 650 (1)| 00:00:08 | | |
| 14 | HASH UNIQUE | | 71 | 1917 | | 652 (1)| 00:00:08 | | |
|* 15 | TABLE ACCESS FULL | HIER | 22518 | 593K| | 650 (1)| 00:00:08 | | |
|* 16 | HASH JOIN | | 64M| 38G| 4936K| 106K (1)| 00:21:16 | | |
| 17 | VIEW | | 45107 | 4404K| | 2609 (1)| 00:00:32 | | |
| 18 | UNION-ALL | | | | | | | | |
| 19 | HASH UNIQUE | | 22518 | 1473K| 1872K| 1010 (1)| 00:00:13 | | |
|* 20 | TABLE ACCESS FULL | HIER | 22518 | 1473K| | 650 (1)| 00:00:08 | | |
| 21 | HASH UNIQUE | | 22518 | 1165K| 1512K| 947 (1)| 00:00:12 | | |
|* 22 | TABLE ACCESS FULL | HIER | 22518 | 1165K| | 650 (1)| 00:00:08 | | |
| 23 | HASH UNIQUE | | 71 | 1917 | | 652 (1)| 00:00:08 | | |
|* 24 | TABLE ACCESS FULL | HIER | 22518 | 593K| | 650 (1)| 00:00:08 | | |
|* 25 | HASH JOIN | | 3021K| 1550M| 15M| 24492 (1)| 00:04:54 | | |
| 26 | PARTITION HASH ALL | | 491K| 10M| | 1059 (1)| 00:00:13 | 1 | 16 |
| 27 | MAT_VIEW ACCESS FULL | VIS | 491K| 10M| | 1059 (1)| 00:00:13 | 1 | 16 |
|* 28 | HASH JOIN | | 388K| 190M| 6056K| 12929 (1)| 00:02:36 | | |
| 29 | TABLE ACCESS FULL | CLNT | 64540 | 5294K| | 411 (1)| 00:00:05 | | |
|* 30 | HASH JOIN | | 388K| 159M| | 4072 (1)| 00:00:49 | | |
| 31 | TABLE ACCESS FULL | DATE_TABLE | 2 | 16 | | 3 (0)| 00:00:01 | | |
| 32 | VIEW | | 582K| 235M| | 4065 (1)| 00:00:49 | | |
| 33 | UNION-ALL | | | | | | | | |
| 34 | NESTED LOOPS | | 272K| 52M| | 1860 (1)| 00:00:23 | | |
|* 35 | TABLE ACCESS BY INDEX ROWID| TAB_CHECK | 1 | 46 | | 1 (0)| 00:00:01 | | |
|* 36 | INDEX UNIQUE SCAN | SYS_C0041157 | 1 | | | 0 (0)| 00:00:01 | | |
| 37 | PARTITION RANGE ALL | | 272K| 40M| | 1859 (1)| 00:00:23 | 1 |1048575|
| 38 | TABLE ACCESS FULL | ANALYTIC_E | 272K| 40M| | 1859 (1)| 00:00:23 | 1 |1048575|
| 39 | NESTED LOOPS | | 309K| 58M| | 2205 (1)| 00:00:27 | | |
|* 40 | TABLE ACCESS BY INDEX ROWID| TAB_CHECK | 1 | 46 | | 1 (0)| 00:00:01 | | |
|* 41 | INDEX UNIQUE SCAN | SYS_C0041157 | 1 | | | 0 (0)| 00:00:01 | | |
| 42 | PARTITION RANGE ALL | | 309K| 44M| | 2204 (1)| 00:00:27 | 1 |1048575|
| 43 | TABLE ACCESS FULL | ANALYTIC_O | 309K| 44M| | 2204 (1)| 00:00:27 | 1 |1048575|
Development
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1696K| 1276M| | 291K (1)| 00:58:20 | | |
| 1 | HASH GROUP BY | | 1696K| 1276M| 1325M| 291K (1)| 00:58:20 | | |
|* 2 | HASH JOIN | | 1696K| 1276M| | 9721 (2)| 00:01:57 | | |
| 3 | VIEW | | 15464 | 1132K| | 1855 (1)| 00:00:23 | | |
| 4 | UNION-ALL | | | | | | | | |
| 5 | HASH UNIQUE | | 7681 | 502K| | 618 (1)| 00:00:08 | | |
|* 6 | TABLE ACCESS FULL | HIER | 7681 | 502K| | 617 (1)| 00:00:08 | | |
| 7 | HASH UNIQUE | | 7681 | 375K| | 618 (1)| 00:00:08 | | |
|* 8 | TABLE ACCESS FULL | HIER | 7681 | 375K| | 617 (1)| 00:00:08 | | |
| 9 | HASH UNIQUE | | 102 | 2448 | | 618 (1)| 00:00:08 | | |
|* 10 | TABLE ACCESS FULL | HIER | 7681 | 180K| | 617 (1)| 00:00:08 | | |
|* 11 | HASH JOIN | | 371K| 252M| | 7847 (2)| 00:01:35 | | |
| 12 | VIEW | | 15464 | 1510K| | 1855 (1)| 00:00:23 | | |
| 13 | UNION-ALL | | | | | | | | |
| 14 | HASH UNIQUE | | 7681 | 502K| | 618 (1)| 00:00:08 | | |
|* 15 | TABLE ACCESS FULL | HIER | 7681 | 502K| | 617 (1)| 00:00:08 | | |
| 16 | HASH UNIQUE | | 7681 | 375K| | 618 (1)| 00:00:08 | | |
|* 17 | TABLE ACCESS FULL | HIER | 7681 | 375K| | 617 (1)| 00:00:08 | | |
| 18 | HASH UNIQUE | | 102 | 2448 | | 618 (1)| 00:00:08 | | |
|* 19 | TABLE ACCESS FULL | HIER | 7681 | 180K| | 617 (1)| 00:00:08 | | |
|* 20 | HASH JOIN | | 122K| 71M| | 5987 (2)| 00:01:12 | | |
|* 21 | TABLE ACCESS FULL | HIER | 7681 | 915K| | 617 (1)| 00:00:08 | | |
|* 22 | HASH JOIN | | 122K| 57M| 4512K| 5368 (2)| 00:01:05 | | |
|* 23 | HASH JOIN | | 9556 | 4395K| 3856K| 2409 (2)| 00:00:29 | | |
| 24 | TABLE ACCESS FULL | CLNT | 74426 | 2979K| | 310 (1)| 00:00:04 | | |
|* 25 | HASH JOIN | | 9556 | 4012K| | 1710 (2)| 00:00:21 | | |
| 26 | TABLE ACCESS FULL | DATE_TABLE | 1 | 7 | | 3 (0)| 00:00:01 | | |
| 27 | VIEW | | 19112 | 7894K| | 1706 (2)| 00:00:21 | | |
| 28 | UNION-ALL | | | | | | | | |
| 29 | MERGE JOIN CARTESIAN | | 19111 | 4068K| | 1701 (2)| 00:00:21 | | |
|* 30 | TABLE ACCESS FULL | TAB_CHECK | 1 | 49 | | 3 (0)| 00:00:01 | | |
| 31 | BUFFER SORT | | 248K| 40M| | 1698 (2)| 00:00:21 | | |
| 32 | PARTITION RANGE ALL| | 248K| 40M| | 1698 (2)| 00:00:21 | 1 |1048575|
| 33 | TABLE ACCESS FULL | ANALYTIC_E | 248K| 40M| | 1698 (2)| 00:00:21 | 1 |1048575|
| 34 | MERGE JOIN CARTESIAN | | 1 | 537 | | 5 (0)| 00:00:01 | | |
| 35 | PARTITION RANGE ALL | | 1 | 488 | | 2 (0)| 00:00:01 | 1 |1048575|
| 36 | TABLE ACCESS FULL | ANALYTIC_O | 1 | 488 | | 2 (0)| 00:00:01 | 1 |1048575|
| 37 | BUFFER SORT | | 1 | 49 | | 3 (0)| 00:00:01 | | |
|* 38 | TABLE ACCESS FULL | TAB_CHECK | 1 | 49 | | 3 (0)| 00:00:01 | | |
| 39 | PARTITION HASH ALL | | 810K| 16M| | 1456 (2)| 00:00:18 | 1 | 16 |
| 40 | MAT_VIEW ACCESS FULL | VIS | 810K| 16M| | 1456 (2)| 00:00:18 | 1 | 16 |
----------------------------------------------------------------------------------------------------------------------------------------- -
Insufficient Privileges when create materialized view as user system
If I login as system (connect sys/****@DevDB) and try to create a materialized view for another schema (e.g. XDCONTROLDB), I get the insufficient privileges error. If I login as sys as sysdba then I can create successfully.
I have searched some ariticles in Google and grant create any snapshot, create any table, create any view, global query rewrite, select any table system privileges to system but still get the same error.
Any other privileges I need to grant to system?
Cheers
below is a sample script to create the view which get the error:
CREATE MATERIALIZED VIEW XDControlDB."XDTest1" PCTFREE 10
PCTUSED 0 MAXTRANS 255
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0)
TABLESPACE "USERS"
BUILD IMMEDIATE
REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
ENABLE QUERY REWRITE AS
SELECT * From XDControlDB.RiskInstance;
Message was edited by:
user500168
Message was edited by:
user500168Thanks for your reply. After I grant privileges to system, I login as system and try to create the view as below which I get the insufficient privileges error:
CREATE MATERIALIZED VIEW XDControlDB."XDTest1" PCTFREE 10
PCTUSED 0 MAXTRANS 255
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0)
TABLESPACE "USERS"
BUILD IMMEDIATE
REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
ENABLE QUERY REWRITE AS
SELECT 1 From XDControlDB.RiskInstance;
As you can see, I try to create the view under a schema called 'XDCONTROLDB'. If I login as sys as sysdba, then it create successfully.
After I create UserA, and grant the privileges I mentioned in the ealier post, I login as UserA, and run the statement above I get the same privileges error. But if I change the stament to below which will create the view under UserA's schema, then it create successfully:
CREATE MATERIALIZED VIEW UserA."XDTest1" PCTFREE 10
PCTUSED 0 MAXTRANS 255
STORAGE ( INITIAL 64K NEXT 0K MINEXTENTS 1 MAXEXTENTS
2147483645 PCTINCREASE 0)
TABLESPACE "USERS"
BUILD IMMEDIATE
REFRESH COMPLETE START WITH sysdate NEXT sysdate + 1/24
ENABLE QUERY REWRITE AS
SELECT 1 From XDControlDB.RiskInstance;
Looking for your suggestions,
Cheers -
Different Valuations for material under a Plant
Dear experts,
I have created the a plant & assigned different storage locations under the plant. Is it possible to have MAP (Valuation) at storage location level?
Is it possible to have split valuation at a plant level or is it at the Company code level?
If it is possible can you send the configuration to my ID vskrishna#gmail.com
Useful answers shall be duly rewarded.
Useful answers duly rewardedHi,
It is not possible to have split valuation activated at storage location level. But yes, it is possible to activate it at plant level.
In Material Master Table, at the time of creation of master data, there is a field in Accounting-1 view. The field name is "Valuation Category".
OMWC & OMW0 are t-codes for configuring & activating split valuation.
Specify the valuation category (u can create user defined category also as per your requirement) when creating material at plant level and goto organizational level tab. Select valuation type created through above t-codes to split valuation of material.
Also please note and ensure that if you want to have split valuation of a particular material then it has to have price indicator "V" at header level. And only at split level you can have indicator "S". Bocs if you put indicator "S" at header level you can not have split valuation activated.
please revert in case of any doubt. -
How to create material group hierarchy ?
Hi,
I would like to know how to create material group hierarchy in ECC 6.0
Thanks in advance for your help,
Kind regards,
YannHi ,
The material group hierarchy and product heirarchy is used in SD of ECC 6.0 . These can be created in Logistics General -> Material Master-> settings for Key fields--> Data Relevant to Sales and Distribution-> 1)
define product categories
2)Define material groups
But If you want to make of use of this in SRM ,I won't think it is available . I guess Probably this is avl for CRM .
Regards
Mani
Message was edited by:
Manikanda Ilango S. -
Library class to create material in standard material Table
Hey Hi,
I need to create a proxy class which will create material in standard Material Table.I cannot find a library class for the same in my tabel ........now want to create it a proxy library class which would create material in standard R3 table like mara ......
Please help me out as i am new to ABAP.
Thanks in Advance,
Neethu JoyNeethu,
SAP is an enterprise system with a RDBMS under it. Records are not solely created in core tables (like MARA)... instead a transaction is executed that creates the material. In the midst of this transaction, a MARA table entry is created as well as numerous other table entries.
You should look to BAPI_STANDARDMATERIAL_CREATE in t-code SE37. You can create a proxy from this BAPI - you can even create a Web Service that can be implemented in an external app. -
I want validation while creating material master with profit center
Dear Experts,
I want validation while creating material master with profit center.
If 0001 plant having 100100 profit center
0002 plant having 200200 profit center
Material A cant be created for 0001 plant for with wrong profit center 200200.
Kindly help & provide me solution clearlyHi,
Profit centers are assigned to controlling areas. And controlling areas can have many plants under them. So as long as both the plants and profit centers are in the same controlling area users will be able to extend the materials.
You should put in your validation control in the material master user exit. One of the exits you can use is
MGA00001 Material Master (Industry): Checks and Enhancements
Thanks & regards
Hameed Parvez -
I got an error while creating material "Material does not exist or not activated". Can anybody help me.
BR//
Irfhi
I think you have posted your question in wrong place.
Can you please make your question more clear.
regards!
ramesh
Edited by: Ramesh kumar.p on Feb 22, 2010 12:48 PM
Edited by: Ramesh kumar.p on Feb 22, 2010 12:50 PM -
Runtime error in LSMW to create Material Master
Hi all,
I am trying to create Material No. using direct input method in lsmw. The program name is RMDATIND. But while executing the last step i.e Start Direct input program I am getting a runtime error
"A RAISE statement in the program "SAPLMG25" raised the exception
condition "NOT_FOUND".
Since the exception was not intercepted by a superior
program, processing was terminated."
I have checked all the steps of lsmw. Any idea why this specific error is coming?Are you able to create the material manually with the data. If you have checked the basic data view then i would check to see if base unit of measure is mandatory and if its being passed/mapped properly for the material you are creating.
-
Creating Materialized View in Toad
As with every new endeavor - come new questions.
I am trying to create a materialized view via toad (first time doing this). Now - toad is great, since it provides a kind-of wizard interface. Hence, one doesn't have to completely code in the create statement, with all of the options, etc.
Instead, in toad, one can (via the schema browser), go into the Materialized Views tab and click on create new. This opens a window with 6 tabs: Basic Info, Refresh Info, Physical Attributes, Query, Partitions & Subpartition Template.
In the Basic Info, one can put a check mark next to some of the following options:
-Build Deffered
-Parallel
-Cache
-Logging
-Using index
-Allow updates
etc.
I have read that build deferred refers to whether or not you would like the view to be created automatically or to be deferred.
Anyways, I tried to find Toad documentation to explain each of the options in-detail. No success. Hence, am researching each part piece by piece.
But - here is my question:
In the Query tab, we are asked to specify a query. I am assuming that the query does not have to be a full query, beginning with CREATE MATERIALIZED VIEW mv_table1 REFRESH FAST etc...
Since in this 'wizard', we are providing the MV name at the top of the dialog box, we are checking the 'options' in the other tabs, etc.
And so, I assumed that the query should merely be a select query in the window mentioned above.
So I entered the following:
select * from table1@remote_db;
When I go to verify the syntax, I get the error message: ORA_00911: invalid character. It seems to be pointing to my db_link (remote_db). I have been using this link throughout many places, w/o any problems.
Has anyone created a MV in toad before? Any links to good toad documentation would be helpful as well.
Thanks.(This is fun... ;))
For anyone endeavoring this in the future, below I have attached the prerequisites required in order to create a materialized view (can also be found @ http://download-uk.oracle.com/docs/cd/B14117_01/server.101/b10759/statements_6002.htm):
Prerequisites
The privileges required to create a materialized view should be granted directly rather than through a role.
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.
To create a refresh-on-commit materialized view (ON COMMIT REFRESH clause), in addition to the preceding privileges, you must have the ON COMMIT REFRESH object privilege on any master tables that you do not own or you must have the ON COMMIT REFRESH system privilege.
To create the materialized view with query rewrite enabled, in addition to the preceding privileges:
If the schema owner does not own the master tables, then the schema owner must have the GLOBAL QUERY REWRITE privilege or the QUERY REWRITE object privilege on each table outside the schema.
If you are defining the materialized view on a prebuilt container (ON PREBUILT TABLE clause), then you must have the SELECT privilege WITH GRANT OPTION on the container table.
The user whose schema contains the materialized view must have sufficient quota in the target tablespace to store the master table and index of the materialized view or must have the UNLIMITED TABLESPACE system privilege.
When you create a materialized view, Oracle Database creates one internal table and at least one index, and may create one view, all in the schema of the materialized view. Oracle Database uses these objects to maintain the materialized view data. You must have the privileges necessary to create these objects. -
Error while creating materialized view which using database link
Helo!
I'm getting error "ORA-00942: table or view does not exist" when I want to create materialized view.
Details:
1. On destination database I create a database link:
CREATE DATABASE LINK SDATABASE
CONNECT TO MYUSER
IDENTIFIED BY MYUSERPASS
USING 'ORCL';
=> Command "SELECT * FROM TABLE1@SDATABASE" returns data normally!
2. On source database I create MATERIALIZED VIEW LOG:
CREATE MATERIALIZED VIEW LOG
ON TABLE1
WITH PRIMARY KEY
INCLUDING NEW VALUES;
3. Now, when I want to create MATERIALIZED VIEW on destination database:
CREATE MATERIALIZED VIEW TABLE1
REFRESH FAST
START WITH SYSDATE
NEXT SYSDATE + 1/1440
WITH PRIMARY KEY
AS SELECT * FROM TABLE1@SDATABASE;
...I get error "ORA-00942: table or view does not exist"!
How is that possible if command "SELECT * FROM TABLE1@SDATABASE" returns data normally?
Thanks,
VorancAnd, I'm using Oracle 10g.
Voranc -
How to CREATE MATERIALIZED VIEW LOG (MV fast refresh) with some JOINS
Hi @ all,
i'm trying to create a MATERIALIZED VIEW LOG for a fast refresh of a MATERIALIZED VIEW.
It works fine with a simple Request in the MATERIALIZED VIEW:
CREATE MATERIALIZED VIEW MV_ZOTD43_P
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT * FROM ZOTD43_P;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON ZOTD43_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_ZOTD43_P', 'f');
But when I use a complex SQL-Request with some JOINS (one of the Table with spatial Data) in the MATERIALIZED VIEW, I get an error:
CREATE MATERIALIZED VIEW MV_TEST
TABLESPACE GDII
BUILD IMMEDIATE
REFRESH FORCE AS
SELECT lptd04_p.sst_nr AS sst_nr,
lptd03_p.aaaa AS aaaa,
lptd04_geom.geom as geom
FROM lptd04_p lptd04_p
JOIN lptd01_p lptd01_p ON lptd01_p.cre_nr = lptd04_p.sst_nr
JOIN lptd04_geom ON lptd04_geom.sst_nr = lptd04_p.sst_nr
JOIN lptd03_p lptd03_p ON lptd03_p.lief_nr = lptd04_p.lief_nr;
COMMIT;
CREATE MATERIALIZED VIEW LOG ON LPTD04_P
TABLESPACE "GDII"
WITH PRIMARY KEY, ROWID, SEQUENCE INCLUDING NEW VALUES;
call DBMS_MVIEW.REFRESH('MV_TEST', 'f');
Error report:
SQL Error: ORA-12004: REFRESH FAST kann für Materialized View "GDI"."MV_GDI_SST_STAMM" nicht benutzt werden
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2255
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2461
ORA-06512: in "SYS.DBMS_SNAPSHOT", Zeile 2430
ORA-06512: in Zeile 1
12004. 00000 - "REFRESH FAST cannot be used for materialized view \"%s\".\"%s\""
*Cause: The materialized view log does not exist or cannot be used. PCT
refresh is also not enabled on the materialized view
*Action: Use just REFRESH, which will reinstantiate the entire table.
If a materialized view log exists and the form of the materialized
view allows the use of a materialized view log or PCT refresh is
possible after a given set of changes, REFRESH FAST will
be available starting the next time the materialized view is
refreshed.
Am I doing something wrong or is it not possible CREATE MATERIALIZED VIEW LOG when the MATERIALIZED VIEW got some JOINS?
Regards,
GreqThanks for the link Alessandro ,
the error seems something to do with the Column-Type SDO_GEOMETRY, so
i create a new thread in the Spatial Discussion forum:
FAST REFRESHing of Oracle Materialized Views containing SDO_GEOMETRY column
Regards,
Greq -
Can we create materialized view on the top of another materialized view.
Hi ,
can we create materialized view on the top of another materialized view.
Thanks
NaveenWelcome , Just remember is not good apporch to do that since performance when MV refresh
Please mark this thread as answered .
Maybe you are looking for
-
My iPhone 3gs is shutting down and going into un-recovery mode?? : (
Hi, its my first time on here, due to the fact that I have never ever had any problems with my iPhone 3gs. Until 3 weeks ago. It all started when my e-mail decided that it was going to be difficult. so I go to restart my iPhone and my screen lock/ po
-
Somehow - My Time Capsule Has Insufficient Memory For A Back Up
I have a 1 TB Time Capsule. I recently got an email from apple stating that my mac is affected in a batch that has hard drive issues and was advised before taking it in to back up my mac. Before the email came through out of the blue, my Mac had lost
-
CGI/perl skript doesn't run
Hi ! I am facing problem in running a Perl CGI Script on Weblogic Application Server I set the CGIServlet Property in the Weblogic Properties file as # cgi configuration weblogic.httpd.register.cgi-bin=weblogic.servlet.CGIServlet weblogic.httpd.initA
-
My screen is black and won't open up
my screen is blank and won't open- i can't type my password, get messages, or answer a call.
-
I'm using data merge to generate pages from a product spreadsheet. The complication is, some columns should exist for some products (like "qty per bundle") but need to be hidden for others. Is there a way for InDesign to automatically include or remo