You are currently reviewing an older revision of this page.
Sometimes I encounter a 'lock' message when trying to update records and wish to check who is logged in and who is locking which objects so I can resolve the issue.
In Oracle databases, locks are used to maintain the integrity of the data. Depending on the lock type, users may either see the form 'hang' when they try to enter or update data, or may see an error message advising the record is locked.
Probably the quickest and easiest way if all users operate in the same location is to ask around if someone else is working on the same data and ask them to let you know as soon as they have committed their changes so you can then make your changes to the record.
The following scripts can be run by your database administrator or system administrator in SQL*Plus (for Managed Service users please contact TSG):
sessions.sql - this lists all sessions logged in to the database. Any listed as 'active' are currently running something. Any 'inactive' but locking a table (see next script) may have paused in the middle of updating / inserting and be doing something else outside of Highways.
coe_locks.sql - lists all locks on the database, the username that has the lock and the session ID which can be linked back to the previous script output.
active_sql.sql - shows the session information, username and SQL command being run by anyone who has an active session currently.
More information about Oracle database locks and data integrity can be found here: http://docs.oracle.com/cd/B28359_01/server.111/b28318/consist.htm