473,604 Members | 2,513 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7471
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(Part itionkey) = 0 ;" >
outputfilename. 0

db2_all "<<+11< db2 connect to sample; db2 export to
../exp/tabname.11.ixf of ixf select * from tabname where
nodenumber(Part itionkey) = 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(Part itionkey) = 0 ;" >
outputfilename. 0

db2_all "<<+11< db2 connect to sample; db2 export to
./exp/tabname.11.ixf of ixf select * from tabname where
nodenumber(Part itionkey) = 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(Part itionkey) = 0 ;" >
outputfilename. 0

db2_all "<<+11< db2 connect to sample; db2 export to
./exp/tabname.11.ixf of ixf select * from tabname where
nodenumber(Part itionkey) = 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
6523
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 Workshop program: hcw.exe that's included with Visual Basic. This exact same file compiled perfectly with no notes, warnings or errors prior to reformatting my system. Prior to the reformatting, I copied the help.rtf file onto a CD and checked the box to...
6
4323
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 result in any way. Who can help me, I thank you very very much. list.cpp(main program) //-------------------------------------------------------------------------- - #pragma hdrstop #pragma argsused
3
3342
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 numarray, help gives unhelpful responses:
1
3101
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 across nodes ? Thanks
3
5017
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 no screen output for any of the nodes. Any idea how to make this work?
5
13484
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 ) ) as snp where TABLESPACE_NAME = 'MYTSP'; db2 terminate". How would I get this successully executed? Thanks.
0
1428
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 name replaced with <hostname>): C:\Program Files\IBM\SQLLIB\BIN>db2_all "wibble"
0
1592
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 nodes? ie, I want "db2 list applications; db2 terminate" to run on all the nodes in parallel. If the above syntax is not correct, how would I
6
3648
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 : `{' unmatched ksh: syntax error at line 1 : `{' unmatched ksh: syntax error at line 1 : `{' unmatched Any idea? If I use run the above command on single physcial node/multiple logical db partitions, it will be ok. I got the above error when I run the...
0
7997
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7929
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8406
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8274
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5882
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3906
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3954
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.