Creating materialized view with variables - help
Greetings,
I want to create an materialized view (MV) from the external public db link. Below is my full query:
CREATE MATERIALIZED VIEW PROJECTS_MV
REFRESH WITH ROWID
AS
SELECT prj.Project_id, prj.desc,
prj.parent_project_id, f_year, f_month
FROM sysadm.prj@EFUYEEDW_DB_LINK.MSDB prj
WHERE prj.pf_scenario_id = '708KDD'
AND prj.ph_id = 'SHAREDP'
AND f_year = (SELECT EXTRACT(year FROM current_DATE) FROM dual)
AND f_month = (SELECT EXTRACT(month FROM current_DATE) FROM dual)
Question: In the query there are two variables that capture the month and year and requery it. Does the data get updated automatically when a new month or new year changes?
If there is a change, how would I change so it would update the data accordingly?
Thanks for your help
john9569
Hi Christian,
Thanks for your response. Your codes return the date as 01-JAN-09 which is not what I'm looking for. Maybe my question is not clear.
So far, the MV is executed correctly what I want. My concern is when it updates the MV, does it get the new data (f_month & f_year) when the MV is updated automatically?
Other words, the MV is updated nightly to get the incremental data from the db link. Once it passes to the new month, I am not sure how this MV handles since the f_month is now changed to differrent number.
Thanks for your help.
Bests,
John9569
Similar Messages
-
Creating Materialized View with the Distinct key word
Hi
I need help to create Materialized View with the Distinct key word.
my query is
select distinct col1, col2 from t1;
is there any alternate of DISTINCT because I can not refresh the MV as fast on demand if I am using it and Fast on Demand is a must for me.hi
check out this link
http://download-west.oracle.com/docs/cd/B12037_01/server.101/b10736/basicmv.htm#i1007299
http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/intro.htm#sthref183
hope this helps
CHeers -
Create materialized view with ora-12054 error
Oracle 10g R2 on AIX 5.3L
I create a script (with help of EM) for a materilaized view
CREATE MATERIALIZED VIEW "BAANDB"."R2_MV"
TABLESPACE "USERS" NOLOGGING STORAGE ( INITIAL 128K) USING INDEX TABLESPACE "BAANIDX" STORAGE ( INITIAL 256K)
REFRESH FORCE ON COMMIT
ENABLE QUERY REWRITE AS
SELECT CM.ROWID c_rid, PC.ROWID p_rid, CM."T$CWOC", "T$EMNO", CM."T$NAMA", CM."T$EDTE", PC."T$PERI", PC."T$QUAN", PC."T$YEAR", PC."T$RGDT" From BAANDB.TTPPPC235201 PC RIGHT OUTER JOIN BAANDB.TTCCOM001201 CM Using (T$EMNO)
but I got error
ORA-12054: cannot set the ON COMMIT refresh attribute for the materialized view
acooding to the oerr
// *Cause: The materialized view did not satisfy conditions for refresh at
// commit time.
// *Action: Specify only valid options.
what dose it mean? both my master tables are not IOT and are locale ones. It seems that only changing to ON DEMAND works. If I use the "REFRESH FORCE START ..NEXT", it also failed.
I have created the materalized view logs with rowid on each master table. I think my script met every prequirement of ON COMMIT.
table owner has "on commit refresh" privilegeAfter googling on line, someone mentioned that for "ON COMMIT" on join tables, we have to use th old OUTER JOINT syntax (+) on WHERE. The new "outer joint" in FROM clause won't work.
I tested it, it seemed to be true. -
Create Materialized View with GROUP BY
I have a table
treecluster NUMBER(3)
treenumber NUMBER(3)
treedate DATE
nestnumber NUMBER(3)
eggs NUMBER(3)
nestlings NUMBER(3)
fledglings NUMBER(3)
nestfate VARCHAR2(10)
nestfailurecode NUMBER(2)
I want to group the data by treecluster, treenumber, year, and nest number and get a max eggs, nestlings, fledglings. I am doing this with the following:
SELECT treecluster, treenumber, to_char(nestchecksdate, 'YYYY'), nestnumber,
max(eggs), max(nestlings), max(fledglings)
FROM nestchecks
GROUP BY treecluster, treenumber, to_char(nestchecksdate, 'YYYY'), nestnumber;
This works fine.
The last record for a year has a nestfate and nestfailurecode value.
I need to group all information and then also get the nestfate and nestfailurecode for the year. How do I go about getting this information?
I am really trying to create a summary materialized view based on a data table so the select I am trying to craft would be a part of a create materialized view as SELECT...
so I want to be able to group the info and add in the nestfate and failurecode in one step.
Thanks!try this:
SQL> select * from table_tree;
TREECLUSTER TREENUMBER NESTCHECK NESTNUMBER EGGS NESTLINGS FLEDGLINGS NESTFATE NESTFAILURECODE
4 167 17-MAY-00 2 0 0
4 167 24-MAY-00 2 3 0
4 167 30-MAY-00 2 3 0
4 167 12-JUN-00 2 0 1 FAILURE 2
select a.treecluster, a.treenumber, to_char(a.nestyear,'YYYY') nestyear,
a.nestnumber, a.eggs, a.nestlings, a.fledglings, a.nestfate, a.nestfailurecode
from (select max(treecluster) treecluster, max(treenumber) treenumber,
max(nestchecksdate) nestyear,
max(nestnumber) nestnumber, max(eggs) eggs, max(nestlings) nestlings,
nvl(max(FLEDGLINGS),0) FLEDGLINGS, max(NESTFATE) NESTFATE,
max(nestfailurecode) nestfailurecode
from table_tree) a
TREECLUSTER TREENUMBER NEST NESTNUMBER EGGS NESTLINGS FLEDGLINGS NESTFATE NESTFAILURECODE
4 167 2000 2 3 1 0 FAILURE 2hope this helps -
Create materialized view with specific column sizes
Hi all,
I'm trying to create a materialized view with a specific a column size. Something like
create materialized view test_mv
refresh force on demand
as
select id,
cast(my_compound_field as nvarchar2(50))
from ( select id,
field1 || field2 my_compound_field
from my_table);But Oracle seems to ignore the cast and takes the maximum size it finds for field1 || field2 in the select query. The resulting table has a column nvarchar2(44) instead of nvarchar2(50).
This can give a problem when the view is refreshed... there could be new data that exceeds the current size, i.e. where length(field1 || field2) > 44.
How can I override the column size of a field in a materialized view?
Edit: Some additional info to clarify my case:
field1 and field2 are defined as nvarchar2(25). field1 || field2 can theoretically have a length of 50, but there is currently no data in my table that results in that length, the max is 44. I am afraid that there will be data in the future that exceeds 44, resulting in an error when the MV is refreshed!
Edited by: Pleiadian on Jan 25, 2011 2:06 PMCannot reproduce what you are saying is happening.
SQL> create table t (a nvarchar2(50), b nvarchar2(50));
Table created.
SQL> create materialized view tmv as
2 select a, b, a || b c from t;
Materialized view created.
SQL> desc tmv
Name Null? Type
A NVARCHAR2(50)
B NVARCHAR2(50)
C NVARCHAR2(100)
SQL> drop materialized view tmv;
Materialized view dropped.
SQL> create materialized view tmv as
2 select a, b, substr(a || b, 1, 10) c from t;
Materialized view created.
SQL> desc tmv
Name Null? Type
A NVARCHAR2(50)
B NVARCHAR2(50)
C NVARCHAR2(10)
SQL> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
SQL>Edited by: 3360 on Jan 25, 2011 8:10 AM
And with data
SQL> insert into t values ('3123423423143hhshgvcdcvw', 'ydgeew gdfwe dfefde wfjjjjjjj');
1 row created.
SQL> commit;
Commit complete.
SQL> desc tmv
Name Null? Type
A NVARCHAR2(50)
B NVARCHAR2(50)
C NVARCHAR2(10)
SQL> select * from tmv;
A
B C
3123423423143hhshgvcdcvw
ydgeew gdfwe dfefde wfjjjjjjj 3123423423 -
How to create materialized view with parameter and index ?
Hi all,
i am using oracle 11g.
i want to create parameter materialized view with two parameter (STORED_VALUE, LOV_NAME) with an index .
i have below view
CREATE OR REPLACE FORCE VIEW SR_MY_TEST(DISPLAYED_VALUE, STORED_VALUE, LOV_NAME) AS
SELECT DISPLAYED_VALUE , LOVVALUE.STORED_VALUE , lovname.lov_name
FROM (SELECT T.LOV_VALUE_ID,
T.LOV_ID,
T.ORG_ENTITY_ID,
T.STORED_VALUE,
T.DISPLAYED_VALUE,
T.ENTERPRISE_ID
FROM MS_QS_LIST_OF_VALUES_T T) lovvalue, ms_qs_lov_names lovname
WHERE lovvalue.lov_id = lovname.lov_id
AND lovvalue.org_entity_id = 1
and LOVVALUE.ENTERPRISE_ID = 100000
AND LOVNAME.ENTERPRISE_ID = 100000;
i want to create index on STORED_VALUE, LOV_NAME
Thanks
DambyNo.AFAIK, there's nothing called as "parameterized MV".
Materialized View store data like tables (and not like Views). So, does it make sense when you say - "table with parameters" ?
Could you please explain your business requirement?
What is the purpose behind those 2 parameters? -
Error Creating Materialized View With a Job
Oracle 9ir2
I've created a job like this in a java class:
...Java Code ...
cs = conn.prepareCall ("DECLARE v_job NUMBER; BEGIN DBMS_JOB.SUBMIT(v_job,'begin CTH_REGENERA_VM; end;', TRUNC(SYSDATE+1) + (3/24)); END;");
...Java Code ...
The Procedure called in the Job:
CREATE OR REPLACE PROCEDURE CTH_REGENERA_VM
AUTHID CURRENT_USER IS
existe NUMBER(1);
cur BINARY_INTEGER := DBMS_SQL.OPEN_CURSOR;
fdbk BINARY_INTEGER;
BEGIN
SELECT count(*) INTO existe FROM user_mviews WHERE mview_name = 'CTH_PRESENTA_A_VM';
IF existe > 0 THEN
DBMS_SQL.PARSE(cur, 'DROP MATERIALIZED VIEW CTH_PRESENTA_A_VM', DBMS_SQL.NATIVE);
fdbk := DBMS_SQL.EXECUTE(cur);
INSERT INTO CTH_HISTORIAL VALUES('ELIMINADA VM CTH_PRESENTA_A_VM', SYSDATE);
COMMIT;
END IF;
DBMS_SQL.PARSE(cur, 'CREATE MATERIALIZED VIEW CTH_PRESENTA_A_VM
TABLESPACE DAT1_CTH
STORAGE(INITIAL 16M NEXT 8M MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0)
XMLTYPE XML STORE AS CLOB ( TABLESPACE DAT1_CTH
STORAGE(INITIAL 16M NEXT 8M MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0))
AS select FICHA, XML,
extractvalue(xml, ''/FICHE/Encab_de_nombre_geogr�fico_a'') as MUNICIPIO,
extractvalue(xml, ''/FICHE/Encab_de_nombre_geogr�fico_c'') as CALIFICACION,
extractvalue(xml, ''/FICHE/Encab_de_nombre_geogr�fico_b'') as PROVINCIA,
extractvalue(xml, ''/FICHE/Encab_tem�tico_de_materia_a[1]'') as MATERIA,
extractvalue(xml, ''/FICHE/Fecha_cronol�gica_b[1]'') as FECHA,
extractvalue(xml, ''/FICHE/Datos_matem�ticos_a[1]'') as ESCALA
from cth_xmltable', DBMS_SQL.NATIVE);
INSERT INTO CTH_HISTORIAL VALUES('ASIGNO EL PARSE DE MATERIALIZED', SYSDATE);
fdbk := DBMS_SQL.EXECUTE(cur);
INSERT INTO CTH_HISTORIAL VALUES('EJECUTO EL PARSE DE MATERIALIZED', SYSDATE);
INSERT INTO CTH_HISTORIAL VALUES('CREADA VM CTH_PRESENTA_A_VM', SYSDATE);
DBMS_SQL.PARSE(cur, 'CREATE INDEX CTH_INDEX1
ON CTH_PRESENTA_A_VM(XML)
INDEXTYPE IS CTXSYS.CONTEXT
PARAMETERS (''storage cth section group ctxsys.auto_section_group'')', DBMS_SQL.NATIVE);
fdbk := DBMS_SQL.EXECUTE(cur);
INSERT INTO CTH_HISTORIAL VALUES('CREADO INDICE ORACLE TEXT CTH_INDEX1', SYSDATE);
DBMS_SQL.PARSE(cur, 'CREATE INDEX CTH_IDX_MUNICIPIO3
ON CTH_PRESENTA_A_VM(UPPER(MUNICIPIO))
TABLESPACE IDX1_CTH
STORAGE (INITIAL 1M NEXT 512K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0)', DBMS_SQL.NATIVE);
fdbk := DBMS_SQL.EXECUTE(cur);
INSERT INTO CTH_HISTORIAL VALUES('CREADO INDICE CTH_IDX_MUNICIPIO2', SYSDATE);
DBMS_SQL.PARSE(cur, 'CREATE INDEX CTH_IDX_FICHA2
ON CTH_PRESENTA_A_VM
(FICHA)
TABLESPACE IDX1_CTH
STORAGE(INITIAL 1M NEXT 512K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCREASE 0)', DBMS_SQL.NATIVE);
fdbk := DBMS_SQL.EXECUTE(cur);
INSERT INTO CTH_HISTORIAL VALUES('CREADO INDICE CTH_IDX_FICHA2', SYSDATE);
DBMS_SQL.CLOSE_CURSOR(cur);
COMMIT;
END;
I got always an error in the created materialized view. If I call the procedure with SQL Plus, it run ok. The user
has CTXAPP, DBA roles, so I supouse it is not a privileges problem. I also tried to create a simple materialized view or a table, and always got an error ora-12011
Thanks in advance.If I call the procedure with SQL Plus, it run ok. Are you using the same user to run it in SQL*Plus as runs it from Java.
The normal reason for procedures to fail like this is privileges. Particularly, we cannot run procedures using privileges we have been granted through roles.
The user has CTXAPP, DBA roles, so I supouse it is not a privileges problem. Try granting the system privilege CREATE MATERIALIZED VIEW to the user and see what happens.
I drop the materialized and create again, cause it's the fastest way I've found. With a DBMS_MVIEW.REFRESH is too slow.I find that surprising as drop & create has to do all the work that a refresh has to do plus some more - maybe it's something to do with XML. Did you try adding a snapshot log and going for FAST? I don't know whwther the XML procesing would render the view complex - have you explained it?
Cheers, APC -
Create Materialized View with Compress clause
Hi,
Oracle 9i R2 has an option to use compress clause while creating table, materialized view or etc. Just wanted some help on tips to be followed during creating a materilized view with compress clause and refresh the same.do i need to follow any special procedures ??? Any help greatly appreciated.
Thanks,
Chak.I read in the book that while inserting user /+append+/ otherwise table with compress will fail. I am doing materialized view refresh with fast mode and data will be inserted as per logs residing at master site.. while inserting into materialized view, do i have to setup specially since fast refresh is going to insert data into existing materialized view.
Thanks, -
Create material view with MATERIAL_MAINTAIN_DARK
Hello !
I have done a material migration program with FM MATERIAL_MAINTAIN_DARK. The program integrate the basic data, and then each view one by one.
It works fine except with material with internal number. It creats the basic data but when i use the number generated to create the other view i get this message :
No external number assignment possible for mat. type GENERIC MATERIALS
I found this field in mara_ueb : KZ_MAT_RES
But when i put X in it, it returns that i forgot mandatory data. So I tried to select the data already in MARA and MAKT, but now the message is that the material already exist ! It is true but I want to create another view.
Here's a piece of my code to help you to understand, the commentary part is what I tried to do to resolved my problem :
ADD 1 TO v_count.
ADD 1 TO v_line.
MOVE v_line TO v_line_c.
*---MARA
MOVE sy-mandt TO t_mara_ueb-mandt.
MOVE 'MM01' TO t_mara_ueb-tcode.
MOVE v_count TO t_mara_ueb-tranc.
MOVE k_purcha TO t_mara_ueb-vpsta.
SELECT COUNT(*) FROM t134 WHERE mtart = t_data_pur-mtart
AND envop = space.
IF sy-subrc = 0.
TABLES : mara, makt.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_data_pur-matnr
IMPORTING
OUTPUT = t_data_pur-matnr.
SELECT SINGLE * FROM mara WHERE matnr = t_data_pur-matnr.
MOVE-CORRESPONDING mara TO t_mara_ueb.
SELECT SINGLE * FROM makt WHERE matnr = t_data_pur-matnr.
MOVE-CORRESPONDING makt TO t_makt_ueb.
MOVE 'X' TO t_mara_ueb-KZ_MAT_RES.
ENDIF.
MOVE t_data_pur-matnr TO t_mara_ueb-matnr.
MOVE t_data_pur-mbrsh TO t_mara_ueb-mbrsh.
MOVE t_data_pur-mtart TO t_mara_ueb-mtart.
MOVE t_data_pur-ekwsl TO t_mara_ueb-ekwsl.
APPEND t_mara_ueb.
*---MARC
MOVE sy-mandt TO t_marc_ueb-mandt.
MOVE v_count TO t_marc_ueb-tranc.
MOVE t_data_pur-matnr TO t_marc_ueb-matnr.
MOVE t_data_pur-werks TO t_marc_ueb-werks.
MOVE t_data_pur-ekgrp TO t_marc_ueb-ekgrp.
MOVE t_data_pur-mmsta TO t_marc_ueb-mmsta.
MOVE t_data_pur-mmstd TO t_marc_ueb-mmstd.
MOVE t_data_pur-webaz TO t_marc_ueb-webaz.
MOVE t_data_pur-kordb TO t_marc_ueb-kordb.
MOVE t_data_pur-usequ TO t_marc_ueb-usequ.
APPEND t_marc_ueb.
*---!!! Call FUNCTION MODULE !!!
CALL FUNCTION 'MATERIAL_MAINTAIN_DARK'
EXPORTING
FLAG_MUSS_PRUEFEN = 'X'
SPERRMODUS = 'E'
MAX_ERRORS = 0
p_kz_no_warn = 'X'
kz_prf = space
KZ_VERW = 'X'
KZ_AEND = 'X'
KZ_DISPO = 'X'
kz_test = lv_test
NO_DATABASE_UPDATE = ' '
call_mode = ' ' "OR RMD OR space OR BAP
CALL_MODE2 = ' '
user = sy-uname
SUPPRESS_ARRAY_READ = ' '
FLG_MASS = ' '
IMPORTING
matnr_last = lv_matnr
number_errors_transaction = lv_nb_error
TABLES
amara_ueb = t_mara_ueb
amakt_ueb = t_makt_ueb
amarc_ueb = t_marc_ueb
amard_ueb = t_mard_ueb
AMFHM_UEB =
AMARM_UEB =
AMEA1_UEB =
ambew_ueb = t_mbew_ueb
asteu_ueb = t_steu_ueb
ASTMM_UEB =
amlgn_ueb = t_mlgn_ueb
amlgt_ueb = t_mlgt_ueb
AMPGD_UEB =
ampop_ueb = t_mpop_ueb
AMVEG_UEB =
AMVEU_UEB =
amvke_ueb = t_mvke_ueb
ALTX1_UEB =
AMPRW_UEB =
AMFIELDRES =
amerrdat = t_amerrdat
EXCEPTIONS
kstatus_empty = 1
tkstatus_empty = 2
t130m_error = 3
internal_error = 4
too_many_errors = 5
update_error = 6
OTHERS = 7.
I really need you help !
thank you in advance.OK I found the answer !
It is because the matnr generate add 00000... before the number. So I have to add it for the other view. But it is not the case for material number define externally. And the message was not comprensive.
*---MARA
MOVE sy-mandt TO t_mara_ueb-mandt.
MOVE 'MM01' TO t_mara_ueb-tcode.
MOVE v_count TO t_mara_ueb-tranc.
MOVE k_purcha TO t_mara_ueb-vpsta.
SELECT COUNT(*) FROM t134 WHERE mtart = t_data_pur-mtart
AND envop = space.
IF sy-subrc = 0.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_data_pur-matnr
IMPORTING
output = t_data_pur-matnr.
ENDIF.
MOVE t_data_pur-matnr TO t_mara_ueb-matnr.
MOVE t_data_pur-mbrsh TO t_mara_ueb-mbrsh.
MOVE t_data_pur-mtart TO t_mara_ueb-mtart.
MOVE t_data_pur-ekwsl TO t_mara_ueb-ekwsl.
APPEND t_mara_ueb.
*---MARC
MOVE sy-mandt TO t_marc_ueb-mandt.
MOVE v_count TO t_marc_ueb-tranc.
MOVE t_data_pur-matnr TO t_marc_ueb-matnr.
MOVE t_data_pur-werks TO t_marc_ueb-werks.
MOVE t_data_pur-ekgrp TO t_marc_ueb-ekgrp.
MOVE t_data_pur-mmsta TO t_marc_ueb-mmsta.
MOVE t_data_pur-mmstd TO t_marc_ueb-mmstd.
MOVE t_data_pur-webaz TO t_marc_ueb-webaz.
MOVE t_data_pur-kordb TO t_marc_ueb-kordb.
MOVE t_data_pur-usequ TO t_marc_ueb-usequ.
APPEND t_marc_ueb.
Edited by: Louis-Arnaud Bouquin on Mar 5, 2008 3:04 PM -
Help to create Materialized View that has timestamp conversion
I need help creating materialized view with timestamp conversion between GMT to LocalTime.
Feel free to make any comments.
Thanks in advance.
jon joaquino;)Here is one way.
1. Alter the table hist_table and add a new column pdt_timestamp.
2. Update the new column using the function 'new_time'
For example,
Update hist_table
set pdt_timestamp = new_time(gmt_timestamp,'GMT','PDT');
3. create a materialized view log on the table 'hist_table' using the syntax
create materialized view log on hist_table
with primary key, rowid, sequence;
4. create a materialized view now using the syntax:
(You have to specify your own storage numbers and tablespace name)
create materialized view mview_hist_table
pctfree 0 tablespace mymview
storage (initial 16k next 16k pctincrease 0)
build immediate
refresh fast on commit
as select uid,gmt_timestamp,pdt_timestamp
from hist_table;
Please test on your test instance before doing it on production. I have tested this on Oracle 10g for Windows 2000. I assumed that column 'uid' is the primary key on the table. I hope this helps.
********************************************************** -
Problems in creating Materialized View from 10g R2 to 11g
Hi,
We have two databases in 10g Release 2. These databases are on two different servers and we use
Materialized views to replicate data between these servers. We are currently using 64 bit version of
oracle 10g release 2 for LINUX.
Oracle Database 10g Release 10.2.0.1.0 - 64 bit Production
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
We use CENTOS 5 - 64 bit edition
We upgraded one of the databases to 11g (We exported the data from old database and
imported it in new database) . Then we tried to create a Materialized view with incremental refresh
on it where the base table is in the second Oracle 10g database.
The problem is that it is not letting us create the view with FAST Refresh. It kept on giving ORA-12028
error. We tried different remedies suggested on forums like creating a view with ROWID, but still it
continued giving us the same error. We also synchronized the characterset of Oracle 10g and Oracle 11g
installations but still it did not work.
Our base table size is pretty large (over 10 Million records) and if we do a full refresh, it takes hours to
refresh it.
Without incremental refresh, we will not be able to fucntion, and to upgrade both database simultaneously
we will need a large down-time which also we can not afford.
Please advise what should we do.
Best Regards
Madhup
Edited by: Madhup on Mar 2, 2009 10:45 AMHello,
Yesterday I met the same problem and very sad about this, however, my story is much more complicated (I think so).
I have 6 databases:
2 - 11g
2 - 10g
2 - 9i
Every database of each release has different characterset(UTF8 and AL16UTF16).
I am trying to create Materialized view with FAST REFRESH on Oracle 11g, when master tables are located on 10g database and 9i database.
Materialized view, which points to 9i database, was successfully created.
Materialized view, which points to 10g database, gets ORA-12028
Like you, I tried many notes from METALINK and thought at the begining that the problem is my characterset. But, when the materialized views were successfully built on Oracle 9i database, I understood that the problem is something else.
Did you find the actual reason why this issue does not work??
Thanks,
Alex -
Materialized view with build deferred
Hello,
Do you have some idea why CREATE MATERIALIZED VIEW with BUILD DEFERRED option takes a lot of time? It's running 1 hour and not finish (Oracle 9.2).
CREATE MATERIALIZED VIEW mv_users
BUILD DEFERRED
REFRESH COMPLETE
NEXT SYSDATE+1
WITH ROWID
AS
SELECT usr_id, usr_type, usr_active, usr_brn_id, usr_first_name,
usr_last_name, usr_psl_rgn, usr_bp_id
FROM users@db_link;
Users table has 10 millions records.
Edited by: user12111171 on 2011-09-16 13:28If the Job Queue is not enabled, the CREATE cannot auto-schedule the refresh. You need to have JOB_QUEUE_PROCESSES set to 1 or greater.
It would seem that when you say "I have created job to refresh the materialized view everyday using dbms_refresh.refresh" you haven't created a job using DBMS_JOB.SUBMIT (which is what the CREATE MATERIALIZED VIEW would do "behind the scenes" --- you can then query DBA_JOBS or USER_JOBS to see the auto-submitted job).
Hemant K Chitale -
Materialized view with XE?
Hi,
Is it possible to create materialized view with express edition?
Thanks
couse1Hello,
If you have access to the XE forum, this is a good place to start - Re: Materialized view - clarification
If not, this is a good reason to register.
Regards,
Arie. -
Error while creating Materialized Views
I tried creating Materialized views with set operator, and Oracle throws up an error message
ORA-30370: set operators are not supported in this context
The script,
CREATE MATERIALIZED VIEW ORADBA2.MV_GP_AGG_00055_MMR1
PCTFREE 0 TABLESPACE GPMTSPOC
STORAGE (INITIAL 128K NEXT 128K MAXEXTENTS UNLIMITED)
BUILD IMMEDIATE
REFRESH COMPLETE
ENABLE QUERY REWRITE
AS
SELECT * FROM tb_gp_agg_00055r1_01
WHERE srce_sys_cd = 15
UNION ALL
SELECT * FROM tb_gp_agg_00055r1_02
WHERE srce_sys_cd = 15
UNION ALL
SELECT * FROM tb_gp_agg_00055r1_03
WHERE srce_sys_cd = 15;
Will Oracle support UNION clause in Materialized Views?? Any work arounds ?? Thanks.
nullSET operators cannot be used in MATERIALIZED VIEWS.
A workaround is that you create a table AS SELECT using the SET operators and then create the materialized view from that table.
But then you'll not be able to take advantage of QUERY REWRITE AND AUTOMATIC REFRESH.
But if you would still like to have the materialized view then this will work!! -
Create materialized view log with rowid hangs indefinitely..
Hi
create materialized view log on advice_note with rowid;
This stmt hangs indefinitely...
Help needed in resolving this issue
Rpi have resolved the issue myself.
Found out the sessions that are locking the object , killed all those sessions & pids.
Rp
Maybe you are looking for
-
How to separate debit and credit values in gl statement report (daywise)
hi experts, i have report. selection criteria is chars of account. gl account date . how to separate debit and credit values in gl statement?.(i know there is a indicator shkzg). but send me code. op date, total credit,total debit , balances. also
-
Is there a way to upload/download photos anonymously?
Is there a way to anonymously upload/download photos to the web without any sort of identification? For example, if I'm using something like TOR to browse, and I find an icon on a site or Google Images that I want to use as my avatar for a social net
-
I will try to make this short. I always was able to import and watch short home movies directly in iphoto...however, once i upgraded to snow leopard, I was unable to do this and now must drag the image in iphoto to quicktime to watch it. A pain, but
-
GetURL no longer working - used to!
I've got a Flash file which I have recently updated with my new all-singing-all-dancing CS4. In Flash 8 it all worked perfectly. I used getURL... I set allowScriptAccess to "always" in the html file, set publish settings to "Access network only" and
-
After clicking the organizer icon, the program automatically shuts down with a message: pse7 (organizer) has encountered a problem and needs to close. please tell microsoft about this problem" This happened from one day to the next. I did not add an