ASE has run out of LOCKS with Error: 1204, Severity: 17, State: 2

1.Verify what value you use for 'number of locks', use ISQL and a login with sa_role (Example: sa or sapsa) to connect with the ASE:

sp_configure 'number of locks'
go

Note: This will return the configured value, the new value depends on max. number of connections, how many objects are accessed the same time and what locking shema your objects do have. The setting can be done dynamic, so you can increase this value step by step.

2.Normally the new values should be around 10%-25% higher than the current used value, to set this:

Example:
sp_configure 'number of locks', 5000000
go

Note: In case error Msg is returned while trying to increase the number of locks, like this:

1> sp_configure 'number of locks', 5000000
2> go
Msg 5861, Level 16, State 2:
Server 'POP', Procedure 'sp_configure', Line 1335:
The current 'max memory' value '<value_max_memory>', is not sufficient to change the
parameter 'number of locks' to '10000000'. 'max memory' should be greater than
'total logical memory' '<value_logical_memory>' required for the configuration.
(return status = 1)

Then please:

    • Set the configuration parameter 'max memory' to the <value_logical_memory> specified in Error 5861.
    • Retry the sp_configure 'number of locks' statement.

3.To monitor the usage of the locks you can use the procedure sp_monitorconfig. 

Example:

sp_monitorconfig "all"
go


OR

sp_monitorconfig "number of locks"
go


Check the ASE error-log for more info .
Example :


NOTE : SAP Business Suite environment, the starting point is to configure 5 million locks and 5 - 10 million is considered the average range.

Sybase history

Sybase  is a computer software company that develops and sells database management system (DBMS) and middleware products. The company was fo...