On 11 Feb, 17:49, Knut Stolze <sto...@de.ibm.comwrote:
Quote:
rick wrote:
>
Quote:
I m trying to move only stored procedures from one database to another
and also onto a database on another server, I tried
db2 -x "select text from syscat.procedures where procschema =
'MYSCHEMA'" | tee /esa/home/sasha/MY_SCHEMA_SP.txt, how ever all the
procedures are getting loaded to the file but some stored procedures
are getting truncated because they are too big ,
>
The DB2 CLP is doing the truncation. The thing is that only the first 4 or
8KB of a LOB is written in the output of the CLP. Thus, everything larger
is not fully shown.
>
Quote:
I also tried to use getroutine but the problem is we have 600 of
them,
>
You could run a SELECT statement that retrieves the names of all procedures
in questions, builds the corresponding CALL statements for GET_ROUTINE and
then you only have to execute the script.
>
--
Knut Stolze
DB2 z/OS Utilities Development
IBM Germany
Hi,
We have a similar requirement, and have solved it by doing an export
from sysroutines (along the lines of db2 "EXPORT TO '/home/PXX/flytt/
$1.del' OF DEL LOBFILE '/home/PXX/flytt/$1' modified by LOBSINFILE
SELECT text||'£' FROM "SYSIBM"."SYSROUTINES" where routinename = '$1'
and routineschema = 'PXX'"). The export file and then be run as a
script against another server (db2 -td£ -vf /home/PXX/flytt/$1.001).
We add a connect and drop to the relevant server prior to executing
the script. All this is done in a shell script where we simply pass in
the routine name we want to move. If you have lots to move you can
write a simple scipt to loop through this process for each routine.
This way you can move the routines in the correct order.
One small limitation is that batch scripts cannot be over 64k in a v8
environment (this limitation is removed in v9).
A disadvantage of get and put is that your servers need to be at the
same fix pack level which may not always be tha case if for example
you are moving routines from a test environmnet to qa or production
servers.
John Enevoldson
Pulsen AB
Sweden.