Tag Archives: oracle

Oracle gather schema stats

-- gather schema stats for the "current" schema/user
BEGIN
  dbms_stats.gather_schema_stats(
    ownname=>SYS_CONTEXT('USERENV','CURRENT_SCHEMA')
    ,CASCADE => DBMS_STATS.AUTO_CASCADE
    ,options=>'gather auto'
    ,estimate_percent=>DBMS_STATS.AUTO_SAMPLE_SIZE
  );
END;
/