Professional Documents
Culture Documents
Openedge SQL in A 10.1B Multi-Database Environment For Odbc and JDBC
Openedge SQL in A 10.1B Multi-Database Environment For Odbc and JDBC
1B multi-database
environment for ODBC and JDBC
Doug Merrett
Senior Solution Engineer – EMEA
Progress Software
Objectives
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Agenda
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Multi-Database Query – Done on Client
Allow the ability to join tables in multiple databases (cross database join)
Join: customers from DB, Orders from SecondDB, Inventory from ThirdDB
Customers
Orders Inventory
DB Second Third
DB DB
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
10.1B Multi-Database Query – Done on Server
Host
Second
Shmem DB
DB
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Terminology
Table (Customer)
- collection of columns
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Multi-Database Query – Scope
Mysports AuxCat1
Inventory
Customer
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
3 part naming – single database connection
Three level naming (already have this)
Example
SELECT Pub.Customer.CustNum,
Pub.Customer.Name,
Pub.Order.OrderNum ...
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
4 part naming – multi-database query
Four level naming
Example
SELECT Pub.Customer.CustNum,
SportsPrimary.Pub.Customer.Name,
SportsAux1.Pub.Order.OrderNum ...
OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Crystal Reports – cross database join
Catalog
SELECT "Customer1"."CustNum",
"Customer1"."Name", "Order1"."OrderDate",
"Order1"."Ordernum", "OrderLine1"."Itemnum",
"OrderLine1"."Qty", "OrderLine1"."OrderLineStatus"
FROM ("AuxCat2"."PUB"."OrderLine" "OrderLine1"
INNER JOIN "AuxCat1"."PUB"."Order" "Order1" ON
"OrderLine1"."Ordernum"="Order1"."Ordernum")
INNER JOIN "SPORTS2000"."PUB"."Customer"
"Customer1" ON
"Order1"."CustNum"="Customer1"."CustNum"
ORDER BY "Customer1"."CustNum"
0 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Single Database
Simple query
Host
DB
1 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Multi-Database Support
Define primary and auxiliary database
Host
Shmem Second
DB
Shmem OpenEdge SQL
Server
Shmem Third
DB
DB
Read
Primary Only Auxiliaries
2 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Agenda
3 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Multi-database connections
Two methods:
4 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Connecting to an Auxiliary Database
Disconnecting a catalog
DISCONNECT CATALOG mysports;
5 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Auxiliary Database Details
Syntax
6 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Say What ?!?!
dbname[-mdbq:config]
Host
Shmem Second
DB
Shmem
OpenEdge SQL
Server
Shmem Third
DB
Properties
DB [config] Read
Primary Only Auxiliaries
8 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Automatic connections
9 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Property file example
sports2000.oesql.properties configuration
[sql-configuration] name
configuration-names-list=config1
[configuration.config1]
database-id-list=Aux1, Aux2
[database.Aux1]
Name=SportsAux1 Full path to database
Catalog=AuxCat1
Location=c:\openedge\WRK\db\SportsAux1
[database.Aux2]
Name=SportsAux2
Catalog=AuxCat2
Location=c:\openedge\WRK\db\SportsAux2
0 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Multi-Database : automatic connections
dbname[-mdbq:config1]
Host
Shmem Second
DB
Shmem OpenEdge SQL
Server
Shmem Third
DB
Properties
DB [config1] Read
Primary Only Auxiliaries
1 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Single DB connection : JDBC – DBNavigator
jdbc:datadirect:openedge://localhost:6748;databaseName=sports2000
2 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Multi DB connection : JDBC – DBNavigator
jdbc:datadirect:openedge://localhost:6748;databaseName=sports2000 [-mdbq:config1]
3 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
DBNavigator – MDBQ configuration
Auxiliary
databases
Primary
database
4 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
ODBC – Single DB configuration
5 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
ODBC – Multi DB configuration
6 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Crystal – looks like this with MDBQ
Auxiliary databases
Primary database
7 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Every good engineering project has acronyms
(EGEPHA)
8 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Under the covers - acronyms
Auxiliary connections
SQFA (SQL Federated Agent)
• Main OpenEdge SQL connection to the
Auxiliary database
SQFC (SQL Federated Client)
• OpenEdge SQL client thread for each
connection to the auxiliary database
9 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Connection types
0 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Connections – using MDBQ
OpenEdge SQL Server
Main SQSV
Thread Primary
SQFA DB
REMC
Client 1
Thread SQFC
Auxiliary
REMC DB
Client 2
Thread SQFC
1 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Promon – Primary Database
2 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Promon – Auxiliary Database
3 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
OpenEdge Management User Activity View
– Primary Database
Primary database connections
4 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
OpenEdge Management User Activity View
– Auxiliary Database
Auxiliary database connections
5 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
MDBQ Tips/Restrictions/Gotchas!!
Restriction
• Primary and auxiliary databases must reside
on same host
Connection authentication
• User credentials must be same on Primary
and each Auxiliary
Database codepage
• Codepage of databases must be the same
6 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
MDBQ Tips/Restrictions/Gotchas!!
7 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Multi-Database Query Support
Read
SQL Only
Client
dbname[-mdbq:config1]
Host
Shmem Second
DB
OpenEdge SQL
Shmem Server
Shmem Third
DB
Properties
DB [config1]
Primary Auxiliaries
8 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Agenda
9 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Planning – startup
Effect of MDBQ: Primary DB startup parameters
• Effectively no change from single connection,
make use of –Mi to control number of
connections/threads per server. Still have SQSV
(server slot (-Mi,Ma)) and REMC (user slot (-n))
• Reminder: OpenEdge SQL does better with
threads (more connections per server)
Effect of MDBQ: Auxiliary DB startup parameters
• SQFA is self-service (add one to –n)
• Each SQFC takes up a user slot (each add to –n)
• SQFA, for each SQSV, will host multiple SQFC
contexts
0 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Shutdown of Auxiliary database
OpenEdge SQL Server
Main SQSV
Thread Primary
SQFA DB
REMC
Client 1
Thread SQFC
Auxiliary
REMC DB
Client 2
Thread SQFC
Main SQSV
Thread Primary
DB
Auxiliary
DB
Main SQSV
Thread Primary
SQFA DB
REMC
Client 1
Thread SQFC
Auxiliary
REMC DB
Client 2
Thread SQFC
Primary
DB
Auxiliary
DB
Main SQSV
Thread Primary
SQFA DB
REMC
Client 1
Thread SQFC
Auxiliary
REMC DB
Client 2
Thread SQFC
Main SQSV
Thread Primary
DB
Auxiliary
DB
Main SQSV
Thread Primary
SQFA DB
REMC
Client 1
Thread SQFC
Auxiliary
REMC DB
Client 2
Thread SQFC
Main SQSV
Thread Primary
SQFA DB
REMC
Client 1
Thread SQFC
Auxiliary
DB
Multi-database query
9 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
For More Information, go to…
PSDN
Documentation – 10.1B
• OpenEdge Data Management:
SQL Development
• OpenEdge Data Management:
SQL Reference
0 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Relevant Exchange 2007 Sessions
1 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Questions?
2 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
Thank you for
your time
3 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation
4 OpenEdge SQL multi-database environment for ODBC and JDBC © 2007 Progress Software Corporation