Client Connectivity for Oracle...
-
Upload
truongdien -
Category
Documents
-
view
253 -
download
1
Transcript of Client Connectivity for Oracle...
Client Connectivityfor Oracle Rdb
Colleen Mitchneck
Linda Kipnes
Bryan Alvey
©2004-2005, Oracle Corporation
2
Client Connectivity
• When we talk Client Connectivity to Rdb,we are talking about…
…Oracle SQL/Servicesfor Rdb
3
History of SQL/Services
• 1992: Initial Release– Implemented a SQL/Services client API
– Implemented an ODBC for Oracle Rdb driver allowing anyindustry standard ODBC application to use Rdb in the backend
• 1994: SQL/Services acquired by Oracle
• 1995: Added RMU client/server capabilities
4
History of SQL/Services
• 1996: Implemented Oracle Call Interface(OCI) support– OCI applications could now run almost transparently
against an Rdb database– As new industry standards emerge, Oracle implements
compliant OCI drivers (JDBC, .NET, etc.), whichfunction with Oracle and Rdb databases in the backend
• 2003: Added Oracle Rdb JDBC servermanagement
5
SQL/Services Architecture
Client Server
Desktop systems
Client applications
Monitor
Configuration File
Dispatcher
SQLSRV ServiceRMU Service
OCI Service
Executors SQLSRV_MANAGE
SQL/Services Manager GUI
Rdb databases
6
SQL/Services Protocols
• SQLSRV – used by applications based on ODBCor on the SQL/Services client API
• OCI – used by Oracle applications thatcommunicate via the Oracle Call Interface (OCI)protocol
• RMU – used by the Oracle Rdb RMU utility forparallel backup and remote command execution
• JDBC – used to start and stop JDBC for OracleRdb thin servers
7
SQLSRV Client Architecture
Client using SQL/Services client API directly
Client using ODBC for Oracle Rdb
ClientApplication
SQL/ServicesClient API
serverClient
ApplicationODBC forOracle Rdb
SQL/ServicesClient API
8
SQLSRV Client
• SQL/Services client API– Available on Windows, Tru64 UNIX, OpenVMS, Red
Hat LinuxRed Hat Linux (V2.1 or later) is a new platform for
Oracle SQL/Services release 7.1.6
– Includes a library of routines that client applications cancall to access SQL/Services functions
– Enables client applications to execute Oracle Rdbdynamic SQL statements against an Rdb database
9
SQLSRV Client
• ODBC for Oracle Rdb– Layered on the client API to provide industry standard
ODBC access to Rdb
– Current version 3.1.0.2
– Much improved over earlier versions
Better performance
Improved conformance with ODBC specification
New API calls and prefetch functionality
10
SQLSRV Client
• ODBC for Oracle Rdb (con’t)– Works with any ODBC compliant application
ADO, .NET via bridge
many different vendors have released ODBC-compliantapplications in the software development, officeproductivity, and data analysis space
– Portable across databases
11
SQLSRV ServerArchitecture
Client
SQLSRV_MONmonitor
SQLSRV_DISPdispatcher
SQLSRV_EXECexecutor
Rdb databases
12
SQLSRV Server
• Monitor (SQLSRV_MON)– provides overall management and control for the server
• Dispatcher (SQLSRV_DISP)– responsible for handling network communications for the clients and for
the routing and scheduling of client requests to executors of a service
– a single dispatcher typically supports more than one network protocol, butcan support a single protocol
• Executor (SQLSRV_EXEC)– accepts client requests from dispatchers, processes them, and returns the
results
– there is a pool of executor processes for each service
14
OCI Server Architecture
ClientSQLSRV_SQLNETSHR
(Oracle RDBMS libraries)
Rdb databases
SQLSRV_MONOCI_DISPdispatcher
SQLSRV_NATCONN
RDB$NATCONN(OCI Services)
15
OCI Protocol
• Presents an Oracle RDBMS view of an Rdbdatabase by emulating Oracle Data Dictionary
• Manages Oracle cursors
• Manages Oracle to Rdb data type conversions
• Provides functions to emulate Oracle RDBMSbuilt-in functions (to_date, etc.)
16
OCI Protocol
• Some of the products using OCI…– Oracle JDBC
– Oracle ODBC
– Oracle database links
– Oracle Data Provider for .NET
– Oracle Reports
17
OCI Protocol
• And more products using OCI…– Oracle JDeveloper
– Oracle Forms
– Oracle Designer
– Oracle Developer
– Oracle SQLPLUS utility
– And many, many others…
19
RMU Protocol Architecture
ClientRMU
CommandLine Utility
SQLSRV_MONRMU_DISPdispatcher
RMUEXEC
RMUSHR
Rdb databases
serverclient
20
RMU Protocol
• RMU/BACKUP/PARALLEL– BACKUP command is sent from RMU client through
SQL/Services to the server node, where the backup is done byRMU executors
– Each RMU executor process can run multiple backup threads.
• Remote RMU Command Execution– Executes RMU commands remotely based on user specified
logical definitions
24
SQL/Services 7.1.6
• Currently in beta test
• Production release planned for Q1 2005
• Major Features– Upgraded to use the Oracle 9.2.0.4 libraries
– 2pc Support
– New and updated utilities
– Performance enhancements
25
SQL/Services 7.1.6Upgrade to Oracle 9.2.0.4
• Upgraded OCI Services
• Added support for new Oracle 9i data types– Time, Year-to-month interval, Day-to-second interval, etc.
• Removed several restrictions when connectingfrom Oracle 9i
26
SQL/Services 7.1.62pc Support
• Oracle Rdb databases can now fully participate inOracle RDBMS managed distributed transactions
• Allows multiple Oracle server DBLINKs to Rdbdatabases to participate in a transaction
• Exploits DECdtm XA Gateway to provideinterface between Oracle distributed transactionprotocol and DECdtm distributed transactionprotocol
27
What is a DBLINK?• A DBLINK is a Oracle RDBMS database server-
to-server connection– Set up in the Oracle RDBMS database with SQLPLUS:
SQL> CREATE DATABASE LINK dblink_name 2 CONNECT TO "username" IDENTIFIED BY 3 "password" USING "service_name";
– Uses a server-to-server subset of the OCI protocolOCI Native Connection (NATCON)
NATCON is a remote call interface
• Implementation in Rdb uses SQL Services– SQL Services Dispatcher resolves connection
– SQL Services Executor implements OCI Interface
– SQS Executor translates Oracle SQL into Rdb SQL
28
Transactions on a DBLINK
• OCI NATCON Transaction interface– Not SQL sentences like SET TRANSACTION– RCI calls to transaction functions in OCI Services I/F:gtabegn(), gtaprtn(), gtacomm(),gtaroll(), gtafrgt(), gtareco()
– Implemented inside the SQL Executor
• Uses Oracle RDBMS internal transactionprotocol– Distributed transaction capable
2 Phase Commit (i.e. prepare and commit/rollback)Allows partner to decline 2PC
– “XA-like” protocol … but not XA
29
What’s the Problem withDBLINK 2PC and Rdb?
• Rdb supports distributed transactions but …– It uses DECdtm as the transaction manager– It requires DECdtm AST calls to manage transaction
SQS Executor would need a DECdtm TIDWould pass TID to Dispatch layer in context structureDispatch layer would join the DECdtm transaction
– Rdb recovery asks DECdtm for transaction status
• Oracle RDBMS Server doesn’t do DECdtm– SQS Executor has to decline 2PC– Oracle RDBMS server copes by calling DBLINK to
commit after other participants successfully prepare– Limits transaction to one Rdb DBLINK participant
30
HP to the Rescue
• DECdtm XA Gateway provided by HP– Interfaces an XA Transaction Manager (TM) to DECdtm
– Allows DECdtm Resource Manager (RM) – like Rdb –to participate in an XA transaction
– Released as part of OpenVMS 7.3-1
• Can be exploited for DBLINK 2PC– Oracle RDBMS protocol is similar and compatible
– Interface written for OCI to XA GatewaySQS Executor translates between protocols
Can now participate in distributed transactions
– One DBLINK limit removed
31
Gory Details ofImplementation
• SQS Executor is a SQL$PRE/CC application– Now compiled specifying implicit 2PC
– Executor’s Rdb Dispatch layer joins the default DECdtm transaction
• SQS Executor now sends OCI transaction calls toXA Gateway
– OCI transaction ID is used as an XA transaction ID
– XA Gateway calls DECdtm
Sets SQS Executor process default transaction
Passes transaction calls for that transaction
– DECdtm calls Dispatch layer of SQS Executor via ASTs
• SQL statements submitted dynamically as before
32
Gory Details Illustrated
OracleRDBMSServer
SQS Executor Process
RdbDispatch
OCINATCON
SQS/OCIExecutor
DynamicSQL
XACalls
DECdtmServices
XA GatewayServer
DECdtmCalls
DECdtmCalls
33
How Do I Use It?
• Set up the DECdtm XA Gateway– Make sure Gateway server is installed:
DDTM$XG_SS.EXE– Use Gateway Control Program (XGCP.EXE) to:
Create a log for your XA domainStart up the Gateway server
• Define Rdb logical for XA Gateway domain– Logical name: RDB$DDTM_XG_INFO– For example:
$DEFINE/SYSTEM RDB$DDTM_XG_INFO SYSTEM$node_namewhere node_name is the OpenVMS node name
– Now SQL Services will automatically do 2PC
34
SQL/Services 7.1.6Utilities
• RDB$NATCONN_DIC Utility– New utility for 7.1.6
Replaces the use of .SQL scripts required by priorversions
– Performs database prepare, upgrade and drop of Oracledata dictionary definitions in Rdb database to enableOCI access
– Can upgrade from any prior version of OCI Services (nointerim upgrades required)
– Invoked via SYS$LIBRARY:RDB_NATCONN.COM
35
SQL/Services 7.1.6Utilities
• RDB$NATCONN_CUPP Utility– Updated utility for 7.1.6
Replaces RDB_NATCONN procedure to add users
– Used to add, modify, remove, and show users enabledfor OCI accessMost OCI applications now require users to be defined in the
database in order to execute the application
– Invoked via SYS$LIBRARY:RDB_NATCONN.COM
36
SQL/Services 7.1.6Performance Enhancements
• SQLSRV_SQLNETSHR71.EXE– Expanded to include both Oracle SQLNET and OCI
libraries– Installed shareable to decrease memory usage and
increase performance– Oracle OCI libraries no longer built into OCI Services
images; each image ~9,000 blocks smaller than release7.1.5.9.1
– Results in a smaller footprint for each running OCIexecutor process
37
SQL/Services 7.1.6Performance Enhancements
• More efficient metadata queries in OCIServices– Queries are now prepared once on first use and executed
numerous times, rather than being prepared each timequery is executed
• More efficient use of shared memory inSQL/Services to eliminate memory leaks
38
SQL/Services 7.1.6Other New Features
• Automatic creation of LISTENER.ORA fileduring installation, if it doesn’t already exist
• Validate program feature to restrict users to accessvia user specified programs
• JDBC dispatcher; used to start and stop JDBC forOracle Rdb thin servers
• OCI Services bugcheck dump capability• Documentation update & reorganization
– Installation guide– Configuration guide– Release notes
39
SQL/ServicesFutures?
• Production Release 7.1.6 – Q1 2005• Upgrade to Oracle 10G• OCI transaction reuseable services• ODBC on Linux ?• Enhanced BLOB support• VMS external authorization support• Support for new Oracle packages• User defined packages