External procedures are procedures that are called from another program, but are written in a different language. An example would be a PL/SQL program calling one or more C routines that are required to perform special-purpose processing.
You can configure the listener to listen for external procedure calls.
When an application calls an external procedure, the listener starts an
external procedure agent, which by default is named extproc
.
Using the network connection established by the listener, the application
passes the following information to the agent:
DLL or shared library name
External procedure name
Any parameters
The agent then loads the DLL and runs the external procedure and passes back to the application any values returned by the external procedure.
The agent can reside on the same computer as the database server or on a remote computer with a listener.
For an Oracle database to connect to an external procedure, configure
the listener.ora
file
with a protocol address and external procedure service information.
|
Note: Oracle
Net Configuration Assistant configures this information in the |
To configure the listener for external procedure calls:
Create a listener to exclusively handle external procedures:
a. In the navigator pane, expand Oracle Net Configuration > Local > Listeners.
b. Choose plus (+) from the toolbar or select Edit > Create. The Choose Listener Name dialog box appears.
c. Enter a unique listener name in the Listener Name field.
d. Choose OK.
If the agent resides on the database server, configure
either a TCP/IP or an IPC protocol address in the listener.ora
file. If the external procedure agent resides on a remote computer, configure
a TCP/IP protocol address in the listener.ora
file. The following
procedure describes creating an IPC address for the default external procedure
agent extproc
:
a. Select the newly-created listener.
b. From the list in the right pane, select Listening Locations.
c. Choose Add Address. A new Address tab appears.
d. From the Protocol list, select IPC, and enter a value for the Key.
Add service information about extproc
in the listener.ora
file
a. From the list in the right pane, select Other Services.
b. Choose Add Service. A new Service tab appears.
c. Enter extproc in the Program Name field, a system identifier such as extproc in the SID field, and the Oracle home where the extproc executable resides in the Oracle Home Directory field. If the application requires that an environment variable be set before the agent is started, enter it the Environment field. For example, if the application requires environment variables MYAPPDIR for the binary location and APPID for the ID, you would enter the following in the Environment field:
'MYAPPDIR=/myappdir/bin','APPID=MYAPP'
If you configured a TCP/IP protocol address, specify remote clients that are allowed access:
a. In the navigator pane, expand Local > Profile.
b. From the list in the right pane, select General.
c. Choose the Access Rights tab.
d. Select the Check TCP/IP client access rights option.
e. In the Clients allowed to access field, enter either a host name or an IP address for a client that you wish to include or exclude, using commas to delimit entries placed on the same line.
Create a net service name in the database server
tnsnames.ora
file whose connect descriptor matches the information
configured in the listener.ora
file, as described in Configure
a Connect Descriptor for External Procedures.
Choose File > Save Network Configuration.