After restore the Oracle Database backup, is essential to gather schema stats. — oracle-tech

    Forum Stats

  • 3,701,866 Users
  • 2,239,504 Discussions
  • 7,835,594 Comments

Discussions

After restore the Oracle Database backup, is essential to gather schema stats.

SITISITI Posts: 236 Blue Ribbon

Hi All,

Thanks in Advance,

After restore the Oracle Database backup, is essential to gather schema stats.

exec dbms_stats.gather_schema_stats('username');

Thank you,

Regards,

Jayaprakash.

Comments

  • EdStevensEdStevens Posts: 27,735 Gold Crown

    Why would you? The stats themselves are stored in a system table in the database. When you restored the database (assuming a full resotre/recovery) the tables with the stats are part of what got restored. The restored stats will be 'correct' for the restored database as a whole.

  • Miguel PalaciosMiguel Palacios Posts: 191 Bronze Badge

    Hi

    In my experience, after an RMAN restore or a Datapamp import or a massive load of data, I proceed to update statistics because the characteristics of the destination server may have changed, especially cores, threads, etc.

    It could help depending on each restore scenario. However, it is not mandatory to gather statistics

  • SITISITI Posts: 236 Blue Ribbon

    Hi,

    It is Datapump restore.

    Thanks,

    SITI

  • Hemendra.SinghHemendra.Singh Posts: 25 Red Ribbon

    Hi Jaya,

    restore using RMAN is exact point in time replica/copy point of source database.

    which means all data and metadata are same as source till the point database restore.

    oracle recommend to gather the state whenever bulk change in data ( volume of data ) .

    even if you refresh with Data pump , it will include the statistics by default.

    it's not mandatory to gather stat after refresh ( RMAN/Datapump).

    Thanks,

    Hemendra Singh

    SITI
  • EdStevensEdStevens Posts: 27,735 Gold Crown

    Hi,

    It is Datapump restore.

    Thanks,

    SITI

    In the oracle world, the terms 'restore' and 'backup' are terms that generally refer to rman operations. They are actual rman commands. So when you use those terms, people are going to naturally think of rman operations.


    For data pump we use the terms 'export' and 'import'.

    Precision counts in this business. I don't think you would trust a doctor who used the term 'heart' or 'lung', when he's looking at removing an infected appendix.

    SITI
  • Miguel PalaciosMiguel Palacios Posts: 191 Bronze Badge

    Hi SITI

    If you are doing Datapump i will exclude stats from the export (because of the export duration) and then after the import gather stats. It will depend on your database size to select an estimate for your stats

    SITI
  • SITISITI Posts: 236 Blue Ribbon

    THanks All for helping

Sign In or Register to comment.