Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure and run external stored procedures in Oracle

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

What this article shares with you is about how to configure and run external stored procedures in Oracle. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.

First, the C code needs to be compiled, and then you need to create a shared library file (.so) or a dynamic link library (DLL) from it (in the case of Windows). You need to create a library object in the database to reference the shared library file or DLL from the PLSQL code. The Library needs to be published by invoking the specification, using special syntax, such as the IS | AS LANGUAGE clause of the CREATE OR REPLACE statement. In other words, this is just an PLSQL wrapper (also known as an external procedure) unit that tells which libraries need to be called and which functions in the library need to be run.

The Oracle database provides a "extproc" agent to facilitate communication between Oracle and shared libraries. The agent loads the library, passes any (if any) parameters to the library, runs it, and returns the results to the calling session.

How to configure the extproc agent?

There are several ways to configure the extproc proxy.

With the default configuration, the Oracle database creates a proxy each time an external stored procedure is called.

Edit listener.ora and tnsnames.ora to create a listening configuration that overrides the default configuration. In this case, the extproc is created by listener each time an external stored procedure is called.

When using multithreaded extproc agent or using AGENT IN statements to define library, you must use a proxy created by listener. The Oracle database and the agents created by listener are independent agents. In other words, both the Oracle database and listener create independent agents, which can affect performance if external stored procedures are used a lot. This can be solved by configuring a multithreaded agent (MTA).

MTA mode

In MTA mode, you can specify the number of extproc agents running at any given point in time. Requests are extracted and served by multithreaded agents according to the load. MTA can be configured using the "agtctl" tool.

The above is how to configure and run external stored procedures in Oracle. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report