Sunday, April 10, 2011

ORA-28031: maximum of 148 enabled roles exceeded

Error :

While connect to database as a normal user it fails with
ORA-28031: maximum of 148 enabled roles exceeded

Cause:

In a database at one time 148 user-defined roles can be enabled. Enabling more than 148 user-defined roles causes ORA-28031.

Resolution

At first time you can think about max_enabled_roles parameter but max_enabled_roles parameter has nothing to do if you enable 148 user-defined roles.

Possible that Data Import may also cause this.

In fact this parameter is deprecated. It is retained for backward compatibility only. You can see this parameter settings by,

SQL> show parameter max_enable
NAME TYPE VALUE
------------------------------------ --------------------------------- ------------------------------
max_enabled_roles integer 150

Though this parameter is set to 150 and you have enabled 148 user defined roles but additional user-defined roles can't be enabled because of the actual number of roles that users can enable is 148. So max_enabled_roles is 2 plus 148, because each user has two additional roles, PUBLIC and the user's own role.
As there is limit to 148 so you have to disable fewer roles or drop some roles and reorganize your database role policy.

You can enable or disable roles by using the SET ROLE statement for your current session. Also regroup the roles.

No comments: