473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

remote access on the same instance

Id like to connect to a table in a different database in the same instance.

Create database db1
Create database db2

Connect to db1....

Create table test1 (
Name varchar(10),
age INT)

connect to db2...

Create table test2 (
Name varchar(10),
age INT)
While connected to db2 how do I uses table test1?

Thanks
Nov 12 '05 #1
3 4774
Terry wrote:
Id like to connect to a table in a different database in the same
instance.

Create database db1
Create database db2

Connect to db1....

Create table test1 (
Name varchar(10),
age INT)

connect to db2...

Create table test2 (
Name varchar(10),
age INT)
While connected to db2 how do I uses table test1?


Use the federated facilities and create a nickname in db2 that refers to
table test1.

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #2
Im not having a great deal of luck with that. I have...

Inst1.db1.test1

Inst1.db2

Inst2.db2

If Im connected to Inst2.db2 and try a federated connection to
Inst1.db1

catalog tcpip node <node> remote <server> server <service>
catalog database db1 as db1 at node <node>
create wrapper DRDA
create server <server> type DB2/EEE version 7.1 wrapper DRDA
authorization <inst1 user> password <inst1 pwd> options(add node
<node> , add dbname 'db1')
create user mapping for <inst2 user> server <server> options
(remote_authid <inst1 user>, remote_password <inst1 pwd>)
create nickname db1.test1 for <server>.db1.test1

This works fine.

If I try the same thing from inst1.db2 it fails.

catalog tcpip node <node> remote <server> server <service>
catalog database db1 as db1 at node <node>
create wrapper DRDA
create server <server> type DB2/EEE version 7.1 wrapper DRDA
authorization <inst1 user> password <inst1 pwd> options(add node
<node> , add dbname 'db1')
create user mapping for <inst1 user> server <server> options
(remote_authid <inst1 user>, remote_password <inst1 pwd>)
create nickname db1.test for <server>.db1.test1

SQL1101N Remote database <db1> on node <node> could not be accessed
with the specified authorization id and password.

Im confused as the usr/pwd was correct when connecting from a
different instance. Any thoughts

Thanks

Terry
Knut Stolze <st****@de.ibm.com> wrote in message news:<ch**********@fsuj29.rz.uni-jena.de>...
Terry wrote:
Id like to connect to a table in a different database in the same
instance.

Create database db1
Create database db2

Connect to db1....

Create table test1 (
Name varchar(10),
age INT)

connect to db2...

Create table test2 (
Name varchar(10),
age INT)
While connected to db2 how do I uses table test1?


Use the federated facilities and create a nickname in db2 that refers to
table test1.

Nov 12 '05 #3
Terry wrote:
Im not having a great deal of luck with that. I have...

Inst1.db1.test1

Inst1.db2

Inst2.db2

If Im connected to Inst2.db2 and try a federated connection to
Inst1.db1

catalog tcpip node <node> remote <server> server <service>
catalog database db1 as db1 at node <node>
You don't need these two steps. You already specify the necessary
information in the CREATE SERVER statement below. Just use the name of the
instance as "node" for the server options.
create wrapper DRDA
create server <server> type DB2/EEE version 7.1 wrapper DRDA
authorization <inst1 user> password <inst1 pwd> options(add node
<node> , add dbname 'db1')
create user mapping for <inst2 user> server <server> options
(remote_authid <inst1 user>, remote_password <inst1 pwd>)
create nickname db1.test1 for <server>.db1.test1

This works fine.

If I try the same thing from inst1.db2 it fails.

catalog tcpip node <node> remote <server> server <service>
catalog database db1 as db1 at node <node>
Again, you don't need the above two lines.
create wrapper DRDA
create server <server> type DB2/EEE version 7.1 wrapper DRDA
authorization <inst1 user> password <inst1 pwd> options(add node
<node> , add dbname 'db1')
create user mapping for <inst1 user> server <server> options
(remote_authid <inst1 user>, remote_password <inst1 pwd>)
create nickname db1.test for <server>.db1.test1

SQL1101N Remote database <db1> on node <node> could not be accessed
with the specified authorization id and password.

Im confused as the usr/pwd was correct when connecting from a
different instance. Any thoughts


I'd guess that you have a problem with the node/db/instance entries that you
used. Without knowing the exact values and user names, I have no idea why
it failed, though.

Here is what works quite well for me all the time:

--------------------------------------------------------------------
CREATE WRAPPER drda OPTIONS(db2_fenced 'Y');
CREATE SERVER db2 TYPE db2/aix VERSION 8 WRAPPER drda
AUTHORIZATION "<user>" PASSWORD "<password>"
OPTIONS (node 'db2inst1', dbname 'remote');
CREATE USER MAPPING FOR user SERVER db2
OPTIONS (remote_authid '<user>', remote_password '<password>');
--------------------------------------------------------------------

--
Knut Stolze
Information Integration
IBM Germany / University of Jena
Nov 12 '05 #4

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

Similar topics

1
by: Raquel | last post by:
I read in the manual: "Instances are cataloged as either local or remote in the node directory." How is this done? How is the correspondence between nodes and instances defined? There is a...
3
by: Gerhard Swart | last post by:
Hi all. I'm writing a queue browser that reads queues from a specified machine and then display the data that's on the queue. I am using the MessageQueue Class in .Net(C#). I get the problem...
4
by: Heliotic | last post by:
Hi everyone, Currently I am working on an application that will perform a remote scan of a specified server using the following code: Type t = Type.GetTypeFromProgID(...
2
by: Julia | last post by:
Hi, Can a Remote object be a WebService as well? i want to able to connect to a remote object either using .NET remoting and HTTP\SOAP so I wonder if I can create a singleton(statefull)...
3
by: Pakna | last post by:
Hello, I have what may be a beginner's question regarding DB2. How does one access a remote table on a remote database via SQL? What is the command string, is there an equivalent of Oracle...
10
by: cleo | last post by:
I am migrating from VB6/Access to Visual Basic and SQL Express. I have success writing test code on my local machine and am now setting up tests for deployment to a server. I have installed SQL...
1
by: Chris | last post by:
hi I have big problem. I am writing a small win application. It will work on remote MS SQL database (2005). Firstly, I need to log on to the server. The server supports remote connections and sql...
8
by: John | last post by:
Hi We had an sbs 2003 with isa 2000 server. We wre able to access a remote sql server (hosted at our web host) just fine. We replaced the server with a new sbs 2003 r2 with isa 2004 server and...
5
by: =?Utf-8?B?QWRyaWFuTW9ycmlz?= | last post by:
Hello! I'm trying to copy a file from another computer on the network that I do not have permission with my current logon details to access. If I open the folder using the Windows file manager...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.