When performing some operation that involves creation of directories or files the user gets and SQL error like SQL0293N, SQL0970N or similar indicating that the operations cannot be completed. The /tmp/SQLDIR.LK0 is used to serialize access to the file system when creating directories and files needed for DB2. This mainly happens when creating directories and files for storage containers.
SQL0293N or SQL0970N when activating database, creating a tablespace, creating a database, restoring a database
The permissions in the /tmp directory are not correct
ALL UNIX platforms
Diagnosing The Problem
Commands like activate database, connect to database, create database, restore database will return SQL0293N or SQL0970.
The diag.log will show an error or warning like this:
2016-07-26-08.31.06.641066-420 I57479671E631 LEVEL: Error
PID : 8027 TID : 140387012306688PROC : db2sysc 0
INSTANCE: xxxxxxxx NODE : 000 DB : xxxxxx
APPHDL : 0-7 APPID: *LOCAL.xxxxxx.160726153101
AUTHID : CTGINST1
EDUID : 21 EDUNAME: db2agent (xxxxxxx) 0
FUNCTION: DB2 UDB, buffer pool services, sqlbLockAllDirs, probe:905
MESSAGE : ZRC=0x840F0001=-2079391743=SQLO_ACCD "Access Denied"
DIA8701C Access denied for resource "", operating system return
DATA #1 : <preformatted>
Cannot create /tmp/SQLDIR.LK0
Reviewing the permissions on the /tmp directory will show that it is not 777
Resolving The Problem
As root change permissions for the /tmp directory:
chmod 777 /tmp
16 June 2018