IBM Support

Error SQL2048N Reason Code 6 (RC 6) when trying to perform and online backup.

Troubleshooting


Problem

When trying to perform an online backup the user is presented with Error SQL2048N Reason Code 6 causing the backup to fail to complete.

Symptom

The backup does not complete and returns error SQL2048N RC 6

Cause

This can possibly be down to an application performing a REORG, which is being blocked by an application holding a lock on an object.

Diagnosing The Problem

SQL2048N Reason Code 6 indicates that "The object being accessed is a table space and either the table space is in such a state that the operation is not allowed or one or more containers of the table space is not available.

LIST TABLESPACES will list the current table space state.

In the db2diag.log the following example errors may be seen, where in this case table space SYSCATSPACE is in a state that disallows the backup to complete:

2016-04-26-06.47.28.644000-240 E6358F940 LEVEL: Severe
PID : 4060 TID : 7112 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000 DB : SAMPLE
APPHDL : 0-27764 APPID: *LOCAL.DB2.160426104803
AUTHID : DB2ADMIN
EDUID : 7112 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, database utilities, sqlubBuildAppTbsp, probe:1721
MESSAGE : SQL2048N An error occurred while accessing object "". Reason code:
"".
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -2048 sqlerrml: 3
sqlerrmc: 0 6
sqlerrp : sqlubBui
sqlerrd : (1) 0x00000000 (2) 0x00000000 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:

2016-04-26-06.47.28.644000-240 E7300F692 LEVEL: Error
PID : 4060 TID : 7112 PROC : db2syscs.exe
INSTANCE: DB2 NODE : 000 DB : SAMPLE
APPHDL : 0-27764 APPID: *LOCAL.DB2.160426104803
AUTHID : DB2ADMIN
EDUID : 7112 EDUNAME: db2agent (SAMPLE) 0
FUNCTION: DB2 UDB, database utilities, sqlubBuildAppTbsp, probe:1725
MESSAGE : SQL2048N An error occurred while accessing object "". Reason code:
"".
DATA #1 : String, 114 bytes
The BACKUP_IN_PROGRESS state cannot be turned on.
It is not compatible with the current state of the table space.
DATA #2 : String, 11 bytes
SYSCATSPACE

Enter the command:


db2pd -db <database> -reorg -appl -locks showlock -wlock

Replace <database> with the name of the database. This will show if you have a REORG running, you should find it in a Lock-Wait state, you should then be able to see the application which is causing the Lock-Wait in the same about.

You can read an example on the use of the db2pd command at the link below.
http://www.ibm.com/support/knowledgecenter/SSEPGG_9.7.0/com.ibm.db2.luw.admin.trb.doc/doc/c0054595.html?lang=en#c0054595__example1

Resolving The Problem

From the diagnosis above find the handle of the application causing the lock on the object and if it is not meant to have this lock on the object then force it to stop. This should result in the REORG being able to continue and complete.

Once the lock has been released try performing the online backup again.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Recovery - Backup","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;10.1;10.5","Edition":"Advanced Enterprise Server;Advanced Workgroup Server;Enterprise Server;Express;Express-C;Personal;Workgroup Server","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
07 December 2022

UID

swg21982212