473,890 Members | 1,354 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to use sql to query from different database

hi, we use db2 udb v8.1 on windows, i am trying to use federated
database objects to create wrapper, even though i have update dbm cfg
using federated yes, i still get error "the instance for the db is not
enable for the specified action", do i miss sth else?
Nov 12 '05
20 17653
when i create the server, on the server tab, i create a name for
remote server , then select type, version, for the user id and
password, i use the local server one, on the settings tab, i input
dbname for remote server's database name, password is Y, which is
default, since i have a same database exist on the local server, so
how am i going to differente i want the database from remote server to
map , not the local database from local server?
Nov 12 '05 #11
aka
you created the server so it has a name. with that name you can "create
nickname" referencing remote object. or you can use "set passthru" with
server name to switch context to remote objects.

see for the syntax of the commands in the manuals.

good luck
aka.
"xixi" schrieb im Newsbeitrag
news:c0******** *************** ***@posting.goo gle.com...
when i create the server, on the server tab, i create a name for
remote server , then select type, version, for the user id and
password, i use the local server one, on the settings tab, i input
dbname for remote server's database name, password is Y, which is
default, since i have a same database exist on the local server, so
how am i going to differente i want the database from remote server to
map , not the local database from local server?

Nov 12 '05 #12
i still confusing what should i do to map with a remote database,
first i am on local server, with current database , under control
center federated database objects, i create a wrapper, i have one
server created under it already, can i create another one under the
same wrapper? the one i created is map with local different database
on the same server. so i create another server, put dbname is the
remote database name (which is the same database name as local
database i haved mapped to the current one, only it exists on remote
server), then create user mapping, put remote_authid and password as
the remote server password and id, then create nickname, i want to map
with remote server remote database sysibm.systable s, but it gives me
the error IBM][CLI Driver][DB2/NT] SQL1822N Unexpected error code
"-30082" received from data source "REMOTEGN". Associated text and
tokens are "func="DriverCo nnect" msg=" SQL30082N Attempt to estab".
SQLSTATE=560BD, i still don't know at which step it asks me for the
remote server ip address or something else, i have a same database
exist on the local server successfully mapped to , so i want to map to
remote database on remote server.
Nov 12 '05 #13
aka
"xixi" schrieb im Newsbeitrag
news:c0******** *************** ***@posting.goo gle.com...
i still confusing what should i do to map with a remote database,
first i am on local server, with current database , under control
center federated database objects, i create a wrapper, i have one
server created under it already, can i create another one under the
same wrapper? the one i created is map with local different database
on the same server. so i create another server, put dbname is the
remote database name (which is the same database name as local
database i haved mapped to the current one, only it exists on remote
server), then create user mapping, put remote_authid and password as
the remote server password and id, then create nickname, i want to map
with remote server remote database sysibm.systable s, but it gives me
the error IBM][CLI Driver][DB2/NT] SQL1822N Unexpected error code
"-30082" received from data source "REMOTEGN". Associated text and
tokens are "func="DriverCo nnect" msg=" SQL30082N Attempt to estab".
SQLSTATE=560BD, i still don't know at which step it asks me for the
remote server ip address or something else, i have a same database
exist on the local server successfully mapped to , so i want to map to
remote database on remote server.


since I'm not familiar with this hazardous gui I can explain the steps you
would take on the command line in a db2 cmd window. in this cmd window you
have a db2 environment which is determined by the environment variable
DB2INSTANCE. by default this would be named DB2. in this instance you
created a local db let's call it X. so you can connect to db X. next you
need to a catalog a node, pointing to the remote machine R. this could be
done with "catalog tcpip node R remote R server 50000" (or whatever the port
number on the remote server for the instance in which the db that you want
to access resides is). let's assume the name of the db on the remote server
is also X. so next you would catalog the remote db in your current
environment. since you already have a local db called X you must choose
another name to refer to remote db X. you can issue a command like "catalog
db X as Y at node R". now you can "connect to Y user xixi using ...". gues
what? you are connected to db X residing at server R.
so you already created a wrapper, one is ok per DB2 family or so. next
create another server which uses the protocol defined with the wrapper.
first connect to your local db X again, because this is the db from "inside"
which you will access objects from the remote db.

db2 connect to X
db2 create server S type DB2/NT version 8.1.5 wrapper DRDA authorization
"xixi" password "..." options (node 'R', dbname 'Y')
db2 create user mapping for xixi server S options (remote_authid 'xixi',
remote_password '...')

