Running multiple db2 command in the same Unix session

Deepak Goyal

Running multiple db2 command in the same Unix session
Hi,

I am new to DB2 UDB on Unix. Could you please tell me if we can run multiple
DB2 commands in the same UNIX session simultaneously (It means it should
run at the same time not one after another) ? If yes, then how can we do
this ?

I tried running it, but second db2 command executes when first completes. If I
am doing it through different session then it's not a issue.


Thanks

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

harby ariza

Re: Running multiple db2 command in the same Unix session
(in response to Deepak Goyal)
_______________________________________________________________________________________

Note: This e-mail is subject to the disclaimer contained at the bottom of this message.
_______________________________________________________________________________________



You can do something like:

#!/bin/sh
export DB=$1
db2 connect to $DB

for TB in `db2 -x "select substr(name,1,40) from sysibm.systables where creator = 'CREATOR')"`
do
print "Executing Runstats for CREATOR.$TB "
db2 connect to $DB;db2 "runstats on table AUDITLOG.$TB on key columns and sampled detailed indexes all allow write access"| at now
Done

db2 terminate

I'll execute all the jobs at the same time. You can modify to limit the number of command that you want to execute simultaneously.

I hope it helps.
Harby.

________________________________________
From: DB2 Data Base Discussion List [[login to unmask email] On Behalf Of Deepak Goyal [[login to unmask email]
Sent: Saturday, November 22, 2008 9:21 AM
To: [login to unmask email]
Subject: Running multiple db2 command in the same Unix session

Hi,

I am new to DB2 UDB on Unix. Could you please tell me if we can run multiple
DB2 commands in the same UNIX session simultaneously (It means it should
run at the same time not one after another) ? If yes, then how can we do
this ?

I tried running it, but second db2 command executes when first completes. If I
am doing it through different session then it's not a issue.


Thanks

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

_______________________________________________________________________________________

The information transmitted in this message and its attachments (if any) is intended
only for the person or entity to which it is addressed.
The message may contain confidential and/or privileged material. Any review,
retransmission, dissemination or other use of, or taking of any action in reliance
upon this information, by persons or entities other than the intended recipient is
prohibited.

If you have received this in error, please contact the sender and delete this e-mail
and associated material from any computer.

The intended recipient of this e-mail may only use, reproduce, disclose or distribute
the information contained in this e-mail and any attached files, with the permission
of the sender.

This message has been scanned for viruses with Symantec Scan Engine and cleared by
MailMarshal.
_______________________________________________________________________________________

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

DB2 DBA Jeffrey Benner

Re: Running multiple db2 command in the same Unix session
(in response to harby ariza)
Only LUW commands explicitly designed as asynchronous, such as REORG
INPLACE, will run that way under a single connection state. For your other
commands to run asynchronously, each will need its own connection state.

On Fri, Nov 21, 2008 at 16:21, Deepak Goyal <[login to unmask email]> wrote:

> Hi,
>
> I am new to DB2 UDB on Unix. Could you please tell me if we can run
> multiple
> DB2 commands in the same UNIX session simultaneously (It means it should
> run at the same time not one after another) ? If yes, then how can we do
> this ?
>
> I tried running it, but second db2 command executes when first completes.
> If I
> am doing it through different session then it's not a issue.
>
>
> Thanks
>
> ______________________________________________________________________
>
> * IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
> ______________________________________________________________________
>
>
>
> The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L
> list archives, FAQ, and delivery preferences are at
> http://www.idug.org/lsidug under the Listserv tab. While at the site, you
> can also access the IDUG Online Learning Center, Tech Library and Code
> Place, see the latest IDUG conference information and much more. If you
> have not yet signed up for Basic Membership in IDUG, available at no cost,
> click on Member Services at http://www.idug.org/lsms
>
>

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms

Deepak Goyal

Re: Running multiple db2 command in the same Unix session
(in response to DB2 DBA Jeffrey Benner)
Thanks, This is the one I was looking for !!!

Thanks a lot.

______________________________________________________________________

* IDUG 2009 Denver, CO, USA * May 11-15, 2009 * http://IDUG.ORG/lsNA *
______________________________________________________________________



The IDUG DB2-L Listserv is only part of your membership in IDUG. The DB2-L list archives, FAQ, and delivery preferences are at http://www.idug.org/lsidug under the Listserv tab. While at the site, you can also access the IDUG Online Learning Center, Tech Library and Code Place, see the latest IDUG conference information and much more. If you have not yet signed up for Basic Membership in IDUG, available at no cost, click on Member Services at http://www.idug.org/lsms