Monitoring all indexes through execute immediate [message #185383] |
Tue, 01 August 2006 08:32 |
skoskos
Messages: 19 Registered: November 2005 Location: Hell(as)
|
Junior Member |
|
|
Hi everybody,
I created a stored procedure which modifies all defined indexes in a schema to the monitoring usage state.
CREATE OR REPLACE PROCEDURE PRC_MONITOR_INDEX(P_ARRAYSIZE IN NUMBER DEFAULT 100)
AS
TYPE IND_ARRAY_TYPE IS TABLE OF USER_INDEXES.INDEX_NAME%TYPE
INDEX BY BINARY_INTEGER;
IND_ARRAY_VAR IND_ARRAY_TYPE;
CURSOR C1 IS
SELECT DISTINCT INDEX_NAME
FROM USER_INDEXES
WHERE INDEX_TYPE NOT IN ('LOB');
BEGIN
OPEN C1;
LOOP
FETCH C1 BULK COLLECT INTO IND_ARRAY_VAR LIMIT P_ARRAYSIZE;
FORALL I IN 1..IND_ARRAY_VAR.COUNT
EXECUTE IMMEDIATE 'ALTER INDEX '||IND_ARRAY_VAR(I)||' MONITORING USAGE ';
EXIT WHEN C1%NOTFOUND;
END LOOP;
CLOSE C1;
END;
However , the error PLS-00801: Internal Error[*** ASSERT at file pdw4.c, line 586; Unknown expression Expr = 283.; PRC_MONITOR_INDEX__HIS__P__94646[16, 11]] appears!!!!
What's going wrong with this routine?????
Thanks a lot,
Simon
|
|
|
|
|
|