the last one ensures your authentication at the remote server whe using
federated objects. now you can "select * from sysibm.systable s" and you
should see your local db X. use the statement "set passthru S" and then
"select * from sysibm.systable s" and you get the catalog from remote db X.
"set passthru reset" works as expected. to create the nickname(s) should be
straightforward (?)

good luck
aka
Nov 12 '05 #14
hi, i have three db2 server running on three machine, one is my local
(a) , the other two is on differet server (node b and node c), i have
cataloged b and c database to my local a. b and c has same database
sets x, y, so i try to create a wrapper on b machine's x database,
create a server , which points to b machine database Y, then create
user mapping and nicknames successfully. then i try to do the same
thing from b machine x database to c machine y database (which has
alias name GN), so i still use the wrapper i created, try to do create
server command as you instructed, but gives me error SQL0204N "DRDA"
is an undefined name. SQLSTATE=42704

then i change to this

D:\Program Files\IBM\SQLLI B\BIN>db2 create server S type DB2/UDB
version 8.1 wra
pper "NJIPD" authid "admin" password "diamond" options (node
'WEBDEMO', dbname '
GN')

the authid is remote server c's authid and password, node 'WEBDEMO" is
the remote server c 's node name i cataloged on my local machine a ,
but gives me error SQL1013N The database alias name or database name
"GN" could not be found. SQLSTATE=42705

please help.
Nov 12 '05 #15
hi, i have three db2 server running on three machine, one is my local
(a) , the other two is on differet server (node b and node c), i have
cataloged b and c database to my local a. b and c has same database
sets x, y, so i try to create a wrapper on b machine's x database,
create a server , which points to b machine database Y, then create
user mapping and nicknames successfully. then i try to do the same
thing from b machine x database to c machine y database (which has
alias name GN), so i still use the wrapper i created, try to do create
server command as you instructed, but gives me error SQL0204N "DRDA"
is an undefined name. SQLSTATE=42704

then i change to this

D:\Program Files\IBM\SQLLI B\BIN>db2 create server S type DB2/UDB
version 8.1 wra
pper "NJIPD" authid "admin" password "diamond" options (node
'WEBDEMO', dbname '
GN')

the authid is remote server c's authid and password, node 'WEBDEMO" is
the remote server c 's node name i cataloged on my local machine a ,
but gives me error SQL1013N The database alias name or database name
"GN" could not be found. SQLSTATE=42705

please help.
Nov 12 '05 #16
hi, i have three db2 server running on three machine, one is my local
(a) , the other two is on differet server (node b and node c), i have
cataloged b and c database to my local a. b and c has same database
sets x, y, so i try to create a wrapper on b machine's x database,
create a server , which points to b machine database Y, then create
user mapping and nicknames successfully. then i try to do the same
thing from b machine x database to c machine y database (which has
alias name GN), so i still use the wrapper i created, try to do create
server command as you instructed, but gives me error SQL0204N "DRDA"
is an undefined name. SQLSTATE=42704

then i change to this

D:\Program Files\IBM\SQLLI B\BIN>db2 create server S type DB2/UDB
version 8.1 wra
pper "NJIPD" authid "admin" password "diamond" options (node
'WEBDEMO', dbname '
GN')

the authid is remote server c's authid and password, node 'WEBDEMO" is
the remote server c 's node name i cataloged on my local machine a ,
but gives me error SQL1013N The database alias name or database name
"GN" could not be found. SQLSTATE=42705

please help.
Nov 12 '05 #17
hi, i have three db2 server running on three machine, one is my local
(a) , the other two is on differet server (node b and node c), i have
cataloged b and c database to my local a. b and c has same database
sets x, y, so i try to create a wrapper on b machine's x database,
create a server , which points to b machine database Y, then create
user mapping and nicknames successfully. then i try to do the same
thing from b machine x database to c machine y database (which has
alias name GN), so i still use the wrapper i created, try to do create
server command as you instructed, but gives me error SQL0204N "DRDA"
is an undefined name. SQLSTATE=42704

then i change to this

D:\Program Files\IBM\SQLLI B\BIN>db2 create server S type DB2/UDB
version 8.1 wra
pper "NJIPD" authid "admin" password "diamond" options (node
'WEBDEMO', dbname '
GN')

the authid is remote server c's authid and password, node 'WEBDEMO" is
the remote server c 's node name i cataloged on my local machine a ,
but gives me error SQL1013N The database alias name or database name
"GN" could not be found. SQLSTATE=42705

please help.
Nov 12 '05 #18
aka

"xixi" schrieb im Newsbeitrag
news:c0******** *************** ***@posting.goo gle.com...
hi, i have three db2 server running on three machine, one is my local
(a) , the other two is on differet server (node b and node c), i have
cataloged b and c database to my local a. b and c has same database
sets x, y, so i try to create a wrapper on b machine's x database,
create a server , which points to b machine database Y, then create
user mapping and nicknames successfully. then i try to do the same
thing from b machine x database to c machine y database (which has
alias name GN), so i still use the wrapper i created, try to do create
server command as you instructed, but gives me error SQL0204N "DRDA"
ok, DRDA was just an example, you did just right when changing this to the
name of the wrapper that you created
is an undefined name. SQLSTATE=42704

then i change to this

D:\Program Files\IBM\SQLLI B\BIN>db2 create server S type DB2/UDB
version 8.1 wra
pper "NJIPD" authid "admin" password "diamond" options (node
'WEBDEMO', dbname '
GN')

the authid is remote server c's authid and password, node 'WEBDEMO" is
the remote server c 's node name i cataloged on my local machine a ,
but gives me error SQL1013N The database alias name or database name
"GN" could not be found. SQLSTATE=42705

please help.


as I understand you are now dealing with 3 nodes :) I'm also quite happy
that you obviously made your wrapper and server and nicknames on machine (a)
successfully, right?
what I stated about the number of wrappers you should create was not very
accurate. you have to create one wrapper on each database in which you will
create servers. as long as you have only db2 family databases to access only
the wrapper of type drda is needed.
now, with 3 node environment you potentiate your possibilities of mixing and
matching. I see no problem in creating another server on your machine (a)
wich wraps a database on machine (c), since this would be analog to what you
already have done with a database on machine (b). so in my example you
change S to S2, R to R2 and Y to Y2 and of course the correct name of your
wrapper. should work the same as with machine (b).
another possibility would be to create a wrapper, server, user mapping and
nicknames from machine (b) to machine (c). you could achieve this easy by
running the same steps as before in a db2 cmd window on machine (b). catalog
machine (c) and the remote database, this time with db2 instance on machine
(b) acting as client against (c).
as an excercise to you I let you figure out by yourself how to create a
wrapper on machine (a) that accesses an object on machine (b) which in turn
is only another wrapper of an object from machine (c)...

cheers
aka
Nov 12 '05 #19
ok, i have my local machine a and catalog remote server b, and c on
it, then i successfully create a server, user mapping and nickname
from database x on b (which i worked on my machine with database Y on
b machines(in order to select from different database at the same
time), now i try to compare two different database exist on different
machine (database X on machine b and database Y on machine c), so i
create a new wrapper under database x on b, try to create server ,
user mapping on database Y on c machine, when i say create server
command, with the new wrapper name i created, what authid and password
i should put, is remote server c's or remote server b's?, and for the
dbname, is remote server c's database Y name or alias name i cataloged
under my machine a?

"aka" <ak*@aka-soft.de> wrote in message news:<ca******* ***@online.de>. ..
"xixi" schrieb im Newsbeitrag
news:c0******** *************** ***@posting.goo gle.com...
hi, i have three db2 server running on three machine, one is my local
(a) , the other two is on differet server (node b and node c), i have
cataloged b and c database to my local a. b and c has same database
sets x, y, so i try to create a wrapper on b machine's x database,
create a server , which points to b machine database Y, then create
user mapping and nicknames successfully. then i try to do the same
thing from b machine x database to c machine y database (which has
alias name GN), so i still use the wrapper i created, try to do create
server command as you instructed, but gives me error SQL0204N "DRDA"


ok, DRDA was just an example, you did just right when changing this to the
name of the wrapper that you created
is an undefined name. SQLSTATE=42704

then i change to this

D:\Program Files\IBM\SQLLI B\BIN>db2 create server S type DB2/UDB
version 8.1 wra
pper "NJIPD" authid "admin" password "diamond" options (node
'WEBDEMO', dbname '
GN')

the authid is remote server c's authid and password, node 'WEBDEMO" is
the remote server c 's node name i cataloged on my local machine a ,
but gives me error SQL1013N The database alias name or database name
"GN" could not be found. SQLSTATE=42705

please help.


as I understand you are now dealing with 3 nodes :) I'm also quite happy
that you obviously made your wrapper and server and nicknames on machine (a)
successfully, right?
what I stated about the number of wrappers you should create was not very
accurate. you have to create one wrapper on each database in which you will
create servers. as long as you have only db2 family databases to access only
the wrapper of type drda is needed.
now, with 3 node environment you potentiate your possibilities of mixing and
matching. I see no problem in creating another server on your machine (a)
wich wraps a database on machine (c), since this would be analog to what you
already have done with a database on machine (b). so in my example you
change S to S2, R to R2 and Y to Y2 and of course the correct name of your
wrapper. should work the same as with machine (b).
another possibility would be to create a wrapper, server, user mapping and
nicknames from machine (b) to machine (c). you could achieve this easy by
running the same steps as before in a db2 cmd window on machine (b). catalog
machine (c) and the remote database, this time with db2 instance on machine
(b) acting as client against (c).
as an excercise to you I let you figure out by yourself how to create a
wrapper on machine (a) that accesses an object on machine (b) which in turn
is only another wrapper of an object from machine (c)...

cheers
aka

Nov 12 '05 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
2751
by: Wescotte | last post by:
Here is a small sample program I wrote in PHP (running off Apache 1.3.31 w/ PHP 5.0.1) to help illustrates problem I'm having. The data base is using DB2 V5R3M0. The client is WinXP machine using the iSeries Client Access Driver ver 10.00.04.00 to connect to the database. The problem is that executing the exact same SQL select statement more than twice int a row stops produces results. The first two instances will always produce the...
6
561
by: Umar Farooq | last post by:
Hello all, Please bear with the long explanation of my scenario. As I'm relatively new to the query world, I like to write my queries using the visual toos such as the "View" option in SQL Server or in MS Access. If I have a complicated query with sub-queries, I create a query (view1) as (for example): select ID,count(ID) as NumberOfUsers from tblContact
6
1940
by: Steven D.Arnold | last post by:
I have a query which does not use column indexes that it should use. I have discovered some interesting behaviors of Postgres which may indicate a bug in the database's query planning. Take a look at the query below. There is a btree index on both m.account_id and a.account_id. Query (1) does not use the index on the messages table, instead opting for a full table scan, thus killing performance. The messages table can contain...
1
3913
by: Geir Baardsen | last post by:
Hi! I might have a difficult cuestion. In our database we have registered different tyres with different dimensions from different suppliers that is both for summer and winter season. Now I have simplified the database by having a tblCategory, so that I can run queries with this condition. So all tyres that are for summerseason, will be in the category: Tyres/su-Pirelli and tyres for
10
15399
by: Marizel | last post by:
I'm not sure there's an easy solution to this, but thought I'd ask. I often find myself with a query which I'd like to reuse, but with a different datasource. These datasources generally have identical field names. The queries select a subset of the fields, so "Select *" is not really an option. Is there an easy way to change the source of a query, either in the design grid or SQL display? I suppose I could copy the SQL into WordPad...
7
1440
by: Ismail Rajput | last post by:
How to create SQL Sub-Query in ASP.NET , if the sub query retrieves records from another database ? For Example i have a Database A table A in one database B and a table B. I want to receive some records from Database B table B and save into Database A table A
3
1970
by: cover | last post by:
I have a table with 50 fields that receive input depending on whether that input came in from a 'shaker' form or a 'conveyor' form. Input from the 'conveyor' form might populate 25 fields while input from the 'shaker' form will populate another 20-25 fields but not the same fields (however there are about 10 common fields to both). I'd thought about using two tables (one for 'conveyor' and the other for 'shaker') but thought I'd try just...
7
2740
by: Daz | last post by:
Hi. I am trying to select data from two separate MySQL tables, where I cannot use join, but when I put the two select queries into a single query, I get an error telling me to check my syntax. Both of the queries work fine when I use them to query the MySQL server directly. My guess is that the MySQL extension only expects a single resource back from the database, but get's several, or that it just checks the statement first, and decides...
2
4535
by: Bob Alston | last post by:
If you have an access form with record source being a straightforward query and where clause in the form definition, will the query be sent to the back end jet/Access database and executed there, withonly the record(s) meeting the criteria being returned to the front end? Is JetShowPlan a good tool to see that this is working? Bob
6
6885
by: Phil Stanton | last post by:
I am running a query that calls a function used to format addresses depending on the width of a control on a report that shows that address. The same query is used as the RecordSource of lots of similar reports, but all with different sized Address text boxes. For the function to work, the report need to be open in design view, so that the Text Box Width can be "measured". The function is obviously called for each line of the query (about...
0
9829
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10836
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10926
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9643
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8018
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5856
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6064
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4278
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.