|Oracle® HTTP Server mod_plsql User's Guide
10g Release 1 (10.1)
Part Number B12303-01
mod_plsql is an Oracle HTTP Server plug-in that communicates with the database by mapping browser requests into database stored procedure calls over a SQL*Net connection. It is generally indicated by a
/pls virtual path. The mod_plsql gateway provides support for building and deploying PL/SQL-based applications on the Web. PL/SQL stored procedures can retrieve data from database tables and generate HTTP responses containing formatted data and HTML code to display in a Web browser. See the Oracle Database Application Developer's Guide - Fundamentals for more information.
The PL/SQL Web Toolkit enables you to develop Web applications as PL/SQL procedures stored in an Oracle database server. Packages in the toolkit define procedures, functions, and data types that you can use in your stored procedures. See the Oracle Database Application Developer's Guide - Fundamentals for more information.
You can determine the version of mod_plsql by executing the
oversioncheck script on the mod_plsql binary.
On UNIX platforms, issue the following command:
On Windows platforms, issue the following command:
This should show the version of the OWA packages. For example, 184.108.40.206.1.
If this query fails, you are having a very old version of OWA packages that does not have versioning. It is recommended that you upgrade to a newer version.
See Section 2.2, "Installing Required Packages" for more information.
OWA packages can be uninstalled by performing the following tasks:
owadins.sqlto uninstall the OWA packages.
The following SQL query can be used to determine the location of the OWA packages:
You will see the following results:
SQL> 1 SELECT OWNER, OBJECT_TYPE 2 FROM DBA_OBJECTS 3* WHERE OBJECT_NAME = 'OWA' OWNER OBJECT_TYPE ----- ----------- SYS PACKAGE SYS PACKAGE BODY PUBLIC SYNONYM
If you see more lines than shown in the preceding SQL query, it means that older OWA packages exist in other schemas, which may cause issues for mod_plsql users. In such situations, uninstall all versions of the OWA packages from the database, and reinstall the OWA packages that ship with the product.
mod_plsql logs detailed error messages to the OHS file
/Apache/Apache/logs/error_log. Scan this file to understand the problem. For more information on mod_plsql logging, see "What kinds of logging facilities are available in mod_plsql?".
This problem could occur if you have duplicate OWA Packages installed in the database. See "How do I detect and clean up duplicate OWA packages installed in the database?" for more information.
The most common reason for this problem is that the middle-tier character set does not match that of the back-end database, and HTTP KeepAlive is enabled in Oracle HTTP Server. This kind of misconfiguration causes an invalid Content-Length to be sent back to the browser, causing the browser to detect the end of the response stream only when the KeepAliveTimeout interval causes the stream to be closed. To solve the problem, ensure that the PlsqlNLSLanguage parameter in the DAD matches that of the database.
Yes. But before you can run your applications, you need to install the OWA packages into your database. See Section 2.2, "Installing Required Packages".
Refer to the mod_plsql section in the Oracle HTTP Server Administrator's Guide.
mod_plsql starts a thread in each httpd process. The job of this thread is to clean up idle database sessions and the file system cache. This thread is called the Cleanup Thread.
mod_plsql cleans up unused database sessions based on the configuration setting of PlsqlIdleSessionCleanupInterval. Besides this, the configuration directive PlsqlMaxRequestsPerSession governs how many requests will be serviced from a pooled database session. Finally, database sessions are closed when httpd processes are shut down.
When the database connection is severed, the first request that attempts to execute a PL/SQL procedure using the severed connection will fail. Subsequent requests will reestablish a database session and start functioning normally. The number of failures will be directly proportional to the number of pooled database sessions. Future versions of mod_plsql will detect dead connections automatically.
If the database is not restarted within the time interval of PlsqlIdleSessionCleanupInterval, then the cleanup thread will clean up the severed sessions, and no errors will be seen by end-users.
The cleanup thread scans the file system cache based on the configuration of PlsqlCacheCleanupTime. The default cleanup time is everyday at 11 P.M. local time.
Yes. Since mod_plsql uses the OHS' Location directive, you can configure any virtual path to be serviced by mod_plsql.
/Apache/Apache/logs/error_log. The amount of information logged by mod_plsql is controlled by the setting of OHS' LogLevel parameter in
httpd.conf. By default, this is configured to warn.
/Apache/Apache/conf/httpd.confand set LogLevel to info (default is warn).
/Apache/Apache/logs/error_logstarts showing entries as follows:
[Tue Apr 01 14:54:49 2003] [info] mod_plsql: [perf] 220.127.116.11 /pls/app/htp.p status=200 user=scott reqTime=21ms connSU=(null),0ms connRO=(null),0ms connNSSO=HIT,1ms procTime=17ms sessionTidyTime=0ms cache=(null) cookie=(null),0ms pageCalls=0,0ms bytes=5 describe=No,0ms streamTime=0ms pid=175 sessFile=(null) userFile=834\0855 sysFile=470\5949 cacheLevel=(null) cacheTime=0ms dbProcTime=15ms id=1049237685:18.104.22.168:373:1 spid=(null) qs=(null) requestTrace=(null) cookieLen=0 cookieValue=(null) reqUserTime=16ms assertUser=(null) subid=(null) authLevel=(null) oraError=0
In this mode, debug messages are logged to Oracle HTTP Server's
error_log file and additional mod_plsql specific logs are created under
/Apache/modplsql/logs. Log location is configurable using the PlsqlLogDirectory directive in
/Apache/modplsql/conf/plsql.conf. To enable debug level logging:
For high availability, mod_plsql based applications should be aware of the following things:
If a firewall exists between the middle-tier running mod_plsql, and the back end database, the idle session cleanup interval in mod_plsql should be configured lower than the idle session cleanup interval of the firewall. This ensures that the firewall never closes a connection established by mod_plsql.
mod_plsql idle session cleanup interval can be configured using the parameter PlsqlIdleSessionCleanupInterval in
Consider using OHS' ServerName directive in
Consider using OHS' Port directive in
Please refer to the description of PlsqlExclusionList in Section 3.3.1, "Using the PlsqlExclusionList Directive in mod_plsql".
This error means that mod_plsql is unable to connect to the database.
In most situations, the problem occurs because SQL*Net is not able to resolve the connect string parameter using the configuration information under
tnsping dad_connect_string. For example:
If this does not work, refer to the Oracle SQL*Net documentation on how to troubleshoot this further.