Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database name for DB2 2

Status
Not open for further replies.

JtheRipper

IS-IT--Management
Oct 4, 2002
274
GB
Hi there,

I am an Oracle and SQL Server DBA, and have recently started using DB2 but need some help understanding how it works.

I am trying to set up a connection to our database on an AS400 server from my Windos XP pc using the Configuration assistent.

The node part I get, that is the server name. But then it asks me for a database name, instance name, port and service name. In Oracle I can get most of these (or similar) information from the v$... views. How do I get this information from the DB2 database? I can connect to the DB2 database on the server using the "go qry" command.

ANY help wil be greatly appreciated.

Thanks,
J.
 
try the following commands, on the box where the database is installed :
>db2ilist --this gives the name of the instance
>db2 "list database directory" --this lists all the databases with port numbers and node names
 
Hi,

Thanks for the excellent feedback! I tried the commands on the DB2 database on my pc and it works fine...

However I tried the commands on the AS400's command line, but all I get is "Command DB2ILIST in library *LIBL not found." Surely when DB2 is installed on a server the client tools will be available as well?

Thanks,
J.
 
AS400 may be DB2, but it is still a different story altogether. The structure of DB2 UDB with an instance containing several databases is not comparable.

issue following SQL:

SELECT * FROM QSYS2.LOCATIONS to get list of instances (server systems)

Ties Blom
Information analyst
 
J.

you can issue

select current server from sysibm.sysdummy1

on many versions of db2. This will give you the database name, you're connected to.

Cheers
Greg
 
Depends upon what is running on the AS400. If this is no UDB version, there will not be any sysibm/sysdummy1 I guess...

Ties Blom
Information analyst
 
Ties,

not sure what J is running, however it is possible he's running later versions of DB2 now badged UDB. Not an AS400 man myself, so I'm afraid I can't say further.

Used to do DB2 on OS/390 and it's had the sysdummy1 table for years, must be something they omitted in earlier versions on AS400?

Cheers
Greg




 
Hi guys,

Thanks for all your valuable feedback.. I realise now even more how little I know about the AS400/DB2 environment. I went to IBM's website and downloaded all the relevant documentation, including some redbooks I found on the web so I can start educating myself, but your input helped a lot.

Thanks again,
J.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top