Procedure that calls DBMS_STATS.GATHER_INDEX_STATS Fails in Standalone scheduler job
Oracle database Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.22.0.0.0
on Linux x86 64-bit
I have a procedure that calls:
dbms_stats.gather_index_stats(USER,
'[INDEX_NAME]',
estimate_percent => 100,
degree => 2);
The procedure runs fine from the command line, but when I run the procedure as a JOB:
DBMS_SCHEDULER.create_job (
job_name => l_dbms_job_name,
job_type => 'PLSQL_BLOCK',
job_action => l_dbms_job_action, -- Start time is NOW + 10 seconds
start_date => l_dbms_job_start,
end_date => NULL,
enabled => TRUE,
job_class => 'DEFAULT_JOB_CLASS',
comments => l_dbms_job_comment);
I get an error: