Oracle DBMS_AUTO_INDEX
Version 21c

General Information
Library Note Morgan's Library Page Header
Which has the higher priority in your organization: Deploying a new database or securing the ones you already have? Looking for a website, and resources, dedicated solely to securing Oracle databases? Check out DBSecWorx.
Purpose The Oracle Database periodically runs a task, SYS_AUTO_INDEX_TASK that monitors the system and creates indexes based on workload running in the system. This package contains subprograms that display the report of the task, configure task execution and behavior.
AUTHID CURRENT_USER
Dependencies
ALL_CONSTRAINTS ALL_USERS DBMS_SPM_INTERNAL
ALL_CONS_COLUMNS DBMS_AUTO_INDEX_INTERNAL DBMS_STANDARD
ALL_INDEXES DBMS_AUTO_INDEX_LIB DBMS_STATS_INTERNAL
ALL_IND_COLUMNS DBMS_REPORT PRVT_REPORT_TAGS
ALL_TABLES DBMS_SMB XMLTYPE
Documented Yes
First Available 19c
Security Model Owned by SYS with EXECUTE granted to the DBA role.
Source {ORACLE_HOME}/rdbms/admin/dbmsai.sql
Subprograms
 
CONFIGURE
Sets configuration options for auto indexing. dbms_auto_index.configure(
parameter_name  IN VARCHAR2,
parameter_value IN VARCHAR2,
allow           IN BOOLEAN := TRUE);
exec dbms_auto_index.configure('AUTO_INDEX_REPORT_RETENTION', '90', TRUE);
 
DROP_AUTO_INDEXES (new 21c)
Allows dropping automatically created index dbms_auto_index.drop_auto_indexes(
owner IN VARCHAR2,
index_name IN VARCHAR2,
allow_recreate IN BOOLEAN);
exec dbms_auto_index.drop_auto_indexes('C##UWCLASS', '', TRUE);

PL/SQL procedure successfully completed.
 
DROP_SECONDARY_INDEXES
Drops indexes that are not used for constraints for given (optional) schema and table. If no schema is given, all indexes which the user has priviledges on will be dropped. If no table is given, all indexes within the given schema will be dropped. dbms_auto_index.drop_secondary_indexes(
ownname IN VARCHAR2 DEFAULT NULL,
tabname IN VARCHAR2 DEFAULT NULL);
exec dbms_auto_index.drop_secondary_indexes('UWCLASS', 'SERVERS');
 
REPORT_ACTIVITY
Reports the results of auto index executions between specified activity_start and activity_end dbms_auto_index.report_activity(
activity_start IN TIMESTAMP WITH TIME ZONE := SYSTIMESTAMP - 1,
activity_end   IN TIMESTAMP WITH TIME ZONE := SYSTIMESTAMP,
type           IN VARCHAR2 := 'TEXT',
section        IN VARCHAR2 := 'ALL',
level          IN VARCHAR2 := 'TYPICAL')
RETURN CLOB);
exec dbms_auto_index.report_activity(SYSTIMESTAMP-24, SYSTIMESTAMP, 'TEXT', 'INDEX_DETAILS', 'ALL');
 
REPORT_LAST_ACTIVITY
Reports the results of last auto index task execution dbms_auto_index.report_last_activity(
type    IN VARCHAR2 := 'TEXT',
section IN VARCHAR2 := 'ALL',
level   IN VARCHAR2 := 'TYPICAL')
RETURN CLOB;
spool /home/oracle/autoidx_last_activity.html

exec dbms_auto_index.report_last_activity('HTML', 'ALL', 'ALL');

spool off
 
Related Queries
Query to return auto-indexes SELECT owner, index_name, index_type, table_owner, table_name, table_type
FROM dba_indexes
WHERE auto = 'YES'
ORDER BY 1,2;

Related Topics
Built-in Functions
Built-in Packages
DBMS_ADBTASK_ADMIN
DBMS_AUTO_INDEX_INTERNAL
DBMS_I_INDEX_UTL
DBMS_INDEX_UTL
DBMS_INDEXING
DBMS_PCLXUTIL
DBMS_SPACE.CREATE_INDEX_COST
Indexes
What's New In 19c
What's New In 20c-21c

Morgan's Library Page Footer
This site is maintained by Dan Morgan. Last Updated: This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2021 Daniel A. Morgan All Rights Reserved
  DBSecWorx