Wednesday, August 1, 2018

Gather Incremantal statistics for large or partitioned tables


BEGIN
  DBMS_STATS.SET_TABLE_PREFS (  
      ownname  =>  'HMA_TM_PROD_GEN2_MONITOR'
,     tabname  =>  'ZZT_SERVICE_LOG'
,     pname    =>  'INCREMENTAL'
,     pvalue   =>  'true'
);
END;

--This should return True. This mean incremental is enabled
select dbms_stats.get_prefs('INCREMENTAL','HMA_TM_PROD_GEN2_MONITOR','ZZT_SERVICE_LOG') from dual;

BEGIN
  DBMS_STATS.GATHER_TABLE_STATS (
      ownname  => 'HMA_TM_PROD_GEN2_MONITOR'
,     tabname  => 'ZZT_SERVICE_LOG'
);
END;
/

No comments:

Post a Comment

Featured Post

Apply Patch 22191577 latest GI PSU to RAC and DB homes using Opatch auto or manual steps

Patch 22191577: GRID INFRASTRUCTURE PATCH SET UPDATE 11.2.0.4.160119 (JAN2016) Unzip the patch 22191577 Unzip latest Opatch Version in or...