DBA Hub

📋Steps in this guide1/1

Gather stats for a table

BEGIN DBMS_STATS.GATHER_TABLE_STATS ( ownname => 'SCOTT', tabname => 'TEST', cascade => true, ---- For collecting stats for respective indexes method_opt=>'for all indexed columns size 1', granularity => 'ALL', estimate_percent =>dbms_stats.auto_sample_size, degree => 8); END; /

oracle configurationintermediate
by OracleDba
14 views
1

Gather stats for a table

-- For a single table partition

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
BEGIN
DBMS_STATS.GATHER_TABLE_STATS (
ownname => 'SCOTT',
tabname => 'TEST',
cascade => true, ---- For collecting stats for respective indexes
method_opt=>'for all indexed columns size 1',
granularity => 'ALL',
estimate_percent =>dbms_stats.auto_sample_size,
degree => 8);
END;
/
BEGIN
DBMS_STATS.GATHER_TABLE_STATS (
ownname => 'SCOTT',
tabname => 'TEST', --- TABLE NAME
partname => 'TEST_JAN2016' --- PARTITOIN NAME
method_opt=>'for all indexed columns size 1',
GRANULARITY => 'APPROX_GLOBAL AND PARTITION',
degree => 8);
END;
/

Comments (0)

Please to add comments

No comments yet. Be the first to comment!