Skip Headers
Oracle® Application Server mod_plsql User's Guide
10g Release 2 (10.1.2)
B14010-02
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

A Frequently Asked Questions

What is mod_plsql?

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.

What is the PL/SQL Web Toolkit?

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.

How do I find the version of mod_plsql?

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:

ORACLE_HOME/Apache/Apache/bin/oversioncheck ORACLE_HOME/Apache/modplsql/bin/modplsql.so

On Windows platforms, issue the following command:

ORACLE_HOME\Apache\Apache\bin\oversioncheck ORACLE_HOME\bin\modplsql.dll

How do I find the version of the OWA packages?

  1. Use SQL*Plus and connect as any user to the database.

  2. Execute the following command:

    select owa_util.get_version from dual;
    
    

    This should show the version of the OWA packages. For example, 10.1.2.0.0.

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.

How do I install the OWA packages?

See Section 1.2, "Installing Required Packages" for more information.

How do I uninstall the OWA packages?

OWA packages can be uninstalled by performing the following tasks:

  1. Navigate to the directory from where the OWA packages were installed. For example:

    cd ORACLE_HOME/Apache/modplsql
    
    
  2. Use SQL*Plus to connect as the owner the OWA packages. This user should be the SYS user, unless you have an old version of the OWA packages.

  3. Invoke the script owadins.sql to uninstall the OWA packages.

How do I detect and clean up duplicate OWA packages installed in the database?

The following SQL query can be used to determine the location of the OWA packages:

SELECT OWNER, OBJECT_TYPE
FROM   DBA_OBJECTS
WHERE  OBJECT_NAME = 'OWA'

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.

I am getting HTTP error codes while accessing PL/SQL procedures through mod_plsql.

mod_plsql logs detailed error messages to the Oracle HTTP Server file ORACLE_HOME/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?".

All my PL/SQL procedures return a "Document contains no data" error in Netscape, or a blank page in Internet Explorer.

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.

I have a performant PL/SQL procedure, but some of my HTTP requests through mod_plsql take more than 15 seconds.

The most common reason for this problem is that the middle-tier character set does not match that of the back-end database, and HTTPKeepAlive 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.

If this is not the reason for the problem, there could be performance issues with your PL/SQL application. You can confirm this by:

Can I use mod_plsql to run applications on my own database?

Yes. But before you can run your applications, you need to install the OWA packages into your database. See Section 1.2, "Installing Required Packages".

How do I configure mod_plsql?

Please refer to the Oracle HTTP Server Administrator's Guide.

How do I create a DAD through the Oracle Enterprise Manager 10g?

Refer to Oracle Enterprise Manager 10g documentation for information on creating DADs.

How do I troubleshoot problems with DAD configuration done through the Oracle Enterprise Manager 10g?

The DAD configuration tool outputs all log details from using the tool, to a log file ORACLE_HOME/Apache/modpslql/logs/log.xml.

Can I make manual edits to the DAD configuration file?

Yes. But, you should run the following command after the update:

ORACLE_HOME/dcm/bin/dcmctl updateConfig -ct ohs

This will update the Oracle Enterprise Manager 10g repository with the configuration change and will obscure the DAD password.

How do I create a DAD for mod_plsql?

Refer to the mod_plsql section in the Oracle HTTP Server Administrator's Guide.

What authentication modes are available in mod_plsql?

See Chapter 2, "Securing Application Database Access Through mod_plsql".

What is the mod_plsql Cleanup Thread?

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.

What kind of database connection pooling is present in mod_plsql?

Refer to Chapter 4, "Optimizing PL/SQL Performance".

How does mod_plsql clean up database sessions?

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.

What happens when pooled database connections exist in mod_plsql and the database is restarted?

See Section 3.11.3, "Detecting Dead Database Connections in a Connection Pool" for more information.

How does mod_plsql clean up cached content in the file system?

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.

Can I invoke mod_plsql without a "/pls" prefix in the URL?

Yes. Since mod_plsql uses the Oracle HTTP Server's Location directive, you can configure any virtual path to be serviced by mod_plsql.

How can I improve PL/SQL and mod_plsql performance?

Refer to Chapter 4, "Optimizing PL/SQL Performance".

What kinds of logging facilities are available in mod_plsql?

What kind of DMS metrics are available for mod_plsql?

For information on Dynamic Monitoring Service, refer to the Oracle Application Server Performance Guide.

