To report gather schema statistics
set long 1000000
VARIABLE MY_REPORT CLOB;
BEGIN
:MY_REPORT :=DBMS_STATS.REPORT_GATHER_SCHEMA_STATS(
OWNNAME=>'SCOTT',
DETAIL_LEVEL=>'TYPICAL',
FORMAT=>'HTML');
END;
/
select :MY_REPOR as report from dual;
exec dbms_stats.GATHER_SCHEMA_STATS(ownname=>'C##AGAP2');
variable myreport clob;
set long 1000000
begin
:myreport := dbms_stats.report_gather_schema_stats
(ownname =>'C##AGAP2',
detail_level=>'ALL',
format=>'TEXT');
end;
/
select :MY_REPOR as report from dual;