Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

  extproc for Oracle tips

Oracle Database Tips by Donald BurlesonApril 10, 2015

Question:  How do I understand how to use the extproc feature of Oracle?  I want to set-up and use an extproc.

Answer: To use extproc, you start with these steps:

1 - When you create your external library it must be statically linked with all other shared libraries and directories used by extproc.

2 - Make sure that you add the extproc entry in your listener.ora and tnsnames.ora.  Also be aware of the security issues when using extproc.

3 - Try adding $ORACLE_HOME/lib to your LD_LIBRARY_PATH:

SET LD_LIBRARY_PATH=/path/to/my/lib; $ORACLE_HOME/lib
export LD_LIBRARY_PATH

4. Next, ensure that your extproc entries are present in tnsnames.ora and listener.ora files.  Here are how to add extproc entries to tnsnames.ora and listener.ora:

TNSNAMES.ORA EXTPROC:

Add this line in $ORACLE_HOME/network/admin/tnsnames.ora

extproc_connection_data
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=your_key))

(CONNECT_DATA=(SID=extproc)))

LISTENER.ORA EXTPROC


Add/edit this line in $ORACLE_HOME/network/admin/listener.ora

LISTENER =
   (ADDRESS_LIST

   (ADDRESS=(PROTOCOL=ipc)(KEY=yourkey)))

SID_LIST_LISTENER = (SID_LIST
(SID_DESC=(SID_NAME=mydb)(ORACLE_HOME=/myhome/oracle))

(SID_DESC=(SID_NAME=extproc)(ORACLE_HOME=/myhome/orac le)

(PROGRAM=extproc)))

Also see my notes on ORA-06520 extproc: no such file or directory


The following steps were what I did. It works in my site. hope it helps.
---------------------------------------------------------------------------------------------
1. Compile a DLL file .. (I assume the DLL is well-compiled.)
2. Check the exported functions of DLL can be loaded by Oracle DB (or ask who wrote the DLL)
E:>dumpbin /exports actnoMask.dll (VS 2015 ) where actnoMask.dll is the DLL.
3. Listener.ora add :
....
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D:\oradata\oracle10)
(PROGRAM = extproc)
(ENVS="EXTPROC_DLLS=E:\dlltest\actnoMask.dll") ..
...
then restart.
where E:\dlltest\actnoMask.dll is the DLL path/filename.
tnsnames.ora add:
....
EXTPROC_CONNECTION =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC)) )
(CONNECT_DATA = (SID = PLSExtProc) (PRESENTATION = RO))
)
...
4. Create library/external functions:
SQL> create or replace library actnomask as 'E:\dlltest\actnoMask.dll;
SQL> --- GenID and ReverseID are the exported functions of DLL actnoMask.dll
SQL> --- GenACTNO and RevACTNO are the function name used in Oracle DB
SQL> CREATE OR REPLACE FUNCTION GenACTNO (x char) RETURN CHAR AS LANGUAGE C
LIBRARY actnomask NAME "GenID";
SQL> CREATE OR REPLACE FUNCTION RevACTNO(x char) RETURN CHAR AS LANGUAGE C
LIBRARY actnomask NAME "ReverseID";
---------------------------------------------------------------------------------------------
Then you are good to use the functions provided by DLL.

   
Oracle Training from Don Burleson 

The best on site "Oracle training classes" are just a phone call away! You can get personalized Oracle training by Donald Burleson, right at your shop!

Oracle training
 
 


 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational

 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster