Database Tuning (MOSC)

MOSC Banner

export table stats

edited Jun 15, 2012 8:54PM in Database Tuning (MOSC) 11 commentsAnswered ✓
Before I gather the stats, I want to export the old stats to a separate table, so I anything do go wrong, I can still revert back.

I issue the following:

set echo off
set feedback off
set linesize 250
spool st04_backup_tab_stats_comp100_01.sql
select 'exec dbms_stats.export_table_stats(ownname=>' || CHR(39)|| owner || CHR(39) ||',' tabname=>|| CHR(39) ||table_name|| CHR(39) ||',' || 'stattab => 'BA
CKUP_STAT_TAB'' ||',' ||'statown => 'WGU''||')'||';'
from dba_tables
where owner='TRITON'
and table_name like '%100'
and num_rows >= 0
and num_rows < 100000
order by table_name;

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center