Solved

How to query an instance in the database from command editor

Posted on 2013-01-22
8
499 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

744 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

11 Experts available now in Live!

Get 1:1 Help Now