Materialized view query [message #454346] |
Wed, 05 May 2010 02:41 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
desi_bob02
Messages: 8 Registered: November 2009 Location: india
|
Junior Member |
|
|
Hi all,
how to check the time taken for materialized view to execute at one time.
My materialized view is a complete refresh which automatically executes at 3:00.
a) I have queried dba_jobs and dba_mview_refresh_times, and matched the last_date and last_refresh to find the total time. How can I be know that JOB 80 corresponds to my view MVIEW_UNION in a much easier way?
SQL> select job,last_date,total_time from dba_jobs order by last_date;
JOB LAST_DATE TOTAL_TIME
---------- ----------------- ----------
80 05/05/10 03:00:02 5255
SQL>select name,last_refresh from dba_mview_refresh_times where owner
NAME LAST_REFRESH
------------------------------ -----------------
MVIEW_UNION 05/05/10 03:00:02
b) Also is total_time the time it took the query to execute today at 3:00, i.e it started at 3:00 and ended at around 4:45(3+5255 msec) or is it the overall time it has taken since the day it was scheduled in dba_jobs( i.e 1 week back)
c) Also my source table dosent contain any indexes and I have created indexes on materialized view, i want to know if the complete refresh will recreate the indxes.
thanks in advance,
regards,
|
|
|
|
|
|
|
Re: Materialized view query [message #454430 is a reply to message #454427] |
Wed, 05 May 2010 09:12 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
babuknb
Messages: 1736 Registered: December 2005 Location: NJ
|
Senior Member |
![babu.knb@gmail.com](/forum/theme/orafaq/images/google.png) ![babudba](/forum/theme/orafaq/images/skype.png)
|
|
>>so how to find the time taken by the MV,
Okay Try
spool time_refresh_mv.log
select to_char(sysdate,'DD-MM-YYYY HH24:MI:SS') from dual;
exec dbms_refresh.refresh('MV name')
select to_char(sysdate,'DD-MM-YYYY HH24:MI:SS') from dual;
spool off
Babu
[Updated on: Wed, 05 May 2010 09:12] Report message to a moderator
|
|
|
|
Re: Materialized view query [message #454886 is a reply to message #454884] |
Sat, 08 May 2010 01:51 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
There are so many things Oracle can store, each one different for each customer, Oracle can't store all of them, if you want some statistics to be store then the only thing you can and you have to do is to open an "Enhancement Request".
If one does not ask for what he want, he can't blame Oracle (now asking does not mean you will have it but you can then be angry against Oracle).
Regards
Michel
[Updated on: Sat, 08 May 2010 02:22] Report message to a moderator
|
|
|
|
Re: Materialized view query [message #454891 is a reply to message #454888] |
Sat, 08 May 2010 02:24 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/102589.gif) |
Michel Cadot
Messages: 68733 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Quote:made me think as to why this information coudn't be stored automatically
It could (the proof is that total time is) but it has not be chosen.
Quote:This is the first time i have found something that is not already automated in Oracle.]
You're lucky, I found many others but far less than in any other rdbms (hopefully for me that works on Oracle ).
Regards
Michel
[Edit: typos]
[Updated on: Tue, 23 April 2019 03:43] Report message to a moderator
|
|
|