Concurrent Statistics Collection in Oracle Database 12c Release 1 (12.1)
Improve the speed of statistics collection from Oracle database 12c Release 1 onward.
oracle 12cconfigurationintermediate
by OracleDba
14 views
Improve the speed of statistics collection from Oracle database 12c Release 1 onward.
12345678910111213141516
CONN sys@pdb1 AS SYSDBA
SELECT DBMS_STATS.get_prefs('CONCURRENT') FROM dual;
DBMS_STATS.GET_PREFS('CONCURRENT')
----------------------------------------------------------------------------------------------------
OFF
SQL>
BEGIN
DBMS_STATS.set_global_prefs (
pname => 'CONCURRENT',
pvalue => 'ALL');
END;
/123456789101112131415161718192021222324252627282930313233343536373839404142434445
CONN test/test@pdb1
DROP TABLE tab1 PURGE;
CREATE TABLE tab1 AS
SELECT level AS id,
'Description for ' || level AS description
FROM dual
CONNECT BY level <= 10000;
EXEC DBMS_STATS.delete_table_stats(USER, 'TAB1');
EXEC DBMS_STATS.gather_table_stats(USER, 'TAB1');
*
ERROR at line 1:
ORA-20000: Unable to gather statistics concurrently: insufficient privileges
ORA-06512: at "SYS.DBMS_STATS", line 34634
ORA-06512: at line 1
SQL>
CONN sys@pdb1 AS SYSDBA
GRANT CREATE JOB, MANAGE SCHEDULER, MANAGE ANY QUEUE TO test;
conn test/test@pdb1
EXEC DBMS_STATS.gather_table_stats(USER, 'TAB1');
*
ERROR at line 1:
ORA-20000: Unable to gather statistics concurrently: Resource Manager is not
enabled.
ORA-06512: at "SYS.DBMS_STATS", line 34634
ORA-06512: at line 1
SQL>
CONN sys@pdb1 AS SYSDBA
ALTER SYSTEM SET RESOURCE_MANAGER_PLAN = default_plan;
conn test/test@pdb1
EXEC DBMS_STATS.gather_table_stats(USER, 'TAB1');
PL/SQL procedure successfully completed.
SQL>Please to add comments
No comments yet. Be the first to comment!