Solved

How to query an instance in the database from command editor

Posted on 2013-01-22
8
500 Views
Last Modified: 2013-01-30
Hi,

   I have created a new instance "DB2INST3" to an existing database, aliased as "SAMPLE" ,from the DB2 configuration assistant.
   Now, i can connect to SAMPLE and see the 5 tables from AIX.
   But when i run "select * from syscat.columns" from DB2 command editor, i see all other tables from the database, but none of the 5 tables (from the Sampe database) are visible.

  Is there a special way of querying an isntance of a database?
  Please advise.
0
Comment
Question by:pvsbandi
  • 4
  • 3
8 Comments
 
LVL 37

Expert Comment

by:momi_sabag
ID: 38805467
Are u trying to access it from windows?
How is the sample database cataloged?
0
 

Author Comment

by:pvsbandi
ID: 38805661
Yes, from windows. So, querying it from Command Editor, by connecting to Sample.
  I don't know what you mean by cataloged. But i cannot access these tables from the command editor. I have attached the screenshot of the Instance Definition.
Instance
0
 
LVL 37

Expert Comment

by:momi_sabag
ID: 38806327
so under TCP options you are suppose to provide the host and port, and DB2 should be able to connect to the correct instance based on those definitions
0
 

Author Comment

by:pvsbandi
ID: 38806390
I did that. But it is identified on the AIX side, not on the Command Editor side.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 37

Expert Comment

by:momi_sabag
ID: 38818762
i don't understand what that means
do you use windows?
go to the configuration assistant and you should have a check connection button there
0
 

Author Comment

by:pvsbandi
ID: 38820771
Let me try again.

     I have configured the connection using Configuration assistant. After that, i logged on to AIX and typed "List tables" under the DB@INST3 schema and got 5 tables back.
    But when i queried through the Command editor, since there is no list tables option here, i tried select * from syscat.tables, i don't see this DB2INST3 schema and those 5 tables also.

 Hope i'm not confusing.
0
 
LVL 1

Accepted Solution

by:
pacwaters earned 500 total points
ID: 38833609
It should be a configuration issue.
Let me give you few troubleshooting steps.

1. Make sure the catalog (configuration connection in Windows) is correct.
    Log on to AIX (server) using the instance db2inst3
   run the following command/script and  look for the port number in the output.
 
 svc=$(db2 get dbm cfg | grep -e"(SVCENAME)" |cut -d"=" -f2)
   cat /etc/services | grep ${svc} 

Open in new window

   
 Also run the command to see the server name
uname -n

Open in new window

 
   Go back to the configuration editor on Windows system and look for the database , verify the port number and server name matches.

If you have trouble checking configuration in Config editor an alternate approach is to commands in db2cmd window
"Open db2cmd window :"Open db2cmd prompt
run the following commands
db2 list db directory
db2 list node directory

Open in new window


and see the entries of SAMPLE as which server / port they refer to

I am sure you will find some errors with configuration and you may be able to correct it .

Hope you find this solution useful.

Good luck!

Pacwaters
0
 

Author Closing Comment

by:pvsbandi
ID: 38835873
Thank You! I got started on getting a hunch on the configuration woes.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now