Published by : Obay Salah , November 19, 2024

 It is necessary to prepare the listener to be able to accept and complete the call of external procedures. By preparing the listener, you can call and use a procedure written outside the Oracle database and in another language such as Java or C++ or C.

As is the case in registering the instance at the listener the moment the session is started, so is the case when calling an external procedure from within the database The data must be registered as an external procedure agent in the listener, but unfortunately registration cannot be done automatically as is the case with dynamic instance registration, so the database administrator must do the registration manually

by editing the

Listener.ora file or through the Enterprise Manager or through the .NET Manager tool.

This is an example of a Listener.ora file where the listener is called ext_proc_listener, this listener serves the protocol called IPC, this listener cannot deal with any external procedure other than the IPC PROTOCOL, and it works on a port called ext_proc1 and it must be the only one in the server. All EPC requests will go through the extproc.exe program, which is a program located in the ORACLE_HOME\bin directory and is an executable file that receives EPC requests, so in the SID LIST in the Listener.ora file you should include this in a variable called PROGRAM.

Of course, to create and execute external procedures, you must follow the following steps:

1- Create the external procedure, and create a link to it.

2- Create the Oracle Library.

3- Create the PL/SQL Procedure that calls the external procedure.


External procedure processing steps:




1- The Process User calls the PL/SQL Program

2- The Server Process executes the PL/SQL Program, note that it contains a call to an external procedure.

3- The PL/SQL Program passes this request to the listener to process the subject of the external procedure call.

4- The listener generates a call to the EXTPROC Agent specialized in executing external procedures.

5- EXTPROC loads the Shared Library, note that the Library must be created as a previous step through the create library util_lib command.

6- Then EXTPROC Agent executes the external procedure.

7- Finally, the data is returned to the server.

Tags : Database

You May Also Like

Comments

no comment yet!