Oracle9i Application Server Migrating from Oracle Application Server Release 1 (v1.0.2.2) Part Number A83709-07 |
|
This chapter compares Oracle Application Server cartridge functionality to corresponding functionality, and discusses considerations for migrating cartridges to the Oracle9i Application Server infrastructure. The topics include:
The table below shows the Oracle HTTP Server equivalent for each Oracle Application Server cartridge type:
The migration strategy for each application cartridge is detailed in the following sections.
Oracle Application Server PL/SQL Cartridge applications can be migrated to Oracle9i Application Server PL/SQL Gateway, which provides similar support for building and deploying PL/SQL based applications on the web.
mod_plsql is bundled into the PL/SQL Gateway and runs as an Oracle HTTP Server module. It delegates the servicing of HTTP requests to PL/SQL programs which execute their logic inside of Oracle databases.
Users who are planning to migrate PL/SQL applications from Oracle Application Server to Oracle9i Application Server are encouraged to read Using the PL/SQL Gateway in the Oracle9i Application Server Documentation Library and familiarize themselves with the features in this module.
Support for the following Oracle Application Server PL/SQL Cartridge features has changed in Oracle9i Application Server PL/SQL Gateway. The rest of this section provides details on how to migrate Oracle Application Server applications that use these features.
The following table lists the file upload/download features supported by Oracle Application Server and Oracle9i Application Server.
Note that all Oracle Application Server features except file compression/decompression are supported in Oracle9i Application Server. Users with compressed uploaded files in Oracle Application Server do not need to decompress their files manually. They will be automatically decompressed and uploaded in uncompressed format into the Oracle9i Application Server document table by the oas2ias
file migration tool that is documented in "Using the oas2ias Tool".
Oracle Application Server PL/SQL Cartridge and Oracle9i Application Server PL/SQL Gateway both support uploaded files. However, they use different document table schemas. Users with uploaded files on Oracle Application Server who wish to migrate to Oracle9i Application Server will need to convert their files using the oas2ias
migration tool.
The oas2ias
tool performs two functions:
The oas2ias
tool is implemented in C, using the OCI library. The tool reads all the rows from the OWS_CONTENT
table and populates the content and all it's attributes to a document table specified by the user.
Table 3-3 shows how the columns in the Oracle9i Application Server document table derive their values from Oracle Application Server.:
The content from Oracle Application Server will always be stored in the BLOB_CONTENT
column of the Oracle9i Application Server document table. The tool will also ensure that the data loaded into the Oracle9i Application Server doc
table is always uncompressed data. To do this, if the data is compressed (this is verified by checking the entries in the OWS_ATTRIBUTES
table), the data is uncompressed using the zlib library, and then loaded to the document table in Oracle9i Application Server.
The oas2ias
tool need only be run once to convert all Oracle Application Server files to Oracle9i Application Server format. The following steps should be followed:
SQL> CREATE TABLE my_doc_table ( NAME VARCHAR2(128) UNIQUE NOT NULL, MIME_TYPE VARCHAR2(128), DOC_SIZE NUMBER, DAD_CHARSET VARCHAR2(128), LAST_UPDATED DATE, CONTENT_TYPE VARCHAR2(128), CONTENT LONG RAW, BLOB_CONTENT BLOB);
%ORACLE_HOME%\bin
$ORACLE_HOME/bin
$ORACLE_HOME/lib and /usr/java/lib
$ORACLE_HOME/network/admin/tnsnames.ora
(UNIX) or %ORACLE_HOME%\network\admin\tnsnames.ora
(Windows NT). The format for a TNS alias in this file is:
<alias> =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(Host = <hostname>) (Port = <port_number>)) (CONNECT_DATA = (SID = <sid>))
)
See your database documentation for more information on TNS aliases.
oas2ias
tool which can be found in the bin directory under ORACLE_HOME in your Oracle9i Application Server installation. The tool will prompt for the following parameters:
The following is a sample run of oas2ias
:
Welcome to the OAS to iAS migration Utility Please enter the following parameters: WEBSYS password: manager OAS database connect string (<ENTER if local database>: orc8 iAS database user: oracle iAS database user's password: welcome iAS database connect string <ENTER if local database>: orc8 iAS doc table: my_doc_table Transferred file : C:\TEMP\upload.htm Length of file : 422 Transferred file : C:\Tnsnames.ora Length of file : 2785 Transferred file : C:\rangan\mails1.htm Length of file : 717835 Freeing handles ...
Custom Authentication is used in Oracle Application Server for applications that want to control the access themselves (that is within the application itself). The application authenticates the users in its own level and not within the database level.
The PL/SQL Gateway also supports custom authentication.
The flexible parameter passing scheme allows you to overload PL/SQL procedures. This allows you to reuse the same procedure name but change the procedure's behaviour depending on how many parameters a form passes to the procedure.
Both Oracle Application Server and Oracle9i Application Server support flexible parameter passing. To use flexible parameter passing in the PL/SQL Gateway, prefix the procedure name with an exclamation point (!) in the invoking URL.
For example, if the following URL invokes your Oracle Application Server procedure:
http://<host>/<virtual_path>/procedure?x=1&y=2
Then the URL that invokes your PL/SQL Gateway procedure will be:
http://<host>/<virtual_path>/!procedure?x=1&y=2
The Oracle Application Server PL/SQL cartridge supports a positional parameter passing scheme. This feature is not supported in Oracle9i Application Server and cannot be used.
In addition to running PL/SQL procedures stored in the database, the Oracle Application Server PL/SQL cartridge can run PL/SQL source files from the file system. The source file contains an anonymous PL/SQL block that does not define a function or procedure. This feature enables users to execute PL/SQL statements without storing them in the database. This is useful when prototyping PL/SQL code since it saves having to reload procedures into the database each time they are edited.
This feature is not supported in Oracle9i Application Server. Users will need to assign names to the anonymous blocks and compile them as stored procedures in the database.
This section explains how Perl cartridge applications are implemented in the Oracle Application Server, and how they can be migrated to Oracle9i Application Server.
There are two types of Perl applications that can run under Oracle Application Server:
Perl scripts that run under Oracle Application Server as CGI scripts use a standard Perl interpreter that must be installed on the system as a Perl executable, separate from the Oracle Application Server installation.
Perl scripts that run under Oracle Application Server using the Perl cartridge use a Perl interpreter contained in the cartridge, and based on standard Perl version 5.004. The interpreter is built as either:
The Perl cartridge links with the shared object or library at runtime.
Scripts written for the Perl cartridge differ from scripts written for a CGI environment, because of how the cartridge runs the interpreter. The Perl cartridge:
Perl scripts developed under Oracle Application Server to run as CGI scripts can run in Oracle9i Application Server as CGI scripts without modification. However, Perl scripts developed to run under the Perl cartridge in Oracle Application Server may need to be modified to run under Oracle9i Application Server.
This section includes a discussion of Oracle Application Server and Oracle9i Application Server Perl implementations, and code modifications for migrating Perl scripts to Oracle9i Application Server.
The Oracle9i Application Server Perl environment is based on the Apache Perl distribution (mod_perl). Like the Oracle Application Server implementation, mod_perl provides a persistent Perl interpreter embedded in the server and a code caching feature that loads and compiles modules and scripts only once, serving them from the cache. Like the Oracle Application Server Perl cartridge, mod_perl redirects stdout to the listener.
The Perl DBI and DBD modules are not part of the standard Oracle9i Application Server distribution, and must be installed separately. Refer to the Release Notes for details on version requirements, download sites, and installation instructions.
Table 3-4 lists Perl modules shipped with Oracle Application Server. These modules are not a part of the standard Oracle9i Application Server distribution. In order to migrate applications that use these modules from Oracle Application Server to Oracle9i Application Server, you must acquire these modules and install them. The files are available from:
http://www.cpan.org
Module | Version |
---|---|
DBI |
0.79 |
DBD::Oracle |
0.44 |
LWP or libwww-perl |
5.08 |
CGI |
2.36 |
MD5 |
1.7 |
IO |
1.15 |
NET |
1.0502 |
Data-Dumper |
2.07 |
The following points should be noted between the Oracle Application Server Perl cartridge and Oracle9i Application Server mod_perl.
In Oracle Application Server and Oracle9i Application Server, compiled Perl scripts are cached. If not properly handled, the caching of multiple Perl scripts can lead to namespace collisions. To avoid this, both Oracle Application Server and Oracle9i Application Server translate the Perl script file name into a unique packaging name, and then compile the code into the package using eval. The script is then available to the Perl application in compiled form, as a subroutine in the unique package name.
Oracle Application Server and Oracle9i Application Server form the package name differently. Oracle Application Server cannot cache subroutines with the same name. Oracle9i Application Server creates the package name by prepending Apache::ROOT::
and the path of the URL (substituting "::"
for "/
").
Oracle Application Server Perl scripts that use cgi-lib.pl
must be modified to use a version of the library customized for the Perl cartridge. This is not necessary for Oracle9i Application Server.
Oracle Application Server Perl scripts may contain instructions that need not be executed repetitively for each request of the script. Performance improves if these instructions are run only once, and only the necessary portion is run for each request of the Perl script.
In Oracle Application Server, perlinit.pl
pre-loads modules and performs initial tasks. This file is executed only once when the cartridge instance starts up. By default, there are no executable statements in this file. This file is specified by the Initialization Script parameter in the Perl Cartridge Configuration form.
There is no corresponding functionality in Apache mod_perl.
In Oracle Application Server, you can generate dynamic content using the LiveHTML cartridge by embedding Server-Side Includes (SSI) and scripts in HTML pages. If you are migrating LiveHTML applications to Oracle9i Application Server, you need to migrate LiveHTML SSI to Apache SSI. Currently the only equivalent to LiveHTML embedded scripts in Oracle9i Application Server is JavaServer Pages.
SSIs provided by Apache and LiveHTML do not have equivalent elements. The following table lists the SSIs available in Apache and LiveHTML.
Apache SSIs | LiveHTML SSIs |
---|---|
config |
config |
echo |
echo |
exec |
exec |
fsize |
fsize |
flastmod |
flastmod |
include |
include |
printenv |
- |
set |
- |
- |
request |
The syntax for specifying an SSI in Apache or LiveHTML is the same. For example:
<!--#config sizefmt="bytes" -->
SSI in Apache is implemented by the mod_include module. This module is compiled into the Apache Server by default.
In addition to the elements shown in the table above, Apache SSI also includes variable substitution and flow control elements.
In Oracle Application Server, you can use the LiveHTML cartridge to embed Perl scripts in HTML files. Because LiveHTML is a proprietary Oracle Application Server component, it does not have equivalent functionality in Oracle9i Application Server. However, JavaServer Pages allow you to embed Java code in HTML files. The JavaServer Pages 1.0 (JSP) model is implemented in Oracle9i Application Server as OracleJSP.
To migrate your LiveHTML application to Oracle9i Application Server, you must do the following:
If your LiveHTML application uses Web Application Objects in Oracle Application Server, you must implement this functionality as embedded Java code, or as JavaBean classes, and declare them with the <jsp:useBean>
tag in JSPs.
In Oracle Application Server, you can use the CWeb (or C) Cartridge to:
There is no simple migration path from Oracle Application Server CWeb Cartridges to Oracle9i Application Server. If you used CWeb to create custom cartridges you should consider creating a custom Apache module.
If you use CWeb to invoke C programs, you have the following options:
println
statements.
The Web Request Broker (WRB) and C APIs are not available in Oracle9i Application Server.
|
Copyright © 2001 Oracle Corporation. All Rights Reserved. |
|