Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-28031: maximum of 148 enabled roles exceeded

854200Apr 14 2011 — edited Aug 26 2011
Hi,

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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 23 2011
Added on Apr 14 2011
3 comments
11,403 views