Migrated to OCI Autonomous Database 19c. Error when accessing data dic tables from Proc
We have migrated to OCI Autonomous Database 19c.
The following SQL work outside SP run by user USR:
select 'ALTER INDEX '||INDEX_NAME||' REBUILD;' stm from sys.dba_indexes d
where d.owner='USR' and status <> 'VALID'
and status <> 'N/A' ;
When in a pros the same statement gives an error when compiled by the same user USR:
PL/SQL: ORA-00942: table or view does not exist
CREATE OR REPLACE procedure tt.FixingInd
as
CURSOR c1 IS
select 'ALTER INDEX '||INDEX_NAME||' REBUILD;' stm from sys.dba_indexes d
where d.owner='USR' and status <> 'VALID'