Materialized views or water courses
I'm working on 11 GR 2 on Red Hat LinuxI have a TBL_ADDRESS table on the DB1 database and it is an OLTP database
SQL> desc TBL_ADDRESSI'm working on a data warehouse that needs these details, and also must capture changes (Dimension to slow variation).
Name Null? Type
----------------------------------------- -------- --------------------
CODE_ID NOT NULL NUMBER(19)
ADDRESS_LINE_1 NOT NULL VARCHAR2(100)
ADDRESS_LINE_2 NOT NULL VARCHAR2(100)
CITY NOT NULL VARCHAR2(40)
COUNTRY NOT NULL VARCHAR2(40)
So I'm looking at a similar to that on the DB2(Data Warehouse) database table design
SQL> desc TBL_ADDRESS_HISTORYThe From_Date and To_Date fields will help me determine if the data is current and also it will help me to identify the changes that have occurred in the past.
Name Null? Type
----------------------------------------- -------- --------------------
CODE_ID NOT NULL NUMBER(19)
ADDRESS_LINE_1 NOT NULL VARCHAR2(100)
ADDRESS_LINE_2 NOT NULL VARCHAR2(100)
CITY NOT NULL VARCHAR2(40)
COUNTRY NOT NULL VARCHAR2(40)
FROM_DATE NOT NULL TIMESTAMP
TO_DATE TIMESTAMP
To get the data in the TBL_ADDRESS table in DB1, I have two options, configuration of the watercourse or using materialized views.
(1) in the case of option 1, I have the same table (TBL_ADDRESS stream) on the DB2 database configured using the replication flow from DB1 to DB2. Then I can create triggers (on TBL_ADDRESS in DB2) in order to identify changes and have full accordingly TBL_ADDRESS_HISTORY table.
(2) in the case of option 2, I have materialized view implemented using the links of db that will be refreshed every few hours. Also I will have TBL_ADDRESS in the populous initially DB2 table when DW is built. Until no refreshment of the MV, I'm having a procedure that checks the data in TBL_ADDRESS and the view materialized to see if there is no change and updates another table TBL_ADDRESS_HISTORY with the old data, if there is any change, so TBL_ADDRESS will have current data and TBL_ADDRESS_HISTORY will have the old data.
It seems that Option 1 is better but I have about 8 tables (which have to be met to obtain the relevant data) so I thought having 8 process of watercourse would be a little complex to maintain.
In the case of MV, I have 1 MV who joined all the tables of 8 and is updated twice a day.
Any suggestions/advice?
What do you mean by "8 workflow process? You would have a capture process, a propagation process, and a process applies that everything that happened to work with ADR of 8 different tables. Once you have configured streams, there is no increase in complexity to add additional tables in the replication process.
If you use feeds, why would you use the triggers for copy of changes to the ADDRESS table in the ADDRESS_HISTORY table? If it's the process that you are considering, you would be better with a custom apply Manager who just applied the LCR ADDRESS from the source system to the ADDRESS_HISTORY table in the data warehouse. Of course, in a data warehouse, I would refrain usually the ADDRESS table are replicated in place and that a separate process ETL (is not a trigger) the processed data.
Justin
Tags: Database
Similar Questions
-
ORA-12028: type of materialized view is not supported by the main site
Hi guys!
We face a problem these days about the materialized view.
We have upgraded database version 9.2.0.7 directly to 10.2.0.5 (RHEL4 x 86) on the same host. Database uses the driver dg4odbc to connect with remote SQL Server 2012 through data binding called MIKSERI. Our developer team would like to have replicated SQL server table data side Oracle using the materialized view.
They created Materialized view, but it is not at all to refresh the data. I tried to study a little bit, and whenever I try to change the view anyway I hit error:
ORA-12028: view type is not supported by the master site materialized @ 'MIKSERI '.
ORA-06512: at line 22
I looked at the solutions proposed and discovered that it is maybe the compatible database parameter, so I changed from previous 9.2.0.0.0 to 10.2.0.1.0 but still no luck. Just to emphasize this database is of course different clone of production to a different database, with db name retained and other parameters, but on another host computer and listening port. I even try to change global name, but still no luck.
Main problem is that refresh the work does not at all. To be more precise, we have created MV on the side of the Oracle and FULL Refresh should be done every 3 minutes. MV uses HS db link to the sql server database.During the creation of MV, we can see currently given to sql server, but the problem is that we cannot do MV to refresh every 3 minutes. When I try to change MV and put the refresh interval I get above error.
Any kind of help would be greatly appreciated,
Thank you
I found the reason why my MV update jobs failed, job_queue_processes parameter was equal to 0. I change this setting and now works fine.
Thank you for your time!
-
A drop materialized view error
I tried to drop two materialized views (I want to drop one and the other as a test to make sure that the behavior was consistent) with SQL Developer today, using the GUI, not the window of SQL command. When I did this, Developer SQL with these MVs among the tables, he tried to run a 'DROP TABLE' rather than a 'DROP MATERIALIZED VIEW' statement and an ugly error message came up with that and of course she didn't. Is this a bug that needs to be addressed? Or maybe that it is already identified and addressed in a future version?
Earl
Looks like you're down the underlying table, not the materialized view. If you have a my_mv of materialized view, there is also a table called my_mv.
You must drop the materialized since the Materialized View node in Object Explorer view.
-
A distributed query (remote several tables, several spaces), all refresh on demand. Note that I have no control over remote tables (impossible to create logs of MV, etc.) and I ask really just the difference in performance between the direct request and the MV.
My MV script:
CREATE MYSCHEMA MATERIALIZED VIEW. PRE-MEDICATION
STORAGE)
DEFAULT USER_TABLES
DEFAULT FLASH_CACHE
DEFAULT CELL_FLASH_CACHE
)
NOCACHE
NOLOGGING
NOCOMPRESS
NOPARALLEL
IMMEDIATE CONSTRUCTION
FULL REFRESH ON DEMAND
AS
< my query >
The query takes less than 2 seconds to turn, return of 600 lines. When you try to create the MV, I gave up after an hour. There is no index on the MV (of course, as I have not yet even created). The only hint in the query is to specify the table driven as the remote source.
I did not request (I'll do it if necessary) because I'm not as interested tuning the query as I am to determine why the MV would be so ridiculously slow compared to the query itself.>
The disappointing aspect of all this is that the query is essentially made of 3 tables remote (all from the same source, probably less than 1 k lines when joined to the top) and 1 local table (table of correspondence of line 37) while straight equi-joins.
>
Your solution is obvious.Create a local MV based ONLY on these 3 remote tables.
Then create your required local MV based on this new local MV first and your local table.
If these 3 remote lookup tables are even of the very useful by themselves and then create THREE local MVs, one for each of the remote tables.
And build your local MV required on the three new local VM and your local table.
You can add the MVs local to a group of refresh to refresh all at once with two approaches
An approach fracture rule often works well especially with as small as your tables.
-
Pivot can be used in fast refresh materialized view?
Hi, I have a question about materialized view nested mode fast refresh on Oracle 11 g (It support function of pivot, but oracle 10 g doesn't support).
When I created, he throws "ORA-12015: cannot create a view fast refresh materialized by a complex query.
Then I used dbms_mview.explain_mview to see reason, and it tell me the following
REFRESH_FAST_AFTER_INSERT ' view inline or subquery in LIST not supported for this type of MV.
Can someone help me, any suggestions will be appreciated
create table empX as select * from scott.emp; alter table empX add constraint PK_empX_empno primary key (empno); --drop MATERIALIZED VIEW LOG ON empX; CREATE MATERIALIZED VIEW LOG ON empX with rowid, sequence(empno); --drop MATERIALIZED VIEW mv_empX; CREATE MATERIALIZED VIEW mv_empX REFRESH FAST START WITH SYSDATE NEXT SYSDATE + 1/1440 AS select * from ( select rowid emp_rowid, deptno, job, sal from empX ) PIVOT( max(sal) for job IN ('ANALYST' job1, 'CLERK' job2, 'MANAGER' job3)); --select * from mv_capabilities_table declare lv_sqltext varchar2(4000); begin execute immediate 'truncate table mv_capabilities_table'; lv_sqltext := 'select * from ( select deptno, job, sal from empX ) PIVOT( max(sal) for job IN (''ANALYST'' job1, ''CLERK'' job2, ''MANAGER'' job3)) '; dbms_mview.explain_mview(lv_sqltext,'nested=>TRUE'); commit; end; /
Let me help you...
I have done following and it run/view updated because I just replaced quickly with a complete word, because there are limitations for quickly updatable views:SQL> show user; USER is "SCOTT" SQL> create table empX as select * from scott.emp; Table created. SQL> alter table empX add constraint PK_empX_empno primary key (empno); Table altered. SQL> SQL> --drop MATERIALIZED VIEW LOG ON empX; SQL> CREATE MATERIALIZED VIEW LOG ON empX with rowid, sequence(empno); Materialized view log created. SQL> SQL> --drop MATERIALIZED VIEW mv_empX; SQL> CREATE MATERIALIZED VIEW mv_empX 2 REFRESH COMPLETE WITH rowid 3 START WITH sysdate 4 NEXT SYSDATE + 1/1440 5 AS 6 select * from 7 ( 8 select rowid emp_rowid, deptno, job, sal from empX 9 ) 10 PIVOT( max(sal) for job IN ('ANALYST' job1, 'CLERK' job2, 'MANAGER' job3)); Materialized view created. SQL> select * from mv_empx; EMP_ROWID DEPTNO JOB1 JOB2 JOB3 ------------------ ---------- ---------- ---------- ---------- AAAShcAAEAAAATTAAN 10 1300 AAAShcAAEAAAATTAAE 30 AAAShcAAEAAAATTAAJ 30 AAAShcAAEAAAATTAAC 30 AAAShcAAEAAAATTAAA 20 800 AAAShcAAEAAAATTAAK 20 1100 AAAShcAAEAAAATTAAM 20 3000 AAAShcAAEAAAATTAAD 20 2975 AAAShcAAEAAAATTAAB 30 AAAShcAAEAAAATTAAI 10 AAAShcAAEAAAATTAAL 30 950 EMP_ROWID DEPTNO JOB1 JOB2 JOB3 ------------------ ---------- ---------- ---------- ---------- AAAShcAAEAAAATTAAF 30 2850 AAAShcAAEAAAATTAAG 10 2450 AAAShcAAEAAAATTAAH 20 3000 14 rows selected. SQL> begin 2 dbms_mview.refresh('SCOTT.mv_empx'); 3 end; 4 / PL/SQL procedure successfully completed. SQL> select * from mv_empx; EMP_ROWID DEPTNO JOB1 JOB2 JOB3 ------------------ ---------- ---------- ---------- ---------- AAAShcAAEAAAATTAAN 10 1300 AAAShcAAEAAAATTAAE 30 AAAShcAAEAAAATTAAJ 30 AAAShcAAEAAAATTAAC 30 AAAShcAAEAAAATTAAA 20 800 AAAShcAAEAAAATTAAK 20 1100 AAAShcAAEAAAATTAAM 20 3000 AAAShcAAEAAAATTAAD 20 2975 AAAShcAAEAAAATTAAB 30 AAAShcAAEAAAATTAAI 10 AAAShcAAEAAAATTAAL 30 950 EMP_ROWID DEPTNO JOB1 JOB2 JOB3 ------------------ ---------- ---------- ---------- ---------- AAAShcAAEAAAATTAAF 30 2850 AAAShcAAEAAAATTAAG 10 2450 AAAShcAAEAAAATTAAH 20 3000 14 rows selected. SQL>
So, the answer is Yes, we can use Pivot with Materialized view but:
1 MV must be full refresh.
2 oracle version should be 11 g; of course the pivot is available in Oracle 11 g.If this answers your question, please close the message, otherwise continue.
These links may also be of interest:
http://docs.Oracle.com/CD/B28359_01/server.111/b28313/basicmv.htm#i1007028
http://docs.Oracle.com/CD/B28359_01/server.111/b28313/basicmv.htm#i1007007http://rwijk.blogspot.in/2009/06/fast-refreshable-MATERIALIZED-view.html
And:
Please see if (Note: 179466.1 - view to fast refresh materialized diagnose ORA-12015 / complex queries) help.
Concerning
Girish Sharma -
Hello
I have a small question. How can I include a materialized view (that I created in the OWB) in OBIEE (11.1.1.5)?
Of course, I have to import the view with the administration tool, but I have to join the view with the fact table?
Is there a 'how to' or a tutorial about it? I searched but have not found something that helped me.
THXI'm glad you enjoyed... It is a good example of use. Instead of deployment, you can simply use the table select here. Just copy paste your select SQL table and add columns in the physical column.
See the SPR online help after pressing F1, once you open the RPD and search for "Opaque".
Hope this is useful
-
Are materialized views in Oracle OLAP licenses. ?
Hi all
We use the EE Oracle 10 g 2. We try to find the list of products of Oracle 10gEE. License part materialized views in Oracle OLAP or that come with the Standard edition.
Thank youCommerce 10.2 has a table of availability of the editing features (a SE, SE, EE) which establishes good enough differences:
http://download.Oracle.com/docs/CD/B19306_01/license.102/b14199/editions.htm#BABJICBBHowever I don't see, documentation, its use of MV (license) is clearly defined. Basically, it seems it depends of the use of MVs.
See, for example, Data Warehouse (syntheses) and integration - based replication. Sometimes, the documentation uses the phrase "materialized views to...» ». SQL aggregation / analytical seems to be a missing piece as well (in the current doc sets).
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14200/statements_6002.htm
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14223/basicmv.htm#i1006193
http://download.Oracle.com/docs/CD/B19306_01/server.102/b14226/repmview.htmThe new 11g Cube materialized views feature is of course an OLAP option.
And, as usual, you can find in the documentation, forums etc is almost irrelevant when it comes to licensing issues. You should see your specific contract. Talk to your sales person.
"License issues really, really, really should be addressed to your representative commercial Oracle." Nothing we say here links to Oracle. We don't know other agreements, your organization may have with Oracle. ... explaining that "a guy on the internet with a card to play said logo is OK," probably won't do more good. »
(borrowed from Oracle licenses VMware + QuadcorePublished by: orafad on January 27, 2011 20:39
-
is this allowed? materialized view the log for the remote database (via db lin
: Hi guys.
try to do
create materialized view log on user@xxx with sequence, rowid (col1, col2), including the new values;
where xxx is a remote db link
------
had this error
ORA-00949 - illegal reference to the remote database
Google but do not know whelther this error is an internal error or not allowed for mviews characteristic.
help pleaase!
Rgds,
Noobdo you mean that the materialized log should be created in the same location where the main table
YES. Of course, it must be there! Any update to the main table should also update the MV log that is created against it!
Hemant K Collette
-
Instead of trigger on a Materialized view?
Hello
We write INSTEAD OF trigger on the materialized view?
Piyushpeeyushgehlot wrote:
When we refresh materialized, view view full is truncated and new records get inserted, it is on the books and we can do service work, but when the incremental refresh is done, this trigger will run I don't know.I'm not sure that I am. A complete refresh will cause insert triggers (line level and the table, before and after) fire for each row of the materialized view. An additional update will cause insert, update, and delete triggers (line level and the table, before and after) in the fire for each changed row. It may be of course, updates that do not actually change the data depending on how one defines the materialized view, and how changes should be handled.
Justin
-
ORA-12008: error path refresh materialized view
Hello world
I get a weird error when I try to do a quick refresh on my materialized view. My basic approach is simple, that I had a newspaper of MV on my fact table with all the columns required by the materialized view, sequence, including NEW rowid VALUES.
I have my setup of materialized with a view my summary level, COUNT (*) and COUNT (EXP) for every SUM (EXP). I check the MV_CAPABILITIES_TABLE, and of course, it can be run with fast refresh. I have my fact table in the schema USER1 and my materialized in USER2 schema view.
When I create the materialized view, there is no problem. If I immediately executes a fast refresh (EXEC DBMS_MVIEW. REFRESH ('MY_MV', 'F'); ), once again, no problem.
However, if I run the ETLs that update the source fact table, and then I run the quick update again, I get ORA-120008.
But if I do the exact same MV in the scheme of the User1, I have no problem making quick refreshes. What is happening with this? Is the owner of the table must be the one with the materialized view? User1 and USER2 are on the same PB and have the same table space. Should User2 also select additional subsidies on the source fact table? What I give to select on the MVIEW connect you somehow?
Thanks for the help!
-JoeThe mview journal is a separate table. You must grant select, insert, update, delete on it to the user mview.
-
In the course of a day, I have many questions and I usually search without asking anyone, but alas, I'm tired.
I have a table partitioned fact daily avec.6 m record one day. 500 million total.
I want to create a materialized view summary on an Oracle 9.2 database.
It is not possible: create a quick refreshment MV with a column of count (distinct column1) and group by expression.
If a fast refresh is not possible, the entire table must be re-summaries, I guess? All records of 500 million.
Given that new records are inserted at the most a few days, is back there anyway just refresh the materialized for some scores, or a sneaky way to refresh view.
Maybe it's much too sneaky but I think unusable clues on source table (direct insertion disable index on this score), and re - aggregate in a normal partition table that have the unusable index.
Any ideas?
Get rid of the count (distinct column1) would increase the number of records in the aggregate of thousands to millions.
There is no primary key on the fact table.
I guess a newspaper MV aurait.6 m saves a day which seems like overloading meaningless for me.
Thank you.
Edited by: user610316 May 21, 2009 14:12user610316 wrote:
It is not possible: create a quick refreshment MV with a column of count (distinct column1) and group by expression.It may be possible. Once you create your MV you can query the MV_CAPABILITIES_TABLE to see what is and isn't possible, and what corrective action must be taken.
user610316 wrote:
If a fast refresh is not possible, the entire table must be re-summaries, I guess? All records of 500 million.Yes, a full refresh.
user610316 wrote:
Given that new records are inserted at the most a few days, is back there anyway just refresh the materialized for some scores, or a sneaky way to refresh view.Yes, track changes of Partition is updated to the level of granularity of partition.
-
How to get the text of the materialized view?
Hello
How to get test (query) of materialized view?
Thank youWith
the value of 10000 long
set pages 0
DBMS_METADATA. GET_DDL ('MATERIALIZED_VIEW', 'MV_EMP', 'SCOTT');Of course replace view_name and owner.
-
Impact on performance at the addition of materialized view logs at the tables?
I write a very complex query for a client of our database system transaction and this will require the creation of a materialized viewbecause, all attempts at development to make acceptable performance failed.
I want to activate the fast refresh the MVIEW but I am confused about the consequences of the addition of the addition of materialized view logs to the base tables.
Some tables are large and involved in a large number of transactions and I wonder if the INSERT/update performance will be seriously affected by the presence of a newspaper mview.
Maybe it's a simple question, but I was unable to find an answer very clear in the literature.
Thanks for all the answers!
Chris Mills
Biotechnology data management consultantThere is an overload for the newspapers of the view materialized, a little less, but roughly on par with a trigger that writes to a table.
If it is an OLTP system where you do a lot of low-value transactions, the general expenses percentage is probably not particularly great, something in the range of 5-10% maybe (although, of course, by running tests in the development environment would be desirable). If there are loads in bulk, the impact of the percentage could be higher.
Justin
-
find useless materialized views
Hello
is there a way to identify unnecessary materialized views?
Or conversely, materialized views are used?
Is there a similar way regarding the (surveillance) index?
We have already tried the auditing of the database feature, but it seems, that the audit uses only the
User SQL-query and not the result of the query rewriting.
Thanks in advance.
OliverNot a direct solution but a suggestion:
Query V$ SEGMENT_STATISTICS (for example, STATISTIC_NAME = 'logical reads') to the 'picture' segment that the MV is really. Of course, it won't tell you if the access is to leave a query directly on the MV itself or a query rewriting.
Hemant K Collette
http://hemantoracledba.blogspot.com -
What is the best way to change a column type in the materialized view?
Hello my dear friends,.
I want to change a column type in a materialized view. VARCHAR2 NUMBER, so what do you recommend? What is the best way to do it?
Thank you
You can not change the data type of the column while there are data in the MV, so you might as well give up and recreate the MV with a TO_CHAR() around the column in question in the application of MV to get the data exactly as you want (be sure to include an appropriate format mask). That said, I'm fighting to think reasonable grounds to make such a change.
Maybe you are looking for
-
thumbnails of Firefox start page
Firefox has a wonderful feature: the thumbnails that appear after pressing the NEW TAB. However, this feature does not appear in the start page for firefox but only in each new tab. Is it possible to have as firefox Homepage thumbnails?
-
New tabs will be open (ctrl-T, mouse click or menu)
For some reason, I can not open a new tab unless I did a right click on a hyperlink in the existing tab and select 'open in new tab '. When I click on "File/New Tab" nothing happens. When I click on the plus sign on the list of the tab nothing happen
-
Equium L40 - question on the latest graphics driver
Hello I have a laptop L40 and I have problems with the display driver. ? I use Win Xp SP3 I have all the latest drivers including Bios ver 5.5 The machine works fantastic and I am very happy with it, except for some graphics programs the only not to
-
I have windows ce 6.0 (embedded) gps 7 '' in my car. the problem is that it freezes and slows down touch inputs, when I play the music files he played intermittently, the same with the load. what I'm trying to say is that the touch response is carrie
-
Pavilion dv6 - 1253cl and Win 7
I installed Windows 7 on my Pavilion dv6 - 1253cl without problem until I had to use my printer HP C3150 all-in-one to scan a document. Now, I find that the HP Solution Center does not detect my printer. The printer works fine printing from applicati