ORA-28031 while attempting to rebuild or drop index I am in the process of using Data Pump to setup a copy of an Oracle database from 11.2.0.3.0 on Windows to 11.2.0.4.0 on Oracle Linux. I have had a few issues with invalid objects which I have managed to resolve but I also have a number of indexes with the domidx_opstatus of 'FAILED'.

Attempting to rebuild these indexes results in the error:

ORA-29858: error occurred in the execution of ODCIINDEXALTER routine

ORA-28031: maximum of 150 enabled roles exceeded

This is a large database that I have recently begun working on so would like to avoid removing roles from any users to avoid breaking any fuctionality.

Is there away around this or another way of fixing the indexes?
The 150 enabled roles limit is hard coded. There is no way around it other than to remove roles from the user or consolidate the existing roles. Ideally you should do the latter for better long term results. See MOS Doc ID 1101035.1 and Doc ID 780749.1 for more details and some tips on how to identify the relevant roles.