IBM Support

DB2 : Not enough space to allocate active log files.

Troubleshooting


Problem

Various errors related to logging and space may show up eg : SQL1762N holding up DB2 operations.

Symptom

SQL1762N Unable to connect to database because there is not enough space to allocate active log files.

OR
Hang - as cannot continue to write to primary log files

Cause

OSERR   : ENOSPC (28) "No space left on device"

Diagnosing The Problem

In db2diag.log, you will notice below errors when you hit the DISK FULL situation on the ACTIVE LOG storage path (mount) due to which
new primary log file cannot not be created/renamed in the active log path :

2021-03-19-00.00.02.614742+480 I3830A2668           LEVEL: Error (OS)
PID     : 10027166             TID : 5310           PROC : db2sysc 0
INSTANCE: db2inst1             NODE : 000           DB   : SAMPLE
HOSTNAME: HOST1
EDUID   : 5310                 EDUNAME: db2loggr (SAMPLE) 0
FUNCTION: DB2 Common, OSSe, ossErrorIOAnalysis, probe:100
CALLED  : OS, -, write
OSERR   : ENOSPC (28) "No space left on device"
DATA #1 : String, 146 bytes
A total of 5 analysis will be performed :
 - User info
 - ulimit info
 - Target file info
 - I/O attempt
 - File system

 Target file handle = 17
DATA #2 : String, 184 bytes
  Real user ID of current process       = 301
  Effective user ID of current process  = 301
  Real group ID of current process      = 301
  Effective group ID of current process = 301
DATA #3 : String, 379 bytes
Current process limits (unit in bytes except for nofiles) :
  mem     (S/H) = unlimited / unlimited
  core    (S/H) = unlimited / unlimited
  cpu     (S/H) = unlimited / unlimited
  data    (S/H) = unlimited / unlimited
  fsize   (S/H) = unlimited / unlimited
  nofiles (S/H) = unlimited / unlimited
  stack   (S/H) = unlimited / unlimited
  rss     (S/H) = unlimited / unlimited
DATA #4 : String, 41 bytes
current sbrk(0) value: 0x000000011f250800
DATA #5 : String, 261 bytes
Target File Information :
  Size               = 19611648
  Link               = No
  Reference path     = N/A
  Type               = 0x8000
  Permissions        = rw-------
  UID                = 301
  GID                = 301
  Last modified time = 1616083202
DATA #6 : String, 33 bytes
I/O attempt not implemented yet.
DATA #7 : String, 364 bytes
File System Information of the target file :
  Block size        = 4096 bytes
  Total size        = 21474836480 bytes
  Free size         = 0 bytes
  Total # of inodes = 1536
  FS name           = N/A
  Mount point       = /PATH_NAME
  FSID (major,minor)= 4, 3
  FS type name      = jfs2
  DIO/CIO mount opt = None
  Device type       = N/A
  FS type           = 0x6
CALLSTCK: (Static functions may not be resolved correctly, as they are resolved to the nearest symbol)
  [0] 0x090000000FCC4F58 pdOSSeLoggingCallback + 0x530
  [1] 0x0900000002B2E588 oss_log__FP9OSSLogFacUiN32UlN26iPPc + 0x1C8
  [2] 0x0900000002B2EA10 ossLogSysRC + 0x70
  [3] 0x0900000002B5603C ossErrorIOAnalysis__FCPC21OSSErrorAnalysisParam + 0xD7C
  [4] 0x0900000011A0B8DC sqloSystemErrorHandler + 0x518
  [5] 0x090000000F3C851C sqlowrite + 0x414
  [6] 0x090000000F3589E8 sqlowrite + 0x7C4
  [7] 0x0900000011A0C460 @87@sqloFilePreallocationUsingSlowWrite__FCP12SQLO_FHANDLECPLCLb + 0x764
  [8] 0x090000000E60318C sqloSetFileSize + 0x18C4

2021-03-19-00.00.02.853463+480 I14608A497           LEVEL: Error
PID     : 10027166             TID : 5310           PROC : db2sysc 0
INSTANCE: db2inst1             NODE : 000           DB   : SAMPLE
HOSTNAME: HOST1
EDUID   : 5310                 EDUNAME: db2loggr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgInitRecoverableWhenNoRecoveryPending, probe:7470
MESSAGE : ZRC=0x85100084=-2062548860=SQLP_NO_SPACE_FOR_LOG
          "Not enough space to create primary logs"

2021-03-19-00.01.50.004277+480 E42438A2423          LEVEL: Severe
PID     : 10027166             TID : 3600           PROC : db2sysc 0
INSTANCE: db2inst1             NODE : 000           DB   : SAMPLE
APPHDL  : 0-35048              APPID: *LOCAL.db2inst1.210318160149
AUTHID  : DB2INST1             HOSTNAME: HOST1
EDUID   : 3600                 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, SQLP_DBCB::setLogState, probe:5000
DATA #1 : <preformatted>
Database error has been detected.  As a result, for precautionary reasons
all logging services have been stopped.
CALLSTCK: (Static functions may not be resolved correctly, as they are resolved to the nearest symbol)
  [0] 0x090000000F1C1674 pdLogPrintf + 0x28
From the above information we know that there was no space left of /db2log to create new primary log file :
File System Information of the target file :
  Block size        = 4096 bytes
  Total size        = 21474836480 bytes ————>  21 GB
  Free size         = 0 bytes              ——> no space
  Mount point       = /PATH_NAME
  FS type name      = jfs2

Please check if disk full is also flagged in OS logs. For example, in AIX it will be errpt file (output of errpt -a).
Also check storage path space availability, on the /PATH_NAME of the active log files, which will mostly be nearing 100% usage. For example, on unix run and check with "df -g".

Resolving The Problem

Ensure that there is sufficient space on the device for the primary logs, as DB2 may require extra space to allocate new logs so that the database will start with at least LOGPRIMARY log files. Do NOT delete recovery logs to free space, even if they appear inactive.
If there is sufficient space allocated already, try reducing the values for LOGPRIMARY and/or LOGFILSIZ database configuration parameters so that a smaller set of active log files are used. This will reduce the requirement for disk space.
 

Document Location

Worldwide

[{"Type":"SW","Line of Business":{"code":"LOB10","label":"Data and AI"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"ARM Category":[{"code":"a8m500000008PmcAAE","label":"Recovery->Logging"}],"ARM Case Number":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Version(s)"}]

Document Information

Modified date:
21 April 2021

UID

ibm16445721