Question & Answer
Question
While attempting an offline database backup operation, you might encounter the following error: SQL1035N The database is currently in use. SQLSTATE=57019
Cause
SQL1035N is returned if you are attempting to take an offline backup of an activated database. Here is an example using DB2® Universal Database™ (DB2 UDB) Version 8.2:
db2 backup db sample to /home/db2inst1
SQL1035N The database is currently in use. SQLSTATE=57019
The following message is also logged in the db2diag.log file:
2005-11-18-11.29.17.849377-360 I9627A336 LEVEL: Error
PID : 34980 TID : 1 PROC : db2bp
INSTANCE: db2inst1 NODE : 000
FUNCTION: DB2 UDB, database utilities, sqlubConnectDatabase, probe:1259
DATA #1 : Hexdump, 4 bytes
0x00000001102842E0 : FFFF FBF5
....
In this db2diag.log message, the value "FFFF FBF5" translates to -1035 (SQL1035).
Answer
To determine whether the database has been activated, use the following db2pd command:
db2pd -db sample -app
...
Database Partition 0 -- Database SAMPLE -- Active -- Up 0 days 00:19:42
Applications:
Address AppHandl [nod-index] NumAgents CoorPid Status Appid
...
The word "Active" in this output indicates that the database has been activated. Alternatively, you can issue the db2 list active databases command.
After the database has been deactivated (for example, by using the db2 deactivate database command), the offline backup operation will succeed.
Note: You cannot determine whether the database was activated by using the db2 list applications command, because output from that command only tells you whether or not any applications are active on the database.
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21224032