Você pode ver até onde pode restaurar (período máximo de restore) com:

         ALTER SESSION SET NLS_dATE_FORMAT='DD/MM/YYYY HH24:MI:SS'
         SELECT DBMS_STATS.GET_STATS_HISTORY_AVAILABILITY FROM DUAL;

Pra saber o tempo de retenção das estatísticas:

         SELECT DBMS_STATS.GET_STATS_HISTORY_RETENTION AS RETENCAO_DIAS
FROM DUAL;

E pra restaurar, estando dentro do tempo limite, use o script passado
anteriormente pelo colega.


Em 11 de fevereiro de 2014 14:31, Vitor Junior <vitorj...@gmail.com>escreveu:

>
>
> Falha minha.
> Boa Ivan, esqueci da dbms restore stats! :)
>
>
>
> Att,/Regards,
>
>
> Vitor Jr.
> Infraestrutura / Infrastructure Team
> Oracle 11g DBA Certified Professional - OCP
> Oracle Certified Expert, Oracle Real Application Clusters 11g and Grid
> Infrastructure Administrator - OCE
> Oracle Database 11g Performance Tuning Certified Expert - OCE
> Oracle Exadata 11g Certified Implementation Specialist
> Oracle Certified Associate, MySQL 5
> mail, gtalk e msn: vitorj...@gmail.com
> http://certificacaobd.com.br/
> skype: vjunior1981
> https://mybizcard.co/vitor.jr.385628
>
>
> Em 11 de fevereiro de 2014 14:18, Ivan Ricardo Schuster <
> ivanr...@gmail.com> escreveu:
>
>
>>
>> Ok, e DBMS_STATS.RESTORE_DATABASE_STATS resolveu seu problema?
>>
>>
>>
>> 2014-02-11 14:12 GMT-02:00 Wanderson Barrence <wbarre...@gmail.com>:
>>
>>>
>>>
>>> Fala Ivan!!!
>>>
>>> O banco de dados é Oracle RAC 10g (10.2.0.3).
>>>
>>> Att,
>>>
>>> Wanderson
>>>
>>>
>>> Em 11 de fevereiro de 2014 14:08, Ivan Ricardo Schuster <
>>> ivanr...@gmail.com> escreveu:
>>>
>>>
>>>>
>>>> Wanderson,
>>>>
>>>> Você não informa versão, vê se resolve:
>>>>
>>>> DBMS_STATS.RESTORE_DATABASE_STATS(
>>>>    as_of_timestamp        TIMESTAMP WITH TIME ZONE,
>>>>    force                  BOOLEAN DEFAULT FALSE,
>>>>    no_invalidate          BOOLEAN DEFAULT to_no_invalidate_type
>>>>                                                     
>>>> (GET_PARAM('NO_INVALIDATE')));
>>>>
>>>> http://docs.oracle.com/cd/E11882_01/appdev.112/e40758/d_stats.htm
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2014-02-11 14:04 GMT-02:00 Vitor Junior <vitorj...@gmail.com>:
>>>>
>>>>
>>>>>
>>>>> Se não fez backup das estatísticas antes, não.
>>>>> A única possibilidade é deletar.
>>>>>
>>>>>
>>>>>
>>>>> Att,/Regards,
>>>>>
>>>>>
>>>>> Vitor Jr.
>>>>> Infraestrutura / Infrastructure Team
>>>>> Oracle 11g DBA Certified Professional - OCP
>>>>> Oracle Certified Expert, Oracle Real Application Clusters 11g and Grid
>>>>> Infrastructure Administrator - OCE
>>>>> Oracle Database 11g Performance Tuning Certified Expert - OCE
>>>>> Oracle Exadata 11g Certified Implementation Specialist
>>>>> Oracle Certified Associate, MySQL 5
>>>>> mail, gtalk e msn: vitorj...@gmail.com
>>>>> http://certificacaobd.com.br/
>>>>> skype: vjunior1981
>>>>> https://mybizcard.co/vitor.jr.385628
>>>>>
>>>>>
>>>>> Em 11 de fevereiro de 2014 13:49, Wanderson Barrence <
>>>>> wbarre...@gmail.com> escreveu:
>>>>>
>>>>>
>>>>>>
>>>>>> Olá Pessoal,
>>>>>>
>>>>>> Existe alguma maneira de desfazer a coleta de estatísticas,
>>>>>> retornando para a data do último last analyze antes da última coleta?
>>>>>>
>>>>>> A coleta foi feita utilizando o script abaixo:
>>>>>>
>>>>>> BEGIN
>>>>>>   dbms_stats.gather_database_stats(options=> 'GATHER AUTO');
>>>>>>  END;
>>>>>>
>>>>>> Att,
>>>>>>
>>>>>> Wanderson
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>
>  
>



-- 
*Fabrício Pedroso Jorge.*

Administrador de Banco de Dados
Oracle 11g Certified SQL Expert
Oracle 11g Certified Associate
Oracle 11g Certified Professional
Linux Professional Institute Certified Level I (LPIC-I)
ITIL V3 Foudations
certificacaodb.com.br

*Resumo Profissional:*
http://br.linkedin.com/in/fabriciojorge

*Contatos:*
+ 55 91 88991116
skype: fabricio.pedroso.jorge
fpjb...@gmail.com

Responder a