Re: MV refresh

From: Roger Xu <wellmetus_at_gmail.com>
Date: Wed, 2 Sep 2009 11:50:23 -0500
Message-ID: <eb64345d0909020950p6d8fb9bat2ab8e1a77ccc7f05_at_mail.gmail.com>



Hello again,

I created a MV and create some indexes on the MV. Now the same refresh takes much longer.
Is there an easy way to defer the index building until the MV refresh is done?

Otherwise, I would have to:

  1. drop indexes;
  2. execute DBMS_MVIEW.refresh('PAYMENT','C');
  3. create indexes;

Also, what is the right way to collect statistics after MV refresh?

Thanks,

Roger Xu

:

> On Thu, Aug 27, 2009 at 3:58 PM, Allen, Brandon <
> Brandon.Allen_at_oneneck.com> wrote:
>
> Not positive off the top of my head, but I think itís possible for that to
> happen if you donít use the atomic refresh setting because then it does a
> truncate first, which is a DDL transaction, followed by the inserts, however
> if you use the atomic refresh, then it will keep the whole refresh together
> as a single transaction, which means it uses DELETE instead of TRUNCATE, so
> itís slower and generates significantly more redo. If I recall correctly
> there was also a change related to this functionality between 9i and 10g,
> but I forget the details Ė just search for atomic refresh on Metalink and
> Iím sure youíll find it. Regarding capturing the error message, just
> redirect the output of your refresh script to a log file and then run a
> check on that log file to see if there are errors or not.
>
>
>
> Regards,
>
> Brandon
>
>
>
> On Thu, Aug 27, 2009 at 3:50 PM, Roger Xu < wellmetus_at_gmail.com > wrote:
>
>
>
> Hi MV gurus,
>
> Is it possible that when a MV is being refreshed but gets some kind of
> error and ends up an empty MV in 10g?
>
> exec DBMS_MVIEW.refresh('MYMV','C'); - here is how we refresh.
>
> The application team wants me to write a procedure to refresh MV and
> capture the error message if it fails and restore the MV to the previous
> state. How do I capture the error? I know I can show errors in SQL*PLUS.
>
> Thanks,
>
> Roger Xu
>
> --
>
>
>
>
> ------------------------------
>
> Privileged/Confidential Information may be contained in this message or
> attachments hereto. Please advise immediately if you or your employer do not
> consent to Internet email for messages of this kind. Opinions, conclusions
> and other information in this message that do not relate to the official
> business of this company shall be understood as neither given nor endorsed
> by it.
>
>
>
>
>
> *Click here <http://www.drpeppersnapplegroup.com/about/corporate>* to
> learn more about Dr Pepper Snapple Groupís commitment to corporate* *
> social* *responsibility.
>
> Please be conscious of the environment and print this email only if
> absolutely necessary.
>
> This e-mail (including any attachments) is confidential and may contain
> privileged information of Dr Pepper Snapple Group, Inc. and/or its
> subsidiaries ("Dr Pepper Snapple Group"). If you are not the intended
> recipient or receive it in error, you may not use, distribute, disclose or
> copy any of the information contained within it and it may be unlawful to do
> so. If you are not the intended recipient, please notify us immediately by
> returning this e-mail to us at mailerror_at_dpsg.com and destroy all
> copies. Any views expressed by individuals within this e-mail do not
> necessarily reflect the views of Dr Pepper Snapple Group. This e-mail does
> not constitute a binding offer, acceptance, amendment, waiver or other
> agreement, unless the intent that an e-mail will constitute such is clearly
> stated in the body of the email. Recipients are advised to subject this
> e-mail and attachments to their own virus checking, in keeping with good
> computing practice. Please note that e-mail received by Dr Pepper Snapple
> Group may be monitored in accordance with applicable law.
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Sep 02 2009 - 11:50:23 CDT

Original text of this message