ORA-28031: maximum of 148 enabled roles exceeded
854200Apr 14 2011 — edited Aug 26 2011Hi,
I have written a PL/SQL block to create roles for each schema in the database. There are around 350 schemas in that particulat database.
Since we have MAX_ENABLED_ROLES as 148, I have put a check to see how many roles that the user executing the PL/SQl script is associated with
declare
cursor to get all schemas
begin
Loop through the cursor
select count(*) into n_max_ebaled from user_role_privs;
if(n_max_enabled < 140) then
<<<Create roles>>>
else
dbms_output.putline('Max roles enabled exceeded');
end if;
end loop;
Note I am executing this in TOAD. And to check how many roles are getting created I logged in SQL+ and did
select count(*) from user_role_privs;
When it showed 140. My script should have stopped.
I disconnect from SQL+ and re- connected. I am getting
ORA-28031: maximum of 148 enabled roles exceeded
How is this possible when I am checking USER_ROLE_PRIVS and then only creating roles.
Can someone help me to rectify this error?
Thanks
S