db2cmd 
Author Message
 db2cmd
I am trying to run a batch file that will run two db2 commands this is what i
have got at the minute.

db2cmd db2 connect to database1 user 123 using 123 db2 list tablespaces show
detail > clive.out

This produces an error as the database trys to run it as one command. How do i
get the batch file to wait for the first db2comand to complete before the
second one is processed.

Any help would be much appreciated

Clive

--
Posted from  [212.250.177.149]
via Mailgate.ORG Server - http://www.***.com/



Mon, 10 May 2004 22:52:56 GMT
 db2cmd

Hi,

You can place commands into separate file (listbsp.txt) and run:

db2cmd -tf listbsp.txt >> clive.out

Best regards, Dmitry.
www.ispirer.com


Quote:
> I am trying to run a batch file that will run two db2 commands this is
what i
> have got at the minute.

> db2cmd db2 connect to database1 user 123 using 123 db2 list tablespaces
show
> detail > clive.out

> This produces an error as the database trys to run it as one command. How
do i
> get the batch file to wait for the first db2comand to complete before the
> second one is processed.

> Any help would be much appreciated

> Clive

> --
> Posted from  [212.250.177.149]
> via Mailgate.ORG Server - http://www.Mailgate.ORG



Mon, 10 May 2004 23:43:35 GMT
 db2cmd
Dmitry

I have put the commands

db2cmd connect to vis user db2admin using db2admin
db2cmd list tablespaces show detail

into file listbsp.txt

and i run the command:  db2cmd -tf listbsp.txt >> clive.out

although a file clive.out is created it is empty and i get the following error

"The name specified is not recognized as an
internal or external command, operable program or batch file."

Could you help me?

Thanks
Clive


Quote:
> Hi,

> You can place commands into separate file (listbsp.txt) and run:

> db2cmd -tf listbsp.txt >> clive.out

> Best regards, Dmitry.
> www.ispirer.com



> > I am trying to run a batch file that will run two db2 commands this is
> what i
> > have got at the minute.

> > db2cmd db2 connect to database1 user 123 using 123 db2 list tablespaces
> show
> > detail > clive.out

> > This produces an error as the database trys to run it as one command. How
> do i
> > get the batch file to wait for the first db2comand to complete before the
> > second one is processed.

> > Any help would be much appreciated

> > Clive

> > --
> > Posted from  [212.250.177.149]
> > via Mailgate.ORG Server - http://www.Mailgate.ORG

--
Posted from  [212.250.177.149]
via Mailgate.ORG Server - http://www.Mailgate.ORG


Tue, 11 May 2004 00:29:55 GMT
 db2cmd
Hello

I think your problem is the following :
Instead of the db2cmd in your text-file, just use db2,  I'm not really sure
and have no possibility to try it out on my PC at home but I suggest you
give it a shot

db2 connect to vis user db2admin using db2admin
db2 list tablespaces show detail
--> into file listbsp.txt
db2cmd -tf listbsp.txt >> clive.out --> doesn't change

Kind regards

Peter


Quote:
> Dmitry

> I have put the commands

> db2cmd connect to vis user db2admin using db2admin
> db2cmd list tablespaces show detail

> into file listbsp.txt

> and i run the command:  db2cmd -tf listbsp.txt >> clive.out

> although a file clive.out is created it is empty and i get the following
error

> "The name specified is not recognized as an
> internal or external command, operable program or batch file."

> Could you help me?

> Thanks
> Clive



> > Hi,

> > You can place commands into separate file (listbsp.txt) and run:

> > db2cmd -tf listbsp.txt >> clive.out

> > Best regards, Dmitry.
> > www.ispirer.com



> > > I am trying to run a batch file that will run two db2 commands this is
> > what i
> > > have got at the minute.

> > > db2cmd db2 connect to database1 user 123 using 123 db2 list
tablespaces
> > show
> > > detail > clive.out

> > > This produces an error as the database trys to run it as one command.
How
> > do i
> > > get the batch file to wait for the first db2comand to complete before
the
> > > second one is processed.

> > > Any help would be much appreciated

> > > Clive

> > > --
> > > Posted from  [212.250.177.149]
> > > via Mailgate.ORG Server - http://www.Mailgate.ORG

> --
> Posted from  [212.250.177.149]
> via Mailgate.ORG Server - http://www.Mailgate.ORG



Tue, 11 May 2004 02:01:10 GMT
 db2cmd
In  a file called something.cmd
Started from a Db2  command window.

<snip>
FOR /D %%I IN (%BASEWRK%\%3\%4\DSEC) DO DB2 CONNECT TO %%~nI USER %1 USING
%2&&DB2 LIST ACTIVE DATABASES
<snip>
FOR /D %%I IN (%BASEWRK%\%3\%4\*.*) DO START /min DB2 CONNECT TO %%~nI USER
%1 USING %2&&DB2CLP SCHEMA.CMD %1 %2 %3 %4 %%~nI
<snip>

See  the  &&
You can  use this  on  NT

