Doc ID: Note:111555.1
Subject: Overview of How an External Procedure Works
Type: BULLETIN
Status: PUBLISHED
PURPOSE
-------
To provide basic information about external procedures.
SCOPE & APPLICATION
-------------------
Basic information for individuals with an intermediate understanding of Oracle architecture.
Overview of How an External Procedure Works ===========================================
An external procedure or routine lets you:
* Move computation-bound programs from client to server where they execute faster (because they avoid the roundtrips entailed in across-network communication).
* Interface the database server with external systems and data sources.
* Extend the functionality of the database server itself.
The following describes how an external procedure is typically created during useage of InterMedia Text, though much of it applies to all external procedures.
1. A client program connects to the database either locally or through the Listener.
2. The listener's environment is used to spawn an Oracle shadow process unless the 'ENVS=' statement is in the 'SID_DESC' section of the listener.ora. Settings in the'ENVS='will take precedence over the existing environment.
3. Once the shadow process is started the client and shadow process talk directly. The listener's job is done for now.
4. The client program issues a standard SQL statement to create a iMT index. This initiates the external procedure creation process.
5. The 'EXTPROC_CONNECTION_DATA' service information in the tnsnames.ora of the server's environment is provided to the Listener, effectively saying 'This is what I need to talk to a create an iMT index'. The environment from the Listener will be used for spawning subsequent Oracle processes or external procedures unless the 'ENVS=' statement exists under the 'SID_DESC' section of the listener.ora. Settings in the'ENVS='will take precedence over the existing environment.
6. The Listener resolves that service name to a specific SID in the listener.ora, then launches a extproc process (indicated under the 'SID_NAME' section') to allow direct communication with the database. The spawned process will have a name that equals the 'SID_NAME=' section concatenated to the 'PROGRAM=' section.
Oracle8i Application Developer's Guide - Fundamentals