I have a Primary and a (logical) Standby Database. The Schema 'APP' gets synced. Now a User has performance issues running a query against some tables in this 'APP' schema of the Standby Database. On the Primary the same query executed well after gathering table (DBMS_STATS.GATHER_TABLE_STATS) stats.
How to refresh statistics on the standby-side? The DBMS_STATS.GATHER_TABLE_STATS gives a ORA-16224.
SELECT table_name,last_analyzed FROM dba_tables WHERE table_name IN ('TAB1','TAB2');
I can clearly see that the standby stats are a bit too old ;)
SELECT guard_status FROM v$database; GUARD_STATUS ------------ STANDBY