This  is one trick i sometimes use.
Add stuff (Terminate, etc), Remove unneeded stuff, etc.

PM



Mon, 10 May 2004 20:38:13 GMT
 db2cmd
   Don't confuse the "db2cmd" command with the "db2" command.

   "db2cmd" opens up a CLP-ized window or shell.  That's all it does.  In your
case, you are telling Windows to open a CLP shell and execute a command called
"connect".  There is no such native command.  The command should be "db2", and the
parms to that command are "connect to ...".

   Any CLP commands you want DB2 to execute need to be run through the "db2"
command.

   Put in your file the following 4 lines:

connect to vis user db2admin using db2admin;
list tablespaces show detail;
connect reset;
terminate;

   Then if you don't already have one open, open a CLP window by entering
"db2cmd", and in that window, process the file with "db2 -tvf listbsp.txt >>
clive.out"

Quote:

> Dmitry

> I have put the commands

> db2cmd connect to vis user db2admin using db2admin
> db2cmd list tablespaces show detail

> into file listbsp.txt

> and i run the command:  db2cmd -tf listbsp.txt >> clive.out

> although a file clive.out is created it is empty and i get the following error

> "The name specified is not recognized as an
> internal or external command, operable program or batch file."

> Could you help me?

> Thanks
> Clive



> > Hi,

> > You can place commands into separate file (listbsp.txt) and run:

> > db2cmd -tf listbsp.txt >> clive.out

> > Best regards, Dmitry.
> > www.ispirer.com



> > > I am trying to run a batch file that will run two db2 commands this is
> > what i
> > > have got at the minute.

> > > db2cmd db2 connect to database1 user 123 using 123 db2 list tablespaces
> > show
> > > detail > clive.out

> > > This produces an error as the database trys to run it as one command. How
> > do i
> > > get the batch file to wait for the first db2comand to complete before the
> > > second one is processed.

> > > Any help would be much appreciated

> > > Clive

> > > --
> > > Posted from  [212.250.177.149]
> > > via Mailgate.ORG Server - http://www.Mailgate.ORG

> --
> Posted from  [212.250.177.149]
> via Mailgate.ORG Server - http://www.Mailgate.ORG

--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of all things Natural


Tue, 11 May 2004 06:54:09 GMT
 db2cmd
Clive,

Don't place db2cmd, db2 in the text file. There should be only commands
connect, list tablespaces.

Best regards, Dmitry.
www.ispirer.com


Quote:
> Dmitry

> I have put the commands

> db2cmd connect to vis user db2admin using db2admin
> db2cmd list tablespaces show detail

> into file listbsp.txt

> and i run the command:  db2cmd -tf listbsp.txt >> clive.out

> although a file clive.out is created it is empty and i get the following
error

> "The name specified is not recognized as an
> internal or external command, operable program or batch file."

> Could you help me?

> Thanks
> Clive



> > Hi,

> > You can place commands into separate file (listbsp.txt) and run:

> > db2cmd -tf listbsp.txt >> clive.out

> > Best regards, Dmitry.
> > www.ispirer.com



> > > I am trying to run a batch file that will run two db2 commands this is
> > what i
> > > have got at the minute.

> > > db2cmd db2 connect to database1 user 123 using 123 db2 list
tablespaces
> > show
> > > detail > clive.out

> > > This produces an error as the database trys to run it as one command.
How
> > do i
> > > get the batch file to wait for the first db2comand to complete before
the
> > > second one is processed.

> > > Any help would be much appreciated

> > > Clive

> > > --
> > > Posted from  [212.250.177.149]
> > > via Mailgate.ORG Server - http://www.Mailgate.ORG

> --
> Posted from  [212.250.177.149]
> via Mailgate.ORG Server - http://www.Mailgate.ORG



Tue, 11 May 2004 17:45:54 GMT
 db2cmd
   Clive, see my reply (to you) in another thread just yesterday.

Quote:

> I am trying to run a batch file that will run two db2 commands this is what i
> have got at the minute.

> db2cmd db2 connect to database1 user 123 using 123 db2 list tablespaces show
> detail > clive.out

> This produces an error as the database trys to run it as one command. How do i
> get the batch file to wait for the first db2comand to complete before the
> second one is processed.

> Any help would be much appreciated

> Clive

> --
> Posted from  [212.250.177.149]
> via Mailgate.ORG Server - http://www.Mailgate.ORG

--
Larry Menard
IBM Workstation Database (DB2) Performance Team
Defender of Geese and of all things Natural


Tue, 11 May 2004 20:30:23 GMT
 
 [ 8 post ] 

 Relevant Pages 

1. db2cmd in windows, in linux ???

2. db2cmd question

3. encrypt password using db2cmd on client side

4. DB2CMD from NT batch script

5. How to run the DB2 commands without using the db2cmd.exe on WinNT ?

6. DB2CMD.EXE - why can't I just run a CMD file on NT which uses DB2.EXE?

7. way to determine location of bin (i.e. DB2CMD.EXE) files folder DB2 7.2 on Win 2K & UNIX


 
Powered by phpBB® Forum Software