473,406 Members | 2,217 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.

DB2 federated architecture

Hello,

I'd like to have early feedback of a new architecture that I'm thinking for our customers that has db2 dbms.

I have many copies of the same db schema around the globe; suppose that each belongs to a particular entity.
Suppose, just for example, that their names are remote_schema1, remote_schema2 and remote_schema3.

I have one central site that, via cooperation, mantains a copy of every remote db (i.e. local_schema1, local_schema2 and +
local_schema3). These are local in the sense that they are inside a LAN, not on the same workstation.

I would like to create a new one, say federated_schema.

Desiderata:A client that connects to federated_schema sees the data of both local_schema1, local_schema2 and local_schema3.I'd like that also updates and deletes can be done agaist local_schemaN (origin of the record). No matter if I can't do inserts.



My first solution uses a serie of nickname, one for each table in local_schemaN:

Expand|Select|Wrap|Line Numbers
  1. CREATE NICKNAME local_federated.tableA_1 FOR remote1.schema1.tableA
  2. CREATE NICKNAME local_federated.tableA_2 FOR remote2.schema2.tableA
  3. CREATE NICKNAME local_federated.tableA_3 FOR remote3.schema3.tableA
  4. ...
  5.  


I could have a problem: it is absolutely possibile that local_schema1.tableA and local_schema2.tableA has a record with the same key. Suppose, for example, that it is a auto-generated number.

So a record with primary key 1000 refers to two different records, one from local_schema1 and one from local_schema2.

I'm thinking to augment the primary key of federated_schema.tableA with an "origin" column.
So if a record belongs to local_schema1.tableA, its key becomes (1000, 'schema1'), if it belongs to local_schema2.tableA, its key becomes (1000, 'schema2') and so on

Here is a code that I'd like to write for this scenario:

Expand|Select|Wrap|Line Numbers
  1. CREATE VIEW my.tableA(k, c1, c2, c3) AS
  2.         SELECT '1', c1, c2, c3 FROM  local_federated.tableA_1
  3.     UNION ALL
  4.         SELECT '2', c1, c2, c3 FROM  local_federated.tableA_2
  5.     UNION ALL
  6.         SELECT '3', c1, c2, c3 FROM  local_federated.tableA_3
  7.  
Unfortunatly, reading the documentation, I can see that "Federated views that are created from more than one nicknamed data source object are read-only views." (see pag. 141 of this doc, for example).
Also the triggers can't be done with such federeted view; isn't it?

Any idea how to go over this limit? (maybe another design of my db could be fine!!)

Thanks for any feedback and useful information you can give to me
Mar 30 '11 #1
0 1292

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Terry | last post by:
Hi All, Im trying to run db2expln over some sql in order to find out why its so slow. I receive the following error message. LINE MESSAGES FOR DYNEXPLN.sqc ------ ...
1
by: RdR | last post by:
Hi, I have a table in SQL Server with no keys, I point this as a federated table in DB2 but in DB2 I have defined keys against this federated table in SQL. Where will the key constraints be...
1
by: Terry | last post by:
Problem: ========= Unknown column appearing in federated tables. Description: ============ Local database (L) is an established 'federated' database, extracting values from multiple remote...
4
by: uthuras | last post by:
Greetings all, Is it possible to have federated db feature implemented among DB2 family? I intend to create federated within DB2 databases. I have 2 databases TestA and TestB. I have some base...
5
by: Alias | last post by:
Hi Guys , I am trying to create a federated database link between 2 UDB 8.1 databases running on AIX on the same box but under different instances. When i tried this thru the control centre , I...
5
by: Klemens | last post by:
I get SQL30090 reason 18 by trying to do an insert in a federated table and an update in a local table in one transaction Do I have to change some settings to get done or ist this not possible by...
2
by: Tim V. | last post by:
Here's the layout: AIX v5.2, DB2 v8 fp8 running in 64bit I've got a Multi-partitioned db running on lpar4 and I want to connect it to 2 instances running on lpar13. We'll deal with just 1...
41
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist...
4
by: Praveen_db2 | last post by:
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...
9
by: mitek | last post by:
Hi, All. Is federated procedures between DB2 databases currently not supported in WebSphere Federation Server 9.1 ??? I recieve next error when trying to create DB2 federated procedure : ...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
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,...
0
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...

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.