Gathering Statistics on a Logical Standby (Doc ID 376406.1)

In this Document
  Goal
  Solution
  References

APPLIES TO:

Oracle Server - Enterprise Edition - Version: 10.1.0.3 to 11.2.0.2 - Release: 10.1 to 11.2
Information in this document applies to any platform.

GOAL

Q1: Is Oracle not automatically gathering Statistics on Application Tables/Indexes in the Logical
Standby Database like it does on the Primary Database ??

Q2: The Logical Standby Database is functioning well except that table/index Statistics do not appear to be getting updated.
If STATISTICS_LEVEL=TYPICAL, then shouldn't statistics on tables and indexes be updated automatically ?? The most recent LAST_ANALYZED date in DBA_TABLES for Tables are from the Time the Standby Database was built.


SOLUTION

A1: The automatic statistics gathering in the Logical Standby works same as on the Primary Database. This can be proved by querying the dba_tab_modifications View.

A2: This is an expected Behaviour. It is because Jobs do not run on a Logical Standby, hence no update to objects' statistics. Therefore, the LAST_ANALYZED column from dba_tables/dba_indexes will not get updated. This behaviour changed in 11g. Since 11g Data Guard supports the Usage of the PL/SQL DBMS_SCHEDULER Package to create Scheduler Jobs on a Standby Database, such a Job can be setup and executed on the Logical Standby Database. Note that you have to change the Database Guard to 'STANDBY' or 'NONE' in order to setup and execute Jobs - see
Data Guard Logical Apply: Handle the Database Guard (Doc ID 815585.1)
on how to modify that.





REFERENCES

NOTE:815585.1  - Data Guard Logical Apply: Handle the Database Guard

你可能感兴趣的:(Gathering Statistics on a Logical Standby (Doc ID 376406.1))