If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Put Routine Fails

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-23-05, 04:19
ggnanaraj ggnanaraj is offline
Registered User
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 171
Put Routine Fails

Sun Solaris Sparc 8
DB2 UDB v 7.2
Compiler gcc

Registry Setting is as shown below:
Code:
$ 
$ db2set
DB2_SQLROUTINE_COMPILER_PATH=/export/home/db2inst1/sqllib/function/routine/sr_cpath
DB2_SQLROUTINE_COMPILE_COMMAND=gcc -fpic -D_REENTRANT -I/export/home/db2inst1/sqllib/include SQLROUTINE_FILENAME.c -shared -lpthread -o SQLROUTINE_FILENAME -R/export/home/db2inst1/sqllib/lib -R/usr/local/lib -L/export/home/db2inst1/sqllib/lib -L/usr/loca
DB2COMM=tcpip
DB2AUTOSTART=TRUE
$

Compilation of the SQL stored procedure is successful. GET ROUTINE is also working fine. When doing a PUT ROUTINE to another database on the same box, get the following error:

HTML Code:
$ db2 "put routine from update.sar"
SQL0443N  Routine "PUT_ROUTINE_SAR" (specific name
"db2udp!put_routine_sar_1parm") has returned an error SQLSTATE with diagnostic
text "-14847,      , failed ...".  SQLSTATE=38000
$
The put_routine.log has the following info:

PHP Code:
more put_routine.log

LINE    MESSAGES 
FOR P5531820.bnd
------  --------------------------------------------------------------------
        
SQL0061W  The binder is in progress.
        
SQL0091N  Binding was ended with "0" errors and "0" warnings.


SQLCA from CREATE PROCEDURE statement:

 
sqlcode:-14847
 sqlerrmc
:failed to remove SAR file
 sqlerrp
:SQLNd0AF
 sqlerrd
: -30850 0 1 0 -300 0
 sqlstate
:

Reply With Quote
  #2 (permalink)  
Old 11-23-05, 05:01
przytula przytula is offline
Registered User
 
Join Date: Nov 2004
Posts: 374
sp

according the message, file can not be removed
check files/authorities in sqllib/function..
__________________
Best Regards, Guy Przytula
DB2/ORA/SQL Services
DB2 DBA & Advanced DBA Certified
DB2 Dprop Certified
http://users.skynet.be/przytula/dbss.html
Reply With Quote
  #3 (permalink)  
Old 11-23-05, 05:27
ggnanaraj ggnanaraj is offline
Registered User
 
Join Date: Aug 2002
Location: Chennai, India
Posts: 171
Quote:
Originally Posted by przytula
according the message, file can not be removed
check files/authorities in sqllib/function..
Thanks for you input, now it works after make file permission changes as listed below:

Before file permission change:
PHP Code:
ls -ld sqllib
drwxrwxr
-t  16 db2inst1 db2iadm1    1024 Sep 21 15:23 sqllib
ls -ld sqllib/function
drwxrwxr-t   5 db2inst1 db2iadm1    1024 Apr 28  2005 sqllib/function
ls -ld sqllib/function/routine
drwxrwxr
-t   3 db2inst1 db2iadm1     512 Nov 22 13:39 sqllib/function/routine
ls -ld sqllib/function/routine/sqlproc
drwxrwxr
-x   5 db2inst1 db2iadm1     512 Nov 22 13:58 sqllib/function/routine/sqlproc
ls -ld sqllib/function/routine/sqlproc/DB
drwxrwxr
-x   3 db2fenc1 db2fadm1     512 Nov 22 13:58 sqllib/function/routine/sqlproc/DB
ls -ld sqllib/function/routine/sqlproc/DB/DB2INST1
drwxrwxr
-x   3 db2fenc1 db2fadm1     512 Nov 22 13:58 sqllib/function/routine/sqlproc/DB/DB2INST1
ls -ld sqllib/function/routine/sqlproc/DB/DB2INST1/tmp
drwxrwxr
-x   2 db2fenc1 db2fadm1     512 Nov 23 14:43 sqllib/function/routine/sqlproc/DB/DB2INST1/tmp
ls -l sqllib/function/routine/sqlproc/DB/DB2INST1/tmp
total 2
-rw-rw-rw-   1 db2fenc1 db2fadm1     386 Nov 23 14:43 put_routine.log

After file permission change as listed below:

PHP Code:
ls -ld sqllib/function/routine/sqlproc/DB
drwxrwxrwx   3 db2fenc1 db2fadm1     512 Nov 22 13
:58 sqllib/function/routine/sqlproc/DB
ls -ld sqllib/function/routine/sqlproc/DB/DB2INST1
drwxrwxrwx   3 db2fenc1 db2fadm1     512 Nov 22 13
:58 sqllib/function/routine/sqlproc/DB/DB2INST1
ls -ld sqllib/function/routine/sqlproc/DB/DB2INST1/tmp
drwxrwxrwx   2 db2fenc1 db2fadm1     512 Nov 23 14
:43 sqllib/function/routine/sqlproc/DB/DB2INST1/tmp 

PUT ROUTINE works now:
HTML Code:
$ db2 connect to db

   Database Connection Information

 Database server        = DB2/SUN 7.2.9
 SQL authorization ID   = DB2INST1
 Local database alias   = DB

$ db2 "put routine from update.sar"
DB20000I  The PUT ROUTINE command completed successfully.
$
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On