Troubleshooting
Problem
Symptom
DEV.ADMIN(ADMIN)=> drop user test;
ERROR: DROP USER: could not acquire lock for "TEST"
Cause
Environment
1- In one putty session connect on the database as the test user
nzsql -c DEV -u test -pw test
2- Run a query against one table
DEV.ADMIN(TEST)=> select * from r1;
3- Open a new session and execute the alter table command as follows:
DEV.ADMIN(TEST)=> alter table r1 add column col2 int;
4- Open a new session and try to delete the user:
DEV.ADMIN(ADMIN)=> drop user test;
ERROR: DROP USER: could not acquire lock for "TEST"
Diagnosing The Problem
Command "nzsession" shows all the sessions that are active or idle in your NPS system.
nzsession
ID Type User Start Time PID Database Schema State Priority Name Client IP Client PID Command
------ ---- ------- ----------------------- ---- -------- ------ ------ ------------- --------- ---------- ------------------------
179302 sql TEST 06-Jan-15, 13:05:33 EST 2474 RM ADMIN active normal 127.0.0.1 2473 select * from r1
179308 sql TEST 06-Jan-15, 13:06:14 EST 2615 RM ADMIN active normal 127.0.0.1 2614 alter table r1 add colum
179410 sql ADMIN 06-Jan-15, 13:16:25 EST 3815 SYSTEM ADMIN active normal 127.0.0.1 3814 SELECT session_id, clien
Resolving The Problem
To kill the session from the user, run the following commands:
nzsession abort -force -id 179308
nzsession abort -force -id 179302
After aborting the sessions from user TEST, verify whether there is any other session in use by the user running command nzsession. If there is no session in use by TEST user, then you can drop user TEST with command below:
nzsql -c "drop user test;"
DROP USER
Product Synonym
pda netezza
Was this topic helpful?
Document Information
Modified date:
03 January 2024
UID
swg21694055