What considerations should I have in mod_plsql for High Availability?

For high availability, mod_plsql based applications should be aware of the following things:

What considerations should I have in mod_plsql when the database is separated by a firewall?

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.


Note:

mod_plsql idle session cleanup interval can be configured using the parameter PlsqlIdleSessionCleanupInterval in ORACLE_HOME/Apache/modplsql/conf/plsql.conf. The default value is 15 minutes.

How do I assert a different hostname, port, or request_protocol to the PL/SQL application?

How do I disable access to procedure names that have a specific pattern?

Refer to Section 2.1.2, "Adding More Rules to the PlsqlExclusionList Directive in mod_plsql" for more information.

I see the error "HTTP-503 ORA-12154" in the file ORACLE_HOME/Apache/Apache/conf/error_log. What does this mean?

This error means that mod_plsql is unable to connect to the database.

Ensure that:

  1. The database is up and running.

  2. The username and password information in the DAD is correct.

  3. The middle tier is able to connect to the database using the PlsqlDatabaseConnectString parameter in the DAD.

In most situations, the problem occurs because SQL*Net is not able to resolve the connect string parameter using the configuration information under ORACLE_HOME/network/admin.

If this does not work, refer to the Oracle SQL*Net documentation on how to troubleshoot this further.


Note:

In 10g Release 2 (10.1.2), the default connect string parameter in the DAD is configured to get resolved through an LDAP lookup in Oracle Internet Directory. If you make changes to ldap.ora, you will need to restart Oracle HTTP Server for the changes to be accessible to mod_plsql.

Why do URLs of the formats /DAD/package.procedure() or /DAD/package.procedure(123) not work when invoking mod_plsql?

mod_plsql does not support URLs of the following formats:

For example:

http://www.acme.com:9000/pls/mydad/mypackage.myproc() or http://www.acme.com:9000/pls/mydad/mypackage.myproc(123)

For details about the supported URL format, refer to Section 3.3, "Invoking mod_plsql".

The mod_plsql service's page always shows DAD status as Down, for DADs that are functional. How do I resolve this?

The mod_plsql DAD status tests are based on building a test URL to ping and verify the status of a DAD. The protocol://host:port segment of the URL is built by defaulting the protocol to http and appending the HTTP Host and HTTP Port details from the Oracle Enterprise Manager 10g's HTTP Server target. So, if there has been a port change or the HTTP server is SSL enabled, the DAD status checks fail even though the DAD is actually working fine. The DAD status test does not support displaying of an accurate status for an SSL-enabled HTTP server. This causes the DAD status to show as Down. However, for an HTTP server that is not SSL enabled, you can fix the DAD status test if it is observed as constantly showing the status as Down. You can do this by synchronizing the HTTP Port with the actual HTTP Port where the HTTP Server is listening.

Before synchronizing the HTTP port, you must know the access URL to the functioning DAD. For example, if you are able to access the working DAD through the URL http://www.acme.com:9000/pls/myDAD, then you must perform the following steps:

  1. Backup the ORACLE_HOME/sysman/emd/targets.xml file. You will need the backed up file if targets.xml gets corrupted.

  2. Using a text editor, edit targets.xml.

  3. For the target type oracle_apache, change the HTTPPort and HTTPMachine properties to match the access URL of the DAD. For example:

    <Target TYPE="oracle_apache" NAME="internal.company.com_HTTP Server" DISPLAY_NAME="HTTP_Server" VERSION="2.0" >
       <Property NAME="version" VALUE="10.1.2"/>
       <Property NAME="HTTPPort" VALUE="9000"/>
       <Property NAME="HTTPMachine" VALUE="www.acme.com"/>
       <Property NAME="OracleHome" VALUE="/myOracle/infra101202"/>
       <AssocTargetInstance ASSOCIATION_NAME="ias" ASSOC_TARGET_TYPE="oracle_ias" ASSOC_TARGET_NAME="internal.company.com"/>
       <CompositeMembership>
          <MemberOf TYPE="oracle_ias" NAME="internal.company.com"/>
       </CompositeMembership>
    </Target>
    
    
  4. Save the file.

  5. Reload the targets by issuing the following command:

    In UNIX:

    ORACLE_HOME/bin/emctl reload
    
    

    In Windows:

    ORACLE_HOME\bin\emctl reload
    
    

    The ORACLE_HOME in the example is the Oracle home where you are seeing the DAD status issues.