DB2 - Problembeschreibung
Problem IC73819 | Status: Geschlossen |
LOAD from IXF file into Oracle-compatible DB may fail to insert data, if input has NOT NULL column that has a 0-byte string | |
Produkt: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
Problembeschreibung: | |
When performing LOAD operation into an Oracle-compatible database (i.e. a database created with DB2_COMPATIBILITY_VECTOR=ORA) from an IXF file, if DB2 first loads a string with length=0, then it will treat all the following strings as NULL values no matter if the string length is zero or not. This problem will happen when the source table column type is defined with NOT NULL (i.e. is not nullable), but the target table column type is nullable. This problem does not occur if we use IMPORT instead of LOAD. It also does not occur if we use LOAD and DEL file instead of LOAD and IXF file. This problem can be reproduced in the following steps: On source DB: db2 "create db loaddb" db2 "create table t1 (c1 varchar(10) not null )" -- c1 defined with NOT NULL db2 "insert into t1 values('')" -- insert '' before 'a' db2 "insert into t1 values('a')" db2 "export to t1.ixf of ixf select * from t1" On target DB: db2set DB2_COMPATIBILITY_VECTOR=ORA db2 terminate db2 "create db loaddb" db2 "create table t1(c1 varchar(10))" -- on target, we define the column c1 with NULL db2 "load from t1.ixf of ixf replace into t1 " $ db2 "select hex(c1) from t1" 1 -------------------- - - << we lost 'a' here 2 record(s) selected. | |
Problem-Zusammenfassung: | |
**************************************************************** * USERS AFFECTED: * * ALL * **************************************************************** * PROBLEM DESCRIPTION: * * When performing LOAD operation into an Oracle-compatible * * database (i.e. a database created with * * DB2_COMPATIBILITY_VECTOR=ORA) from an IXF file, if DB2 first * * loads a string with length=0, then it will treat all the * * following strings as NULL values no matter if the string * * length is zero or not. This problem will happen when the * * source table column type is defined with NOT NULL (i.e. is * * not nullable), but the target table column type is nullable. * * * * This problem does not occur if we use IMPORT instead of * * LOAD. It also does not occur if we use LOAD and DEL file * * instead of LOAD and IXF file. * * * * This problem can be reproduced in the following steps: * * * * * * On source DB: * * * * db2 "create db loaddb" * * * * db2 "create table t1 (c1 varchar(10) not null )" -- c1 * * defined * * with NOT NULL * * * * db2 "insert into t1 values('')" -- insert '' before 'a' * * * * db2 "insert into t1 values('a')" * * * * db2 "export to t1.ixf of ixf select * from t1" * * * * * * On target DB: * * * * db2set DB2_COMPATIBILITY_VECTOR=ORA * * * * db2 terminate * * * * db2 "create db loaddb" * * * * db2 "create table t1(c1 varchar(10))" -- on target, we * * define * * the column c1 with NULL * * * * db2 "load from t1.ixf of ixf replace into t1 " * * * * $ db2 "select hex(c1) from t1" * * * * 1 * * -------------------- * * - * * - << we lost 'a' here * * * * 2 record(s) selected. * **************************************************************** * RECOMMENDATION: * * Upgrade to db2 version 9.7 fix pack 4. * **************************************************************** | |
Local-Fix: | |
verfügbare FixPacks: | |
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows | |
Lösung | |
The fix will be included in db2 version 9.7 fix pack 4. | |
Workaround | |
keiner bekannt / siehe Local-Fix | |
Weitere Daten | |
Datum - Problem gemeldet : Datum - Problem geschlossen : Datum - der letzten Änderung: | 11.01.2011 04.05.2011 04.05.2011 |
Problem behoben ab folgender Versionen (IBM BugInfos) | |
9.7.FP4 | |
Problem behoben lt. FixList in der Version | |
9.7.0.4 |