Forum Stats

  • 3,781,655 Users
  • 2,254,534 Discussions
  • 7,879,776 Comments

Discussions

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

SITI
SITI Member Posts: 237 Bronze Badge
edited Nov 20, 2020 7:41AM in General Database Discussions

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

  • EdStevens
    EdStevens Member Posts: 28,604 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 Palacios
    Miguel Palacios Member 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

  • SITI
    SITI Member Posts: 237 Bronze Badge

    Hi,

    It is Datapump restore.

    Thanks,

    SITI

  • Hemendra.Singh
    Hemendra.Singh Member Posts: 26 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
  • EdStevens
    EdStevens Member Posts: 28,604 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 Palacios
    Miguel Palacios Member 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
  • SITI
    SITI Member Posts: 237 Bronze Badge

    THanks All for helping