Solved

How to query an instance in the database from command editor

Posted on 2013-01-22
8
504 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
How our DevOps Teams Maximize Uptime

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

 

Author Comment

by:pvsbandi
ID: 38806390
I did that. But it is identified on the AIX side, not on the Command Editor side.
0
 
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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
DB2 tablespace disk full error 33 1,247
DB2 SQL causing overflow error 36 95
SELECT * FROM [Stored Procedure] 6 105
Selecting rows in WHERE clause vs JOIN 4 47
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…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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