If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Unable to get the db2 command prompt in unix

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-19-08, 01:10
ragavhere ragavhere is offline
Registered User
 
Join Date: Nov 2008
Posts: 3
Red face Unable to get the db2 command prompt in unix

Hi,

When i try to connect to the db2 database from unix solaris 5.8 version by typing "db2" from the .../sqllib/bin/ folder, i am not getting the db2 command prompt. Could anyone help me resolve this? Here the db2 is a executable file only. But still iam not able to execute.
The error i get is

$ db2
ksh: db2: not found

Last edited by ragavhere; 11-19-08 at 01:31.
Reply With Quote
  #2 (permalink)  
Old 11-19-08, 01:44
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
something is wrong with the path
are you a client instance ? check that sqllib/db2profile is getting executed from profile
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #3 (permalink)  
Old 11-26-08, 04:41
ragavhere ragavhere is offline
Registered User
 
Join Date: Nov 2008
Posts: 3
Angry Is the code right?

Yes i am using the client instance. But is the way i am connecting to DB2 right?

if [ $ERROR_CD = 01 ]; then
db2output=`DB2 <<EOD
connect to <DB name> user <username> using <password>
insert into <schema.tablename> (Col1,Col2,Col3,Col4,Col5,Col6) values('Val1','Val2','Val3','Val4','Val5','Val6');
terminate
EOD`
else
exit
fi
Reply With Quote
  #4 (permalink)  
Old 11-26-08, 11:00
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
could you try
in command window
db2 connect to xxx user yyy using zzz
db2 select * from sysibm.sysdummy1
and publish the rc
try also db2level
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #5 (permalink)  
Old 11-27-08, 00:30
ragavhere ragavhere is offline
Registered User
 
Join Date: Nov 2008
Posts: 3
I could try in command window. But this has to be done by a script. That is why i posted that part of the code. Is that code right?
Reply With Quote
  #6 (permalink)  
Old 11-27-08, 06:12
przytula_guy przytula_guy is offline
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 1,159
the first thing todo, is to see if all is working as it should
when you have command line working you can continue with scripts, as in that case you are sure, that it should work.
__________________
Best Regards, Guy Przytula
Database Software Consultant
DB2 UDB LUW Certified V7-V8-V9-V9.7 DB Admin - Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On