473,324 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

db2_all help

I am new to shell scripting. I need to use the db2_all command in a
shell script can someone help.
I need to use the following command in the shell script:
db2_all <<-0< db2 conncet to sample; db2 export to ./exp/tabname.ixf
select * from ixf where dbpartitionnum(customer) = current
dbpartitionnum;
Thanks in advance.

Jul 2 '06 #1
3 7439
This is Partition wise export.

db2_all "<<+0< db2 connect to sample; db2 export to ./exp/tabname.0.ixf
of ixf select * from tabname where nodenumber(Partitionkey) = 0 ;" >
outputfilename.0

db2_all "<<+11< db2 connect to sample; db2 export to
../exp/tabname.11.ixf of ixf select * from tabname where
nodenumber(Partitionkey) = 11 ;" outputfilename.11

Need to add as per ur node entries in db2nodes.cfg file & save it as a
..sql file say test.sql and need to invoke this .sql file as like given
below.

db2 -tvf test.sql -z test.sql.out

With Regards

Balakrishnan Ethiraju

chettiar wrote:
I am new to shell scripting. I need to use the db2_all command in a
shell script can someone help.
I need to use the following command in the shell script:
db2_all <<-0< db2 conncet to sample; db2 export to ./exp/tabname.ixf
select * from ixf where dbpartitionnum(customer) = current
dbpartitionnum;
Thanks in advance.
Jul 3 '06 #2
Hi Bala,

I understand that it is a partition wise export, but the syntax you
gave me wont help me. I need it to run from one command rather than
split it into multiple nodes.

Sandip

bala_e wrote:
This is Partition wise export.

db2_all "<<+0< db2 connect to sample; db2 export to ./exp/tabname.0.ixf
of ixf select * from tabname where nodenumber(Partitionkey) = 0 ;" >
outputfilename.0

db2_all "<<+11< db2 connect to sample; db2 export to
./exp/tabname.11.ixf of ixf select * from tabname where
nodenumber(Partitionkey) = 11 ;" outputfilename.11

Need to add as per ur node entries in db2nodes.cfg file & save it as a
.sql file say test.sql and need to invoke this .sql file as like given
below.

db2 -tvf test.sql -z test.sql.out

With Regards

Balakrishnan Ethiraju

chettiar wrote:
I am new to shell scripting. I need to use the db2_all command in a
shell script can someone help.
I need to use the following command in the shell script:
db2_all <<-0< db2 conncet to sample; db2 export to ./exp/tabname.ixf
select * from ixf where dbpartitionnum(customer) = current
dbpartitionnum;
Thanks in advance.
Jul 6 '06 #3
Hi,

I am trying to do this in my shell

for n in 0 1 2 3 4 5 6 7 8
do
st="export to test.ixf.00"${n}" of ixf select "${ln}" from
ADW.DETECTEDCF_06025 where dbpartitionnum(Customerid) = current
dbpartitionnum AND DateDetected < '2006-06-29 23:00:04.530000'"
db2_all "<<+$n< db2 connect to mldwdb; db2 \" select * from
ADW.DETECTEDCF_06025 where dbpartitionnum(Customerid) = current
dbpartitionnum and DateDetected = '2006-06-29 23:00:04.530000' \"; db2
terminate "
# echo $st
done
But it errors out. Can some one pls help
chettiar wrote:
Hi Bala,

I understand that it is a partition wise export, but the syntax you
gave me wont help me. I need it to run from one command rather than
split it into multiple nodes.

Sandip

bala_e wrote:
This is Partition wise export.

db2_all "<<+0< db2 connect to sample; db2 export to ./exp/tabname.0.ixf
of ixf select * from tabname where nodenumber(Partitionkey) = 0 ;" >
outputfilename.0

db2_all "<<+11< db2 connect to sample; db2 export to
./exp/tabname.11.ixf of ixf select * from tabname where
nodenumber(Partitionkey) = 11 ;" outputfilename.11

Need to add as per ur node entries in db2nodes.cfg file & save it as a
.sql file say test.sql and need to invoke this .sql file as like given
below.

db2 -tvf test.sql -z test.sql.out

With Regards

Balakrishnan Ethiraju

chettiar wrote:
I am new to shell scripting. I need to use the db2_all command in a
shell script can someone help.
>
>
I need to use the following command in the shell script:
>
>
db2_all <<-0< db2 conncet to sample; db2 export to ./exp/tabname.ixf
select * from ixf where dbpartitionnum(customer) = current
dbpartitionnum;
>
>
Thanks in advance.
Jul 10 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
6
by: wukexin | last post by:
Help me, good men. I find mang books that introduce bit "mang header files",they talk too bit,in fact it is my too fool, I don't learn it, I have do a test program, but I have no correct doing...
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
1
by: db2sysc | last post by:
All: When I execute a utility command using db2_all, Can I get seperate return codes per node where the command got executed? in other words, how to get the returncode when we execute db2_all...
3
by: JS | last post by:
windows 2k with v 8 fix 5, eee set up when I issue db2_all "db2 get db cfg for <dbname>", I get for each node: <HOSTANME> : DB2 GET DB CFG FOR <DBNAME> completed RC=0 rah: <HOSTNAME> but there is...
5
by: Prince Kumar | last post by:
I am trying to escape the special characters while executing the following sql, but couldn't figure out a way. db2_all "db2 connect to mydb; db2 select * from table (SNAPSHOT_CONTAINER ( '' , -1...
0
by: Will Griffiths | last post by:
Hi, I am running DB2 v8.1 ESE on Windows 2000 and have a single instance on my machine with 3 nodes. When I attempt to run *any* command using db2_all I get the following output (my machine...
0
by: da | last post by:
Hi All, Suppose, I have a command like the following one. db2_all '<<-0<|| db2 list applications; db2 terminate ' Now, Would the commands inside the single quotes run parallel on all the...
6
by: Fan Ruo Xin | last post by:
db2_all "db2 update db cfg for sample using tsm_mgmtclass \'\'"; ksh: syntax error at line 1 : `{' unmatched ksh: syntax error at line 1 : `{' unmatched ksh: syntax error at line 1 : `{'...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.