Friday, April 15, 2011

License_max_users

This was tested on an Oracle 10 database.

The license_max_users parameter determines how many users you can have in a database. How you set this parameter depends on your licensing agreement with Oracle.

If it is zero, you can create as many users as you want:

SQL> l
  1  select value from v$parameter
  2* where name = 'license_max_users'
SQL> /


VALUE
----------
0


SQL>

It is not relevant at the session level so you cannot change it there:

SQL> l
  1* alter session set license_max_users = 10
SQL> /
alter session set license_max_users = 10
                  *
ERROR at line 1:
ORA-02096: specified initialization parameter is not
modifiable with this option
SQL> 

You cannot set license_max_users lower than the number of users currently in a database:

SQL> select count(*) from dba_users;

  COUNT(*)
----------
        22


SQL> alter system set license_max_users = 21;
alter system set license_max_users = 21
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because
specified value is invalid
ORA-00035: LICENSE_MAX_USERS cannot be less than
current number of users


SQL> alter system set license_max_users = 22;

System altered.

SQL>

And if you try to create more users once you have reached the limit imposed by license_max_users, that will fail too:

SQL> create user fred identified by bloggs;
create user fred identified by bloggs
                               *
ERROR at line 1:
ORA-01985: cannot create user as LICENSE_MAX_USERS
parameter exceeded


SQL>

And a message goes to your alert log:

Create user disallowed, current users equal maximum (22)

No comments:

Post a Comment