5.4. Connecting to Non-Oracle Databases
Oracle provides several methods
for connecting to databases provided by other vendors. These
databases range from small, single-user databases like Microsoft
Access to large, multi-user databases like Sybase or Microsoft SQL
Server.
5.4.1. Open DataBase Connectivity
The Open DataBase
Connectivity (ODBC) is actually an Application Programming Interface
(API) specification developed by Microsoft. Because ODBC provides a
standard interface to both the application program and the backend
server, it allows any ODBC-compliant application to connect to any
ODBC-compliant database. ODBC has been implemented for Oracle in two
ways:
Native mode ODBC
-
The ODBC
driver duplicates the functionality of SQL*Net, so a client running
an ODBC driver can connect to a server running SQL*Net without
actually running SQL*Net software on the client machine. Thus, the
ODBC driver is able to emulate SQL*Net. This capability is not
provided by Oracle, but is implemented by other vendors of ODBC
drivers.
SQL*Net integrated
-
The ODBC driver provides an interface to
SQL*Net that, in turn, actually carries the data to the target node.
This is the more common implementation of ODBC, where the ODBC layer
actually sits on top of SQL*Net.
Because many applications have been built to interface with ODBC,
this technology allows a wide range of applications to connect to an
Oracle database without the need to provide a native SQL*Net
interface. However, because ODBC relies on SQL*Net for its underlying
transport, communications using ODBC are typically less efficient
than native SQL*Net. In addition, some Oracle functionality is not
fully supported by ODBC drivers. This lack of functionality is easily
mistaken for an application problem, and may be difficult to detect
and correct. If full Oracle functionality is required, use the Oracle
Call Interface (OCI), rather than ODBC.
5.4.2. Gateways
Oracle has
responded to the need for access to non-Oracle databases such as
IBM's DB2 by developing gateway products. These gateways run as
processes on the non-Oracle host machine, and essentially operate by
emulating SQL*Net and an Oracle database on the non-Oracle host. For
example, IBM provides a native SQL database on its AS/400 computers,
which are very popular small office machines. Oracle does not have a
database product that runs on AS/400, but it does provide an AS/400
gateway. This gateway has a listener process that functions just like
the listener on any Oracle server, and is used to establish
connections to Oracle servers. Once a connection is established,
gateway software translates Oracle SQL queries into native AS/400
queries, and then returns the data to the Oracle server, essentially
making the data stream look as if it had come from another Oracle
server.
One restriction on the use of an Oracle gateway is that it can only
be accessed from an Oracle server using a database link; an Oracle
client is not able to directly connect to a gateway.
 |
Not all gateways support Oracle's two-phase commit mechanism
for distributed transactions. If you require this functionality,
consult the appropriate Oracle documentation for the
gateway. | |
|