LOGGING on materialized view
Could anybody tell me a reason to have the materialized views on a production environment in LOGGING mode ?
Thanks,
P.
I think you're maybe getting a bit confused between logging/nologging of a table, and a materialized view log, because there is no 'MV logging/nologging mode'.
Any Oracle table can be nologging, which mean direct path inserts ONLY to these tables don't generate redo.
A materialized view is implemented as a plain old Oracle table that represents the result of a query at a point in time. If you want to fast/incremental refresh a materialized view, you need to create materialized view log(s), which are implemented, again, as a plain old Oracle tables, that represent a set of changes to an underlying table.
Both the base tables of MVs, and the tables containing MV logs can be nologging, but this will never have any benefit, because they are never subjected to direct path inserts.
Question: Why generate redo for data that is duplicated elsewhere?
Generic Answer: Because Oracle has build MV functionality onto existing, thoroughly tested, plain old Oracle tables.
Better Answer: Because if you wanted to do a point in time recovery, would you rather just replay the redo, or replay the redo and rebuild every MV in your database? Maybe your MVs are very small, but there are database out there with MVs that take hours to rebuild.
Similar Messages
-
Materialized view logs in cloned database
Hi all!
We have materlialized views and materlialized view logs in two separate databases which are connected with a database link. The MV logs are in DB1_PROD, which is the database being cloned. The database link goes from DB2_PROD (where the MVs are located) to DB1_PROD:
DB2_PROD (materialized views) ----DB link---> DB1_PROD (materialized view logs)
When cloning DB1_PROD to DB3_DEV, the MV logs still have a reference to DB2_PROD. However, there is no connection between DB3_DEV and DB2_PROD.
In my opinion this is not harmful, but I would like to know if any of you can see any problems with this.
In summary;
DB1_PROD: Materialized view logs
DB3_DEV: Materialized view logs. Clone of DB1_PROD
DB2_PROD: Materialized views.
DB1_PROD and DB3_DEV:
select * from v$version;
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Linux: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
DB2_PROD:
select * from v$version;
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Linux: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - ProductionPlease let me know if you need further information.Oracle automatically purges rows in the materialized view log when they are no longer needed. Because Oracle must wait for all dependent materialized views to refresh before purging rows from a materialized view log, unwanted situations can occur that cause a materialized view log to grow indefinitely when multiple materialized views are based on the same master table or master materialized view.
For example, such situations can occur when more than one materialized view is based on a master table or master materialized view and one of the following conditions is true:
Materialized view is not configured for automatic refreshes and has not been manually refreshed for a long time. OR
Materialized view has an infrequent refresh interval, such as every year, etc
You can also refresh the materialized views associated with the log so that Oracle can purge rows from the materialized view log.
If a materialized view log needs to be purged manually for some reason a procedure called DBMS_MVEW.PURGE_LOG can be used.
Edited by: user130038 on Sep 30, 2011 6:49 AM -
Materialized View with No Logging Option;;; THX
Hi all,
What's the diffrence between a :
Materialized View with No Logging Option
Materialized View with Logging Option
thank youLOGGING|NOLOGGING specifies that subsequent Direct Loader (SQL*Loader) and direct-load INSERT operations against a nonpartitioned index, a range or hash index partition, or all partitions or subpartitions of a composite-partitioned index will be logged (LOGGING) or not logged (NOLOGGING) in the redo log file.
In NOLOGGING mode, data is modified with minimal logging (to mark new extents invalid and to record dictionary changes). When applied during media recovery, the extent invalidation records mark a range of blocks as logically corrupt, because the redo data is not logged. Therefore, if you cannot afford to lose this index, you must take a backup after the operation in NOLOGGING mode.
If the database is run in ARCHIVELOG mode, media recovery from a backup taken before an operation in LOGGING mode will re-create the index. However, media recovery from a backup taken before an operation in NOLOGGING mode will not re-create the index.
An index segment can have logging attributes different from those of the base table and different from those of other index segments for the same base table.
Message was edited by:
HAGGAR -
Disabling Materialized View Logs for a session
Hi all.
I was wondering if it is possible to disable the fast refresh log for materialized views for just a given session. So for all other sessions except this one the log would be added to. I'm using 11g.
In Oracle Database 11g, The Complete Reference on page 447 it states:
"As of Oracle 11g, the capture of changes in materialized view logs can be disabled for an individual session while logging continues for changes made by other sessions". But no instructions are given
Does anyone know how to do this? I have not been able to find the answer by looking around.
Thanks!Yeah, I had saw that Oracle mentioned it here also: http://download.oracle.com/docs/cd/B28359_01/server.111/b28279/chapter1.htm#FEATURENO07197
Any idea of what the code might look like? I've never had to alter an individual session for Oracle before. -
How do I use Primary Key and RowID in Materialized View Logs and MVs
How do I use Primary Key and RowID in Materialized View Logs and Materialized Views????
I donât understand in the Materalized View Logs the diference between Primary Key and RowID. Besides, I could choose both Primary Key and RowID.
When I have to use RowID?? Why?? And Primary Key??? And both, Primary Key and RowID????
Thank you very much!Yes, I have already read it...
But for example I donât Understand:
This is the example 8-1
CREATE MATERIALIZED VIEW LOG ON products
WITH SEQUENCE, ROWID
(prod_id, prod_name, prod_desc, prod_subcategory, prod_subcat_desc, prod_
category, prod_cat_desc, prod_weight_class, prod_unit_of_measure, prod_pack_
size, supplier_id, prod_status, prod_list_price, prod_min_price)
INCLUDING NEW VALUES;
But if I create a Materialized View with TOAD if I choose a KEY field I receive the error:
ORA-12026: invalid filter column detected
Then I have to take out the Key (in the above example prod_id)
And then the script is
CREATE MATERIALIZED VIEW LOG ON products
WITH ROWID, SEQUENCE, PRIMARY KEY!!!!!!!!!!!!!!!!!!!!
(prod_id, prod_name, prod_desc, prod_subcategory, prod_subcat_desc, prod_
category, prod_cat_desc, prod_weight_class, prod_unit_of_measure, prod_pack_
size, supplier_id, prod_status, prod_list_price, prod_min_price)
INCLUDING NEW VALUES;
I have PRIMARY KEY in the definition (I donât choose it) and I donât have the prod_id field
Why is it????
Note: If I execute the script to create the MV Log manually the PRIMARY KEY option NO IS in the script and the prod_id field either is in the script.
And on the other hand,
What is this:
CREATE MATERIALIZED VIEW LOG ON sales
WITH ROWID;
CREATE MATERIALIZED VIEW LOG ON times
WITH ROWID;
CREATE MATERIALIZED VIEW LOG ON customers
WITH ROWID;
These MATERIALIZED VIEW LOG contain any fields????
Or it contain the primary key fields of this tables (sales, times and customers)??? Then, Why is it ROWID instead of PRIMARY KEY????
Thanks! -
Bug: Can not create materialized view log on 11G XE
Hi,
I log in as HR user and try create materialized view log
CREATE MATERIALIZED VIEW LOG ON HR.EMPLOYEES;I get error
>
Error starting at line 1 in command:
CREATE MATERIALIZED VIEW LOG ON HR.EMPLOYEES
Error at Command Line:1 Column:0
Error report:
SQL Error: ORA-00439: feature not enabled: Advanced replication
00439. 00000 - "feature not enabled: %s"
*Cause: The specified feature is not enabled.
*Action: Do not attempt to use this feature.
>
You can create materialized view log on 10G XE without any problem.
Regards,
Jari
http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0Is it a bug in 11g or 10g?
It was reported earlier in now archived beta forum. {thread:id=2214092}
The current doc lists MV sites only (and "No" for Advanced Replication feature):
http://download.oracle.com/docs/cd/E17781_01/license.112/e18068/toc.htm#BABDFDAI -
Refresh a materialized view in parallel
Hi,
To improve the refresh performance for a materialized view, I set up it to be refreshed in parallel. The view can be refreshed successfully, however, I did not see the view is refreshed in parallel from session browser, can someone let me know if I miss any steps?
1) In DB A (running 8 CPUs), set up the base table to be parallelized, the base table is called table1
ALTER TABLE A.table1 PARALLEL ( DEGREE Default INSTANCES Default );
2) In Database A, set up the materialized view log
CREATE MATERIALIZED VIEW LOG
ON table1 WITH primary key
INCLUDING NEW VALUES;
3) In Database B (in the same server with Database A), there is an existing table called table1, prebuilt with millions of records in the table. Due to the size of table1, I have to use prebuilt option
Drop MATERIALIZED VIEW table1;
CREATE MATERIALIZED VIEW table1 ON PREBUILT TABLE
REFRESH FAST with primary key
AS
select /*+ PARALLEL(table1, 8) */ *
from table1@A;
4) in Database B, I executed this stored procedure -
EXECUTE DBMS_MVIEW.REFRESH(LIST=>'table1',PARALLELISM=>8, METHOD=>'F');
Thanks in advance!
LizI checked the execution plan when I executed the refresh stored procedure again, Does the plan indicates the parallel execution is working or not?
SELECT STATEMENT REMOTE ALL_ROWSCost: 32,174 Bytes: 775,392 Cardinality: 1,182
13 PX COORDINATOR
12 PX SEND QC (RANDOM) PARALLEL_TO_SERIAL SYS.:TQ10001 :Q1001
11 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1001
9 NESTED LOOPS PARALLEL_COMBINED_WITH_PARENT :Q1001Cost: 32,174 Bytes: 775,392 Cardinality: 1,182
6 BUFFER SORT PARALLEL_COMBINED_WITH_CHILD :Q1001
5 PX RECEIVE PARALLEL_COMBINED_WITH_PARENT :Q1001
4 PX SEND ROUND-ROBIN PARALLEL_FROM_SERIAL SYS.:TQ10000 A
3 VIEW APP_USR. Cost: 12,986 Bytes: 6,070,196 Cardinality: 275,918
2 HASH UNIQUE Cost: 12,986 Bytes: 9,105,294 Cardinality: 275,918
1 TABLE ACCESS FULL TABLE A.MLOG$_TABLE1 A Cost: 10,518 Bytes: 9,105,294 Cardinality: 275,918
8 PARTITION RANGE ITERATOR PARALLEL_COMBINED_WITH_PARENT :Q1001Cost: 0 Cardinality: 1
7 INDEX RANGE SCAN INDEX (UNIQUE) PARALLEL_COMBINED_WITH_PARENT A.PK_TABLE1 :Q1001Cost: 0 Cardinality: 1
10 TABLE ACCESS BY LOCAL INDEX ROWID TABLE PARALLEL_COMBINED_WITH_PARENT A.TABLE1 :Q1001Cost: 0 Bytes: 634 Cardinality: 1 -
Problem encountered when join two remote tables in a materialized view
I'm using oracle 9.2.0.6
1> I have two tables:
CREATE TABLE TEST
A VARCHAR2(100 BYTE),
C DATE
CREATE TABLE TEST1
A VARCHAR2(100 BYTE),
B TIMESTAMP
2>. I defined a prebuild table:
CREATE TABLE MV_TEST1
ID1 ROWID,
A VARCHAR2(100 BYTE),
ID2 ROWID,
B TIMESTAMP(6),
C DATE
3> I created mview logs:
CREATE MATERIALIZED VIEW LOG ON PSI_TEST.TEST
WITH ROWID
INCLUDING NEW VALUES;
CREATE MATERIALIZED VIEW LOG ON PSI_TEST.TEST1
WITH ROWID
INCLUDING NEW VALUES;
4> when I create mview:
CREATE MATERIALIZED VIEW PSI_TEST.MV_TEST1
ON PREBUILT TABLE WITH REDUCED PRECISION
REFRESH FAST ON DEMAND
WITH PRIMARY KEY
AS
select
test.rowid id1,
test.a,
test1.rowid id2,
test1.b,
cast(null as date) c
from test , test1
where test.a = test1.a(+);
It is created successfully.
5> problem:
when I use remote tables to do the same thing, say test and test1 are in another instance and are connected by a dbLink, I couldn't create the mview successfully:
CREATE MATERIALIZED VIEW PSI_TEST.MV_TEST1
ON PREBUILT TABLE WITH REDUCED PRECISION
REFRESH FAST ON DEMAND
WITH PRIMARY KEY
AS
select
a.rowid id1,
a.a,
b.rowid id2,
b.b,
cast(null as date) c
from test@dbl a, test1@dbl b
where a.a = b.a(+);
when run above statement, I got:
ORA-12015: cannot create a fast refresh materialized view from a complex query
Any ideas? Or joining two table through a dblink for a mview is not allowed at all?
Thanks in advance.No one has a clue?
Message was edited by:
lzhwxy -
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 -
Fast refresh of a materialized view works incorrect
Hi All,
I have created a MV using the sql below:
create materialized view WLS
refresh fast
enable query rewrite
as
SELECT Employees.USER_NAME,
Permissions.ROLE_NAME,
Vouchers.VOUCHER_ID,
EmployeeRoles.FROM_DATE,
EmployeeRoles.TO_DATE,
VoucherPatterns.rowid ACC_VOUCHER_PATTERNS_ROW_ID,
Vouchers.rowid ACC_VOUCHERS_ROW_ID,
Ledgers.rowid ACC_LEDGERS_ROW_ID,
Employees.rowid BANK_EMPLOYEES_ROW_ID,
IncExcUnits.rowid INC_EXC_UNITS_ROW_ID,
EmployeeRoles.rowid BANK_EMPLOYEE_ROLES_ROW_ID,
ParentRoles.rowid PARENT_ROLES_ROW_ID,
Roles.rowid ROLES_ROW_ID,
Permissions.rowid PERMISSIONS_ROLES_ROW_ID,
RolesMemberships.rowid ROLES_MEMBERSHIPS_ROW_ID
FROM ACC_VOUCHER_PATTERNS VoucherPatterns,
ACC_VOUCHERS Vouchers,
ACC_LEDGERS Ledgers,
BANK_EMPLOYEES Employees,
BANK_EMPLOYEE_INC_EXC_UNITS IncExcUnits,
BANK_EMPLOYEE_ROLES EmployeeRoles,
ROLES ParentRoles,
ROLES Roles,
ROLES Permissions,
ROLES_MEMBERSHIPS RolesMemberships
WHERE Vouchers.TYPE_VOUCHER_PATTERN_FK =
VoucherPatterns.VOUCHER_PATTERN_ID
AND VoucherPatterns.CONFIRM_COUNT = 2
AND Vouchers.STATE = 'ISU'
AND Vouchers.LEDGER_FK = Ledgers.LEDGER_ID
AND Employees.ID = IncExcUnits.BKEM_ID(+)
AND (((IncExcUnits.INC_EXCLUD_TYPE IS NULL OR
IncExcUnits.INC_EXCLUD_TYPE != 'EXC') AND
Ledgers.ORGANIZATION_UNIT_FK = Employees.ORGU_ID) OR
(Ledgers.ORGANIZATION_UNIT_FK = IncExcUnits.ORGU_ID AND
IncExcUnits.INC_EXCLUD_TYPE = 'INC'))
AND EmployeeRoles.BKEM_ID = Employees.ID
AND ParentRoles.ID = EmployeeRoles.ROLS_ID
AND ParentRoles.IS_PERMISSION = 'N'
AND ParentRoles.ROLE_TYPE = 'ORG'
AND ParentRoles.ID = Roles.ROLS_ID
AND Roles.IS_PERMISSION = 'N'
AND Roles.ROLE_TYPE = 'SYS'
AND Permissions.IS_PERMISSION = 'Y'
AND Permissions.ROLE_NAME = 'ACC_AccVoucherConfirm'
AND Roles.ID = RolesMemberships.ROLS_ID
AND Permissions.ID = RolesMemberships.ROLS_ID_MEMBER_OF;
Then I have issued a SELECT * though it and that works fine.
And then I've manipulated the data in some tables such that according to MV's WHERE clause it must return no rows.
Intuitively before refreshing the MV it will return the data last placed on it,
But it return the same data after issuing the following command in PL/SQL Developer:
call dbms_mview.refresh(list => 'WLS', method => 'F');
And unfortunately the following will correct it:
call dbms_mview.refresh(list => 'WLS', method => 'C');
Why the fast refresh of a fast refreshable MV does not work fine while its complete refresh works good?
How ever after undoing made changes to those tables and issuing the fast refresh using the following command the MV will contain correct updated data:
call dbms_mview.refresh(list => 'WLS', method => 'F');
It seems that it has bug in deleting rows from Fast Refreshable MV but upserts work fine.
I've tried to simulate the problem for a simpler query with simple tables containing some sample data but those don't have any problem.
Please help me,
ThanksThanks Martin,
Finally I've discovered one of possible several situations in which a MV fast refreshed incorrectly.
This is happened when an OR condition exists among several AND conditions and at least one outer join symbol there exists!
this is the scenario:
-- create two sample tables
create table t as select 1 a, 2 b from dual;
create table j as select 1 a, 2 b from dual;
-- defining primary keys
alter table t add constraint tp primary key (a);
alter table j add constraint jp primary key (a);
-- creating MV Logs
create materialized view log on t with primary key, rowid;
create materialized view log on j with primary key, rowid;
-- creating Fast Refresh MV with a sample query
create materialized view mvt refresh fast enable query rewrite as
select t.a, j.b, t.rowid tr, j.rowid jr from t,j where t.a = j.a(+)
and (t.b = j.b or t.a = t.b);
-- select through MV, the MV returns correct data
select * from mvt;
A B TR JR
1 2 AAAYwQAAEAAFhwzAAA AAAYwRAAEAAFhw7AAA
-- intentionally manipulate the data to the query returns no rows
update j set a = 2;
commit;
-- query the select of MV
select t.a, j.b, t.rowid tr, j.rowid jr from t,j where t.a = j.a(+)
and (t.b = j.b or t.a = t.b);
-- returns now rows, The query rewrite does not work here!
-- select through MV, the MV returns correct data because it has not refreshed yet!
select * from mvt;
A B TR JR
1 2 AAAYwQAAEAAFhwzAAA AAAYwRAAEAAFhw7AAA
-- fast refreshing the mv and issuing select again
call dbms_mview.refresh(list => 'MVT', method => 'F');
select * from mvt;
A B TR JR
1 null AAAYwuAAEAAFh2jAAA null
-- A change is occured but it is not correct, it must returns no rows!
-- query the select of MV
select t.a, j.b, t.rowid tr, j.rowid jr from t,j where t.a = j.a(+)
and (t.b = j.b or t.a = t.b);
A B TR JR
1 null AAAYwuAAEAAFh2jAAA null
-- Query rewrite does work here! because appending a neutral "and 1=1" conditions will show the correct empty result:
select t.a, j.b, t.rowid tr, j.rowid jr from t,j where t.a = j.a(+)
and (t.b = j.b or t.a = t.b) and 1=1;
-- returns no rows
-- now complete refreshing the MV and achieving the correct result:
call dbms_mview.refresh(list => 'MVT', method => 'C');
select * from mvt;
-- returns no rows
Is this a BUG?
Any suggestions? -
Is it any option for Incremental Refreshing of Materialized Views..
Hi All,
Is anyone have any idea about Incremental refrshing of Materialized views.
I mean i dont want to every time full refershing of MV its taking huge time.I am looking any incremental refrshing options for MViews.
Is it any options available n Oracle 9i/10g ?
Thanks n advance.
AnwarUse theREFRESH FAST ON COMMIT option
Example Steps
1. Create Materialized View Log
CREATE MATERIALIZED VIEW LOG ON table_name
WITH ROWID
Col1
Col2
Col...
INCLUDING NEW VALUES
2. Create the Materialized View using the above[b] table_name in the SELECT
CREATE MATERIALIZED VIEW mv_name
REFRESH FAST ON COMMIT
WITH ROWID
AS
SELECT xxxxx
Read more on this from SQL Reference Manual -
Creating a Materialized View Log After the Data has been instered
Hi,
I am trying to create a method of replication from Oracle to MySQL using the Materialized View Log table.
This has been done before and works quite well, the only problem is that I am trying to impliment the log after the table has been created and populated and wish to push all the existing data through the log file...
Does anyone know if it is possible to refresh the Materialized View Log and not a Materialized View.
The way the replication is intended to work is:
Oracle> Data inserted into table
Oracle> writes the vector data to the MVL
Script> Monitors the MVL and can see the changes being made to the Oracle Table
Script> Updates MySQL with the data and removes the rows from the MVL
MySQL is then used with other unix systems
Currently we export the data from the table using Triggers and a cronjob running every x minute to check for changes in the TriggerTables
Many thanks for your time on this, I have been checking for almost a whole working day and not found the answer to this problem.Thats what I thought, the MVL will only read data that has changed since it was created and wont have the option to load in all the data as though it was made before the table was created.
From what I have read, the MVL is quicker than a Trigger and I have some free code that prooved to work from a MVL using it as a reference to know what records to update. There is not that much to a MVL, a record ID and type of update, New, Update or Delete.
I think what I will have to do is work on a the same principle for the MVL but use a Trigger as this way we can do a full reload if required at any point.
Many thanks for your help. -
Error in Log file from a scheduled materialized view
Hi
Getting the following errors in the alert_xe.log file when refreshing a materialized view. The data from the materialized view seems fine.
ORA-12012: error on auto execute of job 1
ORA-12008: error in materialized view refresh path
ORA-01555: snapshot too old: rollback segment number 41 with name "_SYSSMU41$" too small
ORA-02063: preceding line from HRLIVE
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2566
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2779
ORA-06512: at "SYS.DBMS_IREFRESH", line 685
ORA-06512: at "SYS.DBMS_REFRESH", line 195
ORA-06512: at line 1
This is with XE Apex 4.1
Thanks for any suggestionsThanks - tried google and changing undo_retention but no luck.
We noticed something very odd...
TABLESPACE_NAME AUT
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\USERS.DBF
USERS YES
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\SYSAUX.DBF
UNDOTBS1 YES
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\UNDOTBS1.DBF
SYSAUX YES
E:\ORACLEXE_11G\APP\ORACLE\ORADATA\XE\SYSTEM.DBF
SYSTEM YES
The file SYSAUX.DBF has table space UNDOTBS1
and file UNDOTBS1.DBF has table space SYSAUX
This looks the wrong way around.
Any ideas how this could have happened and how this can be changed?
Thanks & regards
Edited by: rw on Jan 18, 2012 8:32 AM -
Materialized view (fast refresh mode) + Materialized view log on another DB
Hi all,
I created a materizalied view using this script :
CREATE MATERIALIZED VIEW GIPS.DOSSIER_MEDICAL_MV2
TABLESPACE GIPS_T
NOCACHE
NOLOGGING
NOCOMPRESS
NOPARALLEL
BUILD IMMEDIATE
USING INDEX
TABLESPACE GIPS_I
+ REFRESH FAST ON DEMAND +
START WITH TO_DATE('11-janv.-2011 16:00:00','dd-mon-yyyy hh24:mi:ss')
NEXT sysdate (1/96)+
AS
SELECT N0_SEQ_BLOB_PDF,
EXAM_ID,
MPR,
RSM,
rub,
date_deb,
SPE,
commentaire,
SPR,
MEP,
MSJ,
TTD,
exam_type
FROM DOSSIER_MEDICAL@dbdoc_lk
WHERE DOSSIER_MEDICAL.EXAM_TYPE IN ('TELEM', 'SCANNER', 'EPPO_SECMED');
So you can see I'm using a dblink in the select statement ( DBDOC_LK )
On the DB referenced by this dblink, I created a materialized view log using this script :
CREATE MATERIALIZED VIEW LOG ON "DOSMED"."DOSSIER_MEDICAL"
TABLESPACE "DOC_T"
WITH PRIMARY KEY
INCLUDING NEW VALUES;
The problem is that my materialized view has never refreshed since its creation ! and I don't understand why ?
Can someone help me ?
Thank you.The REFRESH schedule causes a job to be created for the execution of the Refresh. You should see this job in DBA_JOBS / USER_JOBS.
The job would run only if the instance parameter JOB_QUEUE_PROCESSES is set to 1 or higher (the default is 0). This parameter can be modified dynamically with an ALTER SYSTEM command.
Hemant K Chitale
http://hemantoracledba.blogspot.com -
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
Maybe you are looking for
-
Creation Date of MM Master Data
Hello All, I would like to know what r the master datas of MM has been created in the month. ( From - to ) is ther any T. code from which i could get these reports. Thanks in adavace
-
Fill-in PDF forms and save with no error messages. How?
I've saved a Reader Extended PDF enabling form fill-in and save, but users report error saying, "WITHOUT THE OWNER PASSWORD YOU DO NOT HAVE PERMISSION TO SAVE THIS DOCUMENT." What do I need to do enable them to fill-in and save with no errors?
-
I have a 1GHz emac with ati graphics. The screen is out of focus, particularly in the middle. The focus slowly gets worse for 5 to 10 minutes, then the display seems to correct itself and the problem starts over again. My problem seems similar to tha
-
Does iPhoto library have to be in pictures folder?
My external HD is getting buggy, so currently moved my iPhoto library to my documents folder, should I have placed it in my pictures folder instead? Does it matter? thanks
-
Recording plug-in instrument directly to audio (no bouncing)
First post here, is it possible to record directly to audio what I'm playing live on an plug-in instrument, without having to go through the bouncing procedure ? In other words, setting a plug-in instrument on an instrument channel, playing it live,