Gather stats on Table in Oracle Database

  Gather stats on Table in Oracle Database.

connect to CDB

connect to PDB

ALTER SESSION SET CONTAINER=PDB1;

ALTER SESSION SET DB_FILE_MULTIBLOCK_READ_COUNT=2048;

ALTER SESSION SET SORT_AREA_SIZE=512000000;

 

exec dbms_stats.gather_table_stats(ownname=>’ARP’,tabname=>’SUM_DETAIL’,

estimate_percent=>100, granularity=>’ALL’, cascade=>TRUE,

method_opt=>’FOR ALL COLUMNS SIZE 1′,degree=>20);

Details of parameters:

  •  DB_FILE_MULTIBLOCK_READ_COUNT ==>specifies the maximum number of blocks read in one I/Ooperation during a sequential scan.
  • granularity ==> ALL’ – gathers all (subpartition, partition, and global(object level)) statistics
  • method_opt ==> No specific column names can be specified.

 

See also: