Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Database Servers
DB2InformixIngresMS SQLOraclePervasive.SQLPostgreSQLProgressSybase
Desktop Databases
FileMakerFoxProMS AccessParadox
General
General DB TopicsDatabase Theory
Related Topics
Java Development.NET DevelopmentVB DevelopmentMore Topics ...

Database Forum / DB2 Topics / July 2006

Tip: Looking for answers? Try searching our database.

Federated Server

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Praveen_db2 - 27 Jul 2006 17:01 GMT
Hi All
DB2 8.1.3,Windows
I have 2 databases in a single instance, say DB_1 and DB_2.I need to query
a table from DB_1 in DB_2.I am try to use a nickname for it.But nickname
creation is not possible until federated server is made.Please tell me how
to create a federated server.Moreover, is there any thing extra which I
need to buy for this?When I gave this command to create a server
CREATE SERVER "TEST1"
 TYPE DB2/UDB
 VERSION 8.1
 WRAPPER DRDA
 AUTHORIZATION "SAM_USER" PASSWORD "SAM_PWD"
OPTIONS
(NODE 'TEST1'
,DBNAME 'TEST1'
  );
It says
SQL0204N  "DRDA" is an undefined name.  SQLSTATE=42704
Do I need to buy something extra for this?
Please advise.

Praveen
Knut Stolze - 27 Jul 2006 19:27 GMT
> Hi All
> DB2 8.1.3,Windows
[quoted text clipped - 16 lines]
> Do I need to buy something extra for this?
> Please advise.

You have to perform the following steps:

(1) Register a wrapper.
   A wrapper is nothing else than a library that implements the glue code
   between the DB2 engine and the remote data source.  In your case, the
   remote data source happens to be the same machine/DB2 instance.
   DB2 comes with wrappers for all DB2 and Informix data sources.  I'll
   have to purchase WebSphere Information Integrator for other systems.
(2) Register a server.
   A server identifies a remote data source.  This is a single database in
   DB2 terminology.  In your case, we're talking about 'DB_1' (or 'TEST1').
(3) Register a user mapping.
   The user connected to the federated server (where you want to create
   the nickname) may not be allowed to access the remote data source.
   Thus, you have to define the credentials that shall be used when
   accessing the data source.  (And those credentials are specific for each
   user connecting the federated server.)
(4) Register a nickname.
   A nickname is just a pointer referring to a table at the remote data
   source.

Here is an example that should work for you, assuming that RMT_DB is the
name of the remote database:

CREATE WRAPPER drda;

CREATE SERVER srv
  TYPE DB2/UDB
  VERSION '8'
  WRAPPER drda
  AUTHORIZATION "stolze" PASSWORD "passwd"
  OPTIONS (DBNAME  'rmt_db');

CREATE USER MAPPING FOR USER SERVER srv
  OPTIONS ( REMOTE_AUTHID 'stolze', REMOTE_PASSWORD 'passwd' );

CREATE NICKNAME n FOR srv.syscat.views;

SELECT * FROM n;

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

Praveen_db2 - 28 Jul 2006 07:24 GMT
Thanx a ton Knut
The Maxx - 28 Jul 2006 16:33 GMT
Plus you should set the FEDERATED database manager parameter to YES.
(May be that was to obvious, but I didn't see it in the previous post.

Regards,
Max Cortez

> > Hi All
> > DB2 8.1.3,Windows
[quoted text clipped - 61 lines]
> DB2 Information Integration Development
> IBM Germany
Knut Stolze - 28 Jul 2006 16:37 GMT
> Plus you should set the FEDERATED database manager parameter to YES.
> (May be that was to obvious, but I didn't see it in the previous post.)

You're right!  I always forget that until I hit the respective error message
the first time. ;-)

Signature

Knut Stolze
DB2 Information Integration Development
IBM Germany

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.