The queries in Example 5 11 shows how it works
Example 5 11 Multiple database example
mysql>create database itsodb_1;
mysql>create database itsodb_2;
mysql>connect itsodb_1;
mysql>create table itso1(col1 int, col2 char(10));
mysql>insert into itso1 values(1, itso );
mysql>connect itsodb_2;
mysql>create table itso2(col1 int, col2 char(10));
mysql>insert into itso2 values(1, itso1 );
mysql>select * from itso2,itsodb_1.itso1;
This works in MySQL and give result
+ + + + +
| col1 | col2 | col1 | col2 |
+ + + + +
| 1 | itso1 | 1 | itso |
| 1 | itso1 | 2 | itso |
+ + + + +
Figure 5 5 shows the architecture of multiple MySQL databases accessed by
single application using same connection.
My
My
SQL
SQL
S
S
e
e
r
r
ver
ver
Access Tables
using
Qualified Name
Application1
Connection 1
MySQL
MySQL
Database1
Database2
Figure 5 5 MySQL Application with multiple DBs instead of multiple schemas
DB2 UDB supports multiple database access with database links in a federated
system. For a none federated system, DB2 UDB application uses more logical
technique by using multiple schemas in place of multiple database used in same
application. Each database can have multiple schemas and each table belongs
to a particular schema.
When migrating the MySQL applications using multiple databases, all the
databases used in the applications can be placed under one DB2 UDB database.
Chapter 5. Database porting
109
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved