DB2 - Problem description
| Problem IT03289 | Status: Closed |
CALLING UTL_FILE.FCOPY MAY CAUSE THE INSTANCE TRAP. | |
| product: | |
DB2 FOR LUW / DB2FORLUW / 970 - DB2 | |
| Problem description: | |
Calling UTL_FILE.FCOPY may cause the instance trap. On Windows
the trap file may not contain any stack trace. The db2trc shows
sqleml_getSessionState is called before getting the exception.
On AIX the trap file shows following stack trace:
-------Frame------ ------Function + Offset------
0x0900000019DC6BB4 sqleml_getSessionState__FPcT1P5sqlca + 0x94
0x0900000019DCA090 sqleml_utl_file_fcopy + 0x90
0x09000000ED78B21C sqloInvokeFnArgs + 0x9C
0x09000000E919A17C
sqlriInvokerTrusted__FP10sqlri_ufobP21sqlriRoutineErrorIntf +
0xB80
0x09000000ED99959C sqlriInvokeInvoker__FP10sqlri_ufobb + 0xBB0
0x09000000ED78854C sqlricall__FP8sqlrr_cb + 0xAC
0x09000000ED9010AC sqlriSectInvoke__FP8sqlrr_cbP12sqlri_opparm +
0x60C
0x09000000ED91DED4 sqlrr_process_execute_request__FP8sqlrr_cbi +
0xC04
0x09000000ED91CF38 sqlrr_execute__FP14db2UCinterfaceP9UCstpInfo
+ 0x84
0x09000000EA51301C executeSection__10pvmPackageFP5sqlcaUib +
0x520
0x09000000EA4FC8F0 executeQuery__3PVMFUib + 0x1A8
0x09000000EA4FB678 run__3PVMFv + 0x448
0x09000000EA4F9514 pvm_entry + 0x460
...
Here is the sample procedure. Running "call proc1()" will cause
the instance crash.
CREATE OR REPLACE PROCEDURE proc1()
BEGIN
CALL UTL_DIR.CREATE_DIRECTORY('dir', 'C:\TMP\');
CALL UTL_FILE.FCOPY('dir', 'tmpfile.txt', 'dir',
'tmpcopy_null.txt', NULL, NULL);
END@ | |
| Problem Summary: | |
**************************************************************** * USERS AFFECTED: * * Users using UTL_FILE routines * **************************************************************** * PROBLEM DESCRIPTION: * * See Error Description * **************************************************************** * RECOMMENDATION: * * Upgrade to DB2 Version 9.7 Fix Pack 10 or higher. * **************************************************************** | |
| Local Fix: | |
To workaround the problem you just call some other UTL_FILE
function(except for put_line routine or new_line routine as they
have the same issue as FCOPY) one time during the instance is up
before calling UTL_FILE.FCOPY(). For example, you just call
UTL_FILE.FOPEN() before calling FCOPY, and then remember to
CLOSE the file.
CREATE OR REPLACE PROCEDURE proc1()
BEGIN
DECLARE fhandle UTL_FILE.FILE_TYPE;
CALL UTL_DIR.CREATE_DIRECTORY('dir', '/work/akikoba/66344');
set fhandle = UTL_FILE.FOPEN('dir', 'tmpfile.txt', 'w')
CALL UTL_FILE.FCLOSE(fhandle);
CALL UTL_FILE.FCOPY('dir', 'tmpfile.txt', 'dir',
'tmpcopy_null.txt', NULL, NULL);
END@ | |
| Solution | |
First fixed in DB2 Version 9.7 Fix Pack 10. | |
| Workaround | |
not known / see Local fix | |
| Timestamps | |
Date - problem reported : Date - problem closed : Date - last modified : | 21.07.2014 24.11.2014 24.11.2014 |
| Problem solved at the following versions (IBM BugInfos) | |
9.7.FP10 | |
| Problem solved according to the fixlist(s) of the following version(s) | |
| 9.7.0.10 |
|