Oracle9i Application Server Using the PL/SQL Gateway Release 1 (v1.0.2.2) Part Number A90099-01 |
|
You can use the mod_plsql without the /pls in the URL (similar to the Oracle Application Server [OAS] 4.0.8).
Note: The default installation of mod_plsql is mapped to /pls. The code in the plsql.conf is similar to: [...] <Location /pls> SetHandler pls_handler ... </Location> [...] |
There are several methods, outlined below.
[...] RewriteEngine on RewriteRule ^/myapp/(.*)$ /pls/[DAD]/$1 [PT] [...]
The passthru (PT) flag is a way to post-process the output of RewriteRule directives, but in this case prevents a redirect. Another advantage is that you can hide your URL behind the alias, meaning that the URL does not get rewritten in the browser location window. Therefore this method is the preferred way to set alias names for your application URL.
For more information on rewrites, refer to the documentation at http://www.apache.org/docs/mod/mod_rewrite.html.
Redirect /myapp http://[hostname]:[port]/pls/[DAD]
This redirects all requests http://[hostname]:[port]/myapp/... to http://[hostname]:[port]/pls/[DAD]/...
For more information on rewrites, refer to the documentation at http://www.apache.org for more information on the redirect directive.
[...] RewriteEngine on RewriteRule ^/myapp/(.*)$ /pls/[DAD]/$1 [R,L] [...]
The Flexible Parameter passing mode in Oracle9i Application Server expects the PL/SQL procedure to have the exclamation mark before the procedure name. Due to performance implications of the auto-detect method used in OAS, the exclamation mark is now required for flexible parameter passing in Oracle9i Application Server.
In OAS, each procedure is described completely before being executed. The Procedure Describe call figures out the signature of the procedure and requires a round-trip to the database. The PL/SQL Gateway in Oracle9i Application Server avoids this round trip by having end-users explicitly indicate the flexible parameter passing convention by adding the exclamation mark before the procedure. Refer to "Flexible Parameter Passing" for more information.
To turn on logging for mod_plsql, do the following:
Note: When sending log file to Oracle support, start with a clean set of log files to expedite the process. After Step 1., either archive or delete the older logs. |
<ORACLE_HOME>/Apache/Apache/logs/httpd_access_log <ORACLE_HOME>/Apache/Apache/logs/httpd_error_log <ORACLE_HOME>/Apache/Jserv/logs/jserv.log <ORACLE_HOME>/network/admin/sqlnet.log <ORACLE_HOME>/admin/<database>/bdump/alert
The database connection pool in mod_plsql is not shared across Apache processes (each process maintains its own pool). The total number of database connections pooled in Apache mod_plsql is directly related to the number of Apache processes that are spawned and the number of DAD's used to access different PL/SQL applications. The mod_plsql pools one database session per DAD per Apache process. So, the maximum number of database sessions that will be pooled by mod_plsql will be (NumberOfApacheProcesses*NumberOfDADs).
On Windows NT, where Apache is multi-threaded, all threads share the same database connection pool. The maximum number of database sessions that will be pooled by mod_plsql is (MaximumNumberOfApacheThreadsConcurrentlyActive
ForEachDAD). This is the ideal case scenario where every thread can take advantage of a database session created by another thread.
On platforms where Apache is not multi-threaded, it is important that the following parameters be tuned.
If your database is unable to handle the load, do one of the following:
The mod_plsql in Oracle9i Application Server v1.0.2 has a cleanup thread which periodically cleans up database sessions which are inactive for more than 15 minutes. So, you need not be concerned about database related resources since mod_plsql does the cleanup automatically at idle time.
The connection pooling logic in mod_plsql is best explained with an example. Here are the details for a typical scenario:
The main things to note in this model is that
On platforms where Apache is process based (e.g. Solaris), each process serves all kinds of HTTP requests (servlets/PLSQL/static file etc). In a single Oracle9i Application Server listener setup, each Apache process maintains its own connection pool to the database. The maximum number of database sessions is governed by the setting in httpd.conf for StartServers/MinSpareServers/MaxSpareServers and the load on the system. This architecture does not allow you to tune the number of database sessions based on the number of mod_plsql requests.
To tune the number of database sessions based on the number of mod_plsql requests, install a separate Apache listener for just mod_plsql requests.
For example: Assume your main Oracle9i Application Server Listener is running on port 7777 of mylsnr1.us.oracle.com. You can install another Oracle9i Application Server Listener on port 8888 on mylsnr2.us.oracle.com. Then, redirect all mod_plsql requests made to mylsnr1.us.oracle.com:777 to the second listener on mylsnr2.us.oracle.com:8888. This is achieved by doing the following:
<Location /pls> ... </Location>
LoadModule plsql_module...
ProxyPass /pls/ http://my.lsnr2.us.oracle.com:8888/pls/
cgi_env_list=SERVER_NAME=mylsnr1.us.oracle.com,SERVER_ PORT=7777,HOST=mylsnr1.us oracle.com:7777
In this setup, the main listener lsnr1.us.oracle.com can be configured based on the load to the Oracle9i Application Server Listener. Then the second listener can be fine-tuned based on the mod_plsql requests being made.
The following steps can help you isolate your problem. Verify you can do each step before proceeding to the next one.
http://host:port/pls/DAD/htp.p?cbuf=Hello
If you are getting error code "503 Service Temporarily Unavailable" when your web server is under some load, determine if the mod_plsql cannot connect to the database because the maximum number of database sessions has been reached.
There is an issue with symbols outside the range of the US-ASCII charset displaying correctly with Netscape 6. If your symbols are being displayed as question marks, implement the following fix:
Enter the following to emulate the various symbols:
Restricted Symbols | Code |
---|---|
Trademark symbol (TM) |
<SUP><SMALL>TM</SMALL></SUP> |
Copyright symbol (©) |
© |
Registration symbol (®) |
® |
While executing some of the Portal stored procedures, mod_plsql is incurring a Describe overhead which results in two extra round trips to the database for a successful execution. This has performance implications.
In order to execute PL/SQL procedures, mod_plsql needs to know about the data type of the parameters being passed in. Based on this information, mod_plsql binds each parameter either as an array or as a scalar. One way to know the procedure signature is to describe the procedure before executing it. However, this approach is not efficient because every procedure has to be described before execution (unless the procedure descriptions are cached).
To avoid the "describe" overhead, mod_plsql looks at the number of parameters passed for each parameter name. It uses this information to assume the datatype of each variable. The logic is simply, "if there is a single value being passed, then the parameter is a scalar, otherwise it is an array".
This works for most cases but fails if someone tries to pass a single value for an array parameter. Then the PL/SQL procedure execution fails because it binds an array as a scalar. In such circumstances, mod_plsql issues the Describe call for the procedure and binds each parameter based on the information retrieved from the describe call, reexecutes the procedure and sends back the results. This happens transparently to the procedure, but internally mod_plsql has encountered two extra round trips (one for the failed execute and the other for the "Describe" call).
You can avoid performance problems by doing the following:
TYPE myArrayType is TABLE of VARCHAR2(32767) index by binary_integer; procedure arrayproc (arr myArrayType); end testpkg; /
create or replace package testpkg as TYPE myArrayType is TABLE of VARCHAR2(32767) index by binary_integer; procedure arrayproc (arr varchar2); procedure arrayproc (arr myArrayType); end testpkg; /
procedure arrayproc (arr varchar2) is localArr myArrayType; begin localArr(1) := arr; arrayproc (localArr); end arrayproc;
A similar round-trip overhead exists if a PL/SQL procedure is using the older style four parameter interface. The PL/SQL Gateway first tries to execute the procedure by using the two parameter interface. If this fails, the PL/SQL Gateway tries the four parameter interface. This implies that all four parameter interface procedures will experience one extra round-trip for execution.
To avoid this overhead, it is recommended that you write corresponding wrappers which use the two parameter interface and internally call the four parameter interface procedures. Another option is to change the specification of the original procedure to default the parameters which are not passed in the two parameter interface.
WebDB users running WebDB version 2.x (2.0, 2.1, 2.2) through the PL/SQL Gateway must perform the following steps.
@owaload.sql log.txt
This may invalidate some of your existing PL/SQL procedures. You may need to recompile them. See "Installing Required Packages" for more information
Authentication Mode = Basic
Document Table = schema.wwv_document
Extensions to be Uploaded as Long Raw = *
If you set up your DAD using the Add for WebDB 2.x configuration page (http://<hostname>:<port>/pls/admin_/dadentries.htm), these settings are automatically set.
|
Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|