-- recreate all statistics
DECLARE
CURSOR cOwner IS SELECT DISTINCT owner
FROM dba_tables
WHERE owner NOT IN ('SYS','SYSTEM','DBSNMP',);
BEGIN
-- analyze sOwner,compute
FOR rOwner IN cOwner LOOP
DBMS_STATS.GATHER_SCHEMA_STATS
(ownname => rOwner.owner,
estimate_percent => 99,
block_sample => FALSE,
method_opt => 'FOR ALL COLUMNS SIZE 150',
degree => NULL,
granularity => 'DEFAULT',
cascade => TRUE);
END LOOP;
END;
/
select 'END_DATE: '||to_char(sysdate,'dd.mm.yyyy hh24:mi:ss') as end_date from dual;
exit
what are we ? we are what we experience. And some more. I bring together here, collective experiences from different parts of life..
Tuesday, March 13, 2007
Gather statistics for a schema
Labels:
Oracle
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment