| |
 |
|
SQL*Net Dedicated Process
Oracle Tips by Burleson Consulting |
The Data Warehouse Development Life Cycle
The Internals Of Oracle's SQL*Net
1. Issue a remote request. Check the database link called
LONDON.
SELECT * FROM customer@LONDON
2. Database link. Get the service name (london_unix_d) using the
link_name (LONDON).
CREATE PUBLIC DATABASE LINK LONDON
CONNECT TO london_unix_d;
3. tnsnames.ora. Get the sid name (london_sid) using service name (london_unix_d).
london_unix_d =
(description=(address=(protocol=tcp) (host=seagull)
(port=1521) (connect_data=(sid=london_sid) (server=dedicated)))
4. etc/hosts. Get the IP address (143.32.142.3) using the sid name (london_sid).
143.32.142.3 london_sid
london_unix.corporate.com
As you can see, this translation occurs in a multistage process. The
tnsnames.ora file specifies the name of the host containing the
destination database. For Unix environments, the host name is then
looked up in the etc/hosts file to get the IP address of the
destination box.
The service name is looked up in tnsnames.ora. If the
service exists, the IP address is found in the etc/hosts file and a
communications request is sent to the destination IP address. Note
that both of the entries in this file connect to London, but
london_unix_d directs SQL*Net to spawn a dedicated process, while
london_unix uses the multithreaded server component because a shared
server is specified.
Now that you have the tnsnames.ora and etc/hosts
files in place, you can include any tables from the London sites by
qualifying the remote site name in the SQL query. For example:
SELECT CUSTOMER.customer_name, ORDER.order_date
FROM customer@london, order
SEE CODE DEPOT FOR FULL SCRIPT
This query joins two tables at different locations, and the database
link called london determines how the Oracle connection will be
established on the destination system. Regardless of how the
connection is made to the destination, however, the user ID must
have SELECT privileges against the customer table, or this query
will fail.
This is an excerpt from "High Performance
Data Warehousing", copyright 1997.
 |
If you
like Oracle tuning, you may enjoy the book
Oracle Tuning: The Definitive
Reference , with
over 900 pages of BC's favorite tuning tips &
scripts.
You can buy it
directly from the publisher and save 30%, and get
instant access to the code depot of Oracle tuning
scripts. |
|