Parameters in Init.ora for Materialized Views
Fellow Experts,
Are there any other parameters that I need to insert in the init.ora besides QUERY_REWRITE_ENABLED
and
QUERY_REWRITE_INTEGRITY
once I create a materialize view ?
Thanks.
Ray.
Oracle version 10.0.2 and the DDL that I'm planning to use might be simmilar to
CREATE MATERIALIZED VIEW sales_by_month_by_state
TABLESPACE example
PARALLEL 4
BUILD IMMEDIATE
REFRESH COMPLETE
ENABLE QUERY REWRITE
AS SELECT t.calendar_month_desc, c.cust_state_province,
SUM(s.amount_sold) AS sum_sales
FROM times t, sales s, customers c
WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id
GROUP BY t.calendar_month_desc, c.cust_state_province;
Similar Messages
-
Question on db_unique_name in init.ora for Data Guard
I need to set up only one physical standby on a different box (at a different location) for the primary db in production.
OS: Sun Sparc Solaris 10
Oracle: 10.2.0.3
Can I use the same db_unique_name in init.ora for both primary and standby DBs?
What are the minimal parameters required by Data Guard I have to specify in the init.ora in my case?
Could anyone please post an example of init.ora for both primary and standby DBs?
Thanks very much in advance.http://download.oracle.com/docs/cd/B19306_01/server.102/b14239/create_ps.htm#i63561
-
Reg ora-12034 materialized view log on younger than last refresh
Hi,
when i update my base table materialized view log shows the updated rows
but when i refresh materialized view it wont show updated rows in materialized view and also there is no rows in materialzed log
it shows error ora-12034: materialized view log on younger than last refresh
cheers,FIX
A complete refresh is required before the next fast refresh.
Please run the process "Refresh Materialized Views" -
Setting DBMS_METADATA.GET_DDL Output for Materialized Views
Hi all.
My Oracle version is 10g.
I'm extracting the DDL of all the objects from database using the DBMS_METADATA package. I'm using SET_TRANSFORM_PARAM to configure the output because I need a simple sql code, without information about tablespaces, storage and segment attributes. Everything works fine except when I'm working with mviews object types. I can't remove the information about tablespace, storage or segment attributes for materialized views.
I would like to know if there's a related issue about it. Or there's something missing in my code?
I tried to specify the object type as another parameter on DBMS_METADATA.SET_TRANSFORM_PARAM but don't work too.
The only transform parameter that works fine with Materialized Views is the SQLTERMINATOR.
See how I have done:
declare
vDDL clob;
begin
dbms_metadata.set_transform_param (DBMS_METADATA.SESSION_TRANSFORM, 'STORAGE', FALSE);
dbms_metadata.set_transform_param (DBMS_METADATA.SESSION_TRANSFORM, 'TABLESPACE', FALSE);
dbms_metadata.set_transform_param (DBMS_METADATA.SESSION_TRANSFORM, 'SEGMENT_ATTRIBUTES', FALSE);
dbms_metadata.set_transform_param (DBMS_METADATA.SESSION_TRANSFORM, 'SQLTERMINATOR',TRUE);
select dbms_metadata.get_ddl ('MATERIALIZED_VIEW', 'MV_STO020', 'HIS117_CHECK') into vDDL FROM DUAL;
dbms_output.put_line (vDDL);
end;
and how the output is:
CREATE MATERIALIZED VIEW "HIS117_CHECK"."MV_STO020"
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "TS_HIS117"
BUILD IMMEDIATE
USING INDEX
REFRESH FORCE ON DEMAND
WITH PRIMARY KEY USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS SELECT
STO020_MOVEMENT_LOG_ID STO020_MOVEMENT_LOG_ID
, STO020_QUANTITY STO020_QUANTITY
, STO020_DATE STO020_DATE
, STO020_BEFORE_BALANCE STO020_BEFORE_BALANCE
, STO011_PRODUCT_MOVEMENT_ID STO011_PRODUCT_MOVEMENT_ID
, ADM082_PRODUCT_ID ADM082_PRODUCT_ID
, ADM089_PRODUCT_PRESENTATION_ID ADM089_PRODUCT_PRESENTATION_ID
, STO010_MOVEMENT_TYPE_ID STO010_MOVEMENT_TYPE_ID
, STO001_STOCK_ID STO001_STOCK_ID
, STO001_TARGET_STOCK_ID STO001_TARGET_STOCK_ID
, STO003_PRODUCT_LOT_ID STO003_PRODUCT_LOT_ID
, SYS010_USER_ID SYS010_USER_ID
, EIR001_MPI EIR001_MPI
, ADM056_MEDICAL_ATTENTION_ID ADM056_MEDICAL_ATTENTION_ID
, ADM094_USE_UNIT_ID ADM094_USE_UNIT_ID
FROM
STO020_MOVEMENT_LOG;
Thank you in advanced!
Edited by: lucporto on 28/08/2012 07:26Right. I found this way but I consider this just a quick fix, because I think there should be a better way to do this.
create table t_clob (c_long);
declare
p clob;
begin
delete from t_clob;
execute immediate 'insert into t_clob (select to_lob(query) from dba_mviews where owner = :1 and mview_name = :2)'
USING 'HIS117', 'MV_STO020';
select 'CREATE MATERIALIZED VIEW MV_STO020' || chr(10) ||
'REFRESH ON DEMAND' || chr(10) || 'AS' || CHR(10) || mv.c_long
into p
from t_clob mv;
dbms_output.put_line(p);
end;
Thanks all. -
ORA-23401: materialized view ""SYS"".""MV_OPTIONS"" does not exist
Oracle 11gR1
Linux Red Hat 6.3
I have never seem this object SYS.MV_OPTIONS before much less know why it would be missing. Any ideas?
I can no longer refresh my materialized views.Process worked fine until the addition on new MVs.
What causes error?
Running SP that calls DBMS_MVIEW.refresh. Here is the error in more detail...
"ORA-23401: materialized view ""SYS"".""MV_OPTIONS"" does not exist
ORA-06512: at ""SYS.DBMS_SNAPSHOT"", line 2545
ORA-06512: at ""SYS.DBMS_SNAPSHOT"", line 2751
ORA-06512: at ""SYS.DBMS_SNAPSHOT"", line 2720
What has been changed?
Added new materialized views to my instance that need periodic refreshing.
Note: Running the block below works fine ....
begin
DBMS_MVIEW.refresh('MV_MINE');
end;
I suspect something in the process that calls this function is the issue (of course). But I still wonder what the object SYS.MV_OPTIONS is/does? -
WHERE clause for Materialized View
Hi,
We are replicating a very large table from Production. The table is approx 40Gb in size and so the DBA's are very reluctant to do a full replication as it could bring down the production server (I'm a developer so I'm going on faith this is correct).
I have been looking for a way to limit the number of columns that I need, approx 1 weeks data is enough to begin with. The table has a column txntimestamp which I am trying to use in the WHERE
create materialized view FWWIPTRANSACTION
refresh fast on demand with rowid
as select * from WLOS_OWNER.WAFPROD_FWWIPTRANSACTION
where txntimestamp > '20/06/2009 07:00:00'But I recieve the error
ORA-12015: cannot create a fast refresh materialized view from a complex queryDoes anyone know a way around this? This is the only date field I can use and pretty much the only viable option to limit the number of rows.
Thank You.Sorry for jumping ahead but if I was able to get
create materialized view FWWIPTRANSACTION
refresh fast on demand with rowid
as select * from [email protected]
where txntimestamp > '20/06/2009 07:00:00';to work, does this mean every time this MV refreshes it brings across everything since that date or merely the new rows since the last refresh? If so I will need a rolling clause i.e. sysdate - 30 -
Refresh FAST for Materialized View failed after Partition Operation
Dear all,
I have created a Materialized View having a simple join between a Dimension and Fact Table of a Datawarehouse. The MV is REFRESH FAST ON DEMAND.
However, when a Partition Maintenance Operation (PMOP) was performed on the Master Tables, the MV failed to Refresh giving a ORA-32313 error.
As suggested on one of the troubleshooting websites, we did a complete refresh of the MV and fixed it temporarily. However, I would like to know the exact cause for this and would like to have a permanent fix for the same.
Can the DBA for this Database provide me the answers or are there some standard troubleshooting steps for the same?
Please let me know.
Best,
KetanHello Maurice,
Here are the answers to your questions.
1) Database is Oracle 9i.
2) We have a stored procedure to refresh the MV. The command is dbms_mview.refresh('SALES_FACT_MV','f'). It was working fine daily. Only after a PMOP was done on the Master Tables, it failed to refresh. We have also created indexes on some columns of the MV for performance improvement. We are getting a very good improvement.
3) We have MV logs for both Master Tables to store the incremental values.
4) We are not able to get the output from DBMS_MVIEW.EXPLAIN_MVIEW since this can be done only by the DBA. WIll update you once I have the info.
5) Same as Point 2.
Let me know if you need any further info.
Thanks, Ketan -
Parameters in init.ora not changing in DB
Oracle 9.0.0 Redhat 7.2
Trying to set up utl_file_dir in the init.ora file and, although
the entry in the init.ora looks correct (utl_file_dir=/tmp/xxx),
the value for utl_file_dir in sqlplus (show parameters utl)
never sees the value (ie always shows nothing). Same with other
params in the init.ora. If I rename the init.ora file, the DB
doesn't start, so I'm changing the correct file.
Maybe Oracle is finding something it doesn't like in the
init.ora file and aborting reading the file??
Is there a way to see what oracle's doing with the init.ora file
as it loads?
Thx Martin ([email protected])There is a new feature with 9i that you can change init.ora
parameters without bouncing the instance, these parameters are
store in a file (spfile).
See the documentation about this feature.
Thomas -
Refresh time for Materialized View
Hi,
I have created a materialized view and set it to refresh everyday at 4 am . When I check the status of the job , it shows the refresh timing between 20 mins to 4 hours . That means , some times it takes 20 mins to refresh , some times 40 , some time 2 hours and some times up to 4 hours. Any reason for the wide range ? Here is the query for the view.
CREATE MATERIALIZED VIEW BDS_COST_CATEGORY_MV
ORGANIZATION HEAP PCTFREE 10 PCTUSED 40 INITRANS 1 MAXTRANS 255 NOCOMPRESS LOGGING
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT)
TABLESPACE "USERS"
BUILD IMMEDIATE
USING INDEX
REFRESH COMPLETE ON DEMAND START WITH sysdate+0 NEXT ROUND(SYSDATE + 1) + 4/24
USING DEFAULT LOCAL ROLLBACK SEGMENT
DISABLE QUERY REWRITE
AS SELECT AC.ACCOUNT_MANAGER, AC.ACCOUNT_NUMBER,
AC.ACCOUNT_NAME, DIV.DIVISION_NUMBER, ITEM.CODE_ID,
ITEM.CODE_NAME COST_CATEGORY_ITEM,
TO_NUMBER(TO_CHAR(AP.FIRST_DAY,'YYYY')) PERIOD_YEAR,
AP.FIRST_DAY PERIOD,
SUM(NVL(AD.CURRENT_EXPENSE,0)) EXPENSE
FROM ACCOUNTS AC, PERSONNEL AC_MGR, DIVISIONS DIV, ASR_HEADERS AH , ASR_DETAILS AD, CODES ITEM, CODES COSTCAT, ALL_PERIODS AP,
CODES COST_ELEMENT, ACCOUNTING_BASE_GROUP ABG
WHERE AC.ACCOUNT_MANAGER = AC_MGR.PERSONNEL_ID
AND AC_MGR.DIVISION_ID = DIV.DIVISION_ID (+)
AND AC.ACCOUNT_ID = AH.ACCOUNT_ID
AND AH.ASR_HEADER_ID = AD.ASR_HEADER_ID
AND AH.PERIOD_ASR = AP.FISCAL_SYSTEM_PERIOD_CAL_YR_EQ||', '|| AP.FISCAL_YEAR
AND ABG.COST_ELEMENT_CAT_ITEM_ID = ITEM.CODE_ID
AND COST_ELEMENT.CODE_ID = ABG.COST_ELEMENT_ID
AND AD.OBJECT_CODE = COST_ELEMENT.CODE_VALUE
AND ITEM.CODE_PARENT_ID = COSTCAT.CODE_ID
AND ( COSTCAT.CODE_NAME = 'BDS' OR ( COSTCAT.CODE_NAME = 'Base' AND ITEM.CODE_NAME = 'MTDC'))
GROUP BY AC.ACCOUNT_MANAGER,AC.ACCOUNT_NUMBER, AC.ACCOUNT_NAME,
DIV.DIVISION_NUMBER, ITEM.CODE_ID, ITEM.CODE_NAME,
TO_NUMBER(TO_CHAR(AP.FIRST_DAY,'YYYY')), AP.FIRST_DAYThis appears to be a duplicate of Refreshing Materilized view. I replied on the other thread.
Justin -
Help needed in query for Materialized View
Hi,
I want to create a materialized view which has some precalcultaed values.
I have four dimension tables out of which one is a Time Dimension table with levels as Year->Quarter->Month.
The precalculations are the moving averages and cummulative values of Sales Amt on the dimension values over a period of 4 Months.
The dimension tables are Clients, Products, Channel, Time.
Fact Table is Sales_Fact which will have the sales amount for different members of the dimension.
Since my fact table is very huge, i want to create a materialized view where i could store the required calculated measures, here Moving Average of Sales Amt for each Client, Product, Channel dimensions over a period of 4 Months.
Can anybody help with writing the query for this..Any help in this regard will be appreciated..
Please give me suggestions for this..Check this link.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14223/aggreg.htm#sthref1612
Regards
Raj -
Explain Plan for Materialized Views in 10g
I am verifying explain plan for few queries on 10g as compared to 9i I was wondering in Materialized Views queries MAT_VIEW ACCESS instead of TABLE ACCESS is it expected behaviour or am missing something?
Couldn't find information in 10g documentation
thanks in advanceI've put together a query for the v$sql_plan in 9iR2.
Depending on what you use, you can probably drop some columns (eg OTHER and partition columns) and you could drive it from the v$session by getting the hash_value from there for the sid you are interested in :
(select * from v$sql_plan where hash_value =
(select sql_hash_value from v$session where sid=:sid))
select level, optimizer, lpad('_',1*(level-1),'_')||operation operation,
options, object_owner||'.'||object_name obj_name, search_columns,
ltrim(to_char(cardinality,'999,999,999')) no_rows,
ltrim(to_char(bytes/1024,'999,999')) kbytes, cost tot_cost,
object_node link, id, parent_id, other_tag||':'||other other,
partition_start, partition_stop, cpu_cost, io_cost,
access_predicates, filter_predicates,
round(temp_space/(1024*1024),2) temp_space_mb
from (select * from v$sql_plan where hash_value = :hash_val)
start with id=0
connect by prior id = parent_id and prior child_number = child_number
order by child_number, id, position; -
ORA-12034: materialized view log on table younger than last refresh
I am getting this error while creating the materialized view.
This error seems to be refresh error.
but when i have a mat view log already and running script to create the materialized view how can that happen?34MCA2K2, Google lover?
I confess perhaps I gave a little info.
View log was created before MV.
It was the first initial load.
No refresh failed.
No DDL.
No purge log.
Not warehouse.
There is no such behavior for MVs on another sites.
P.S. I ask help someone who knows what's wrong or who faced with it or can me follow by usefull link.
P.P.S. It's a pity that there is no button "Useless answer" -
Help for materialized View & Streams.
Hi all,
I am confused....I thought streams is replacing materialized view and replication :(
What are the difference between "streams", "advance replication", and "mat. views"?
Thanks a lot,
zxyyxes2013 wrote:
I'm in a rush deadline dear :(
My boss ask me to replicate a table (with image column - picture of a person) which comes from sql server database to and oracle database.Well, presumably you informed your boss that you didn't know how to accomplish the task and that it would take some time for you to learn. And hopefully your estimates included sufficient padding to account for the fact that you'll be reading a lot of documentation.
What do I do :( . Can I use mat. views + streams + advance repl? also dbvisit? Can you use materialized views? Sure.
Can you use Streams? Sure.
You could also use GoldenGate which is the technology Oracle has depricated Streams in favor of.
I'm not sure that I see why you would want to use advanced replication unless you intend on doing bidirectional replication.
I have no idea what dbvisit is. That doesn't sound like an Oracle technology.
Justin -
What rights do I need for materialized views scheduling
Hello,
Can anyone tell me what rights do I need to schedule a materialized views at 1:00 am every night?
To create material views I've use the folowing script:
CREATE MATERIALIZED VIEW MV_view
REFRESH COMPLETE
START WITH sysdate NEXT round(SYSDATE + 1) + 1/24
AS SELECT ... join tabeles... ;.
The problem is that on my test server the MV_view run every night, but on production server my materialized views run only once (when I've run the script above).
I have take a look into the user_refresh and in field NEXT_DATE it's the time of my MV_view creation.
It is possible tha my DBA put some restrictions on my schema? Or do I need some rights to use START WITH and NEXT in my script on production server?
Thanks,
XaMOriginally Posted by wyld
Hi
I find the correct method: I do not only assign reporting rights to htm , I need modify "Inventory report rights"of "Administrator task" in the left of ZCC Console.
If I assign and modify the correct rights, he will create new & run these reports.
wyldkao
Which version you are using? I can't find Inventory Report Rights anywhere? I could only get this working by giving superadmin Please can some explain Thanks -
Gathering statistics for Materialized Views
In SQL Developer, the menu that you are presented by right-clicking a Materialized View does not give you a choice of collecting statistics, whereas you can analyze an MV and compute statistics at SQL command line. You can do that with the DBMS_STATS package too. Why is this so?
This is just an unintentional omission. I logged a task to get it added in our next full release.
-- Sharon
Maybe you are looking for
-
"1 Which iphone models have the built in VOICE MEMOS app? My 4S model has this, and i have also had this on my previous model. A colleague has an iphone 4, and it is not showing. #2 Also, my 4S has a smart keyboard with the microphone icon to the
-
Has anyone had issues with McAfee antivirus blocking tethering?
Hello all - trying to help my mother out with her laptop. She has an Iphone 5S, and we tested - when she activates mobile hotspot, other devices can use it - I tried with my tablet & phone and had no issue - but her laptop is not able to connect to i
-
I have converted AS2 Carousel to AS3 and it works fine without swapDepth line, which is: this.swapDepths(Math.round(this._xscale) + 100); I need to convert this line to AS3 ... it's very important because it prevents overlapping between layers. the p
-
How to anchor zoom point in ScrollViewer+Image?
I'm using the following XAML to allow the user to pan and zoom with an image: <ScrollViewer x:Name="scrollViewer" HorizontalSnapPointsType="None" HorizontalScrollBarVisibility="Auto" VerticalSnapPointsType="None" ZoomSnapPointsType="None" IsHorizonta
-
Using multicolumn listbox as indicator
I am trying to have data that I am collecting display on a multicolumn as it comes in. I don't know if you can do this and if you can I dont know how I can control where the data goes on the listbox. So can anyone explain this please? Thanks Solved!