Monday, May 31, 2010

Oracle mod_plsql FAQ

Oracle mod_plsql FAQ:

Contents [hide]
1 How does one start and stop MOD_PLSQL?
2 What is MOD_PLSQL and what can one use it for?
3 How does one configure MOD_PLSQL?
4 Can I install MOD_PLSQL on a non-Apache server?
5 How does one program using MOD_PLSQL?
6 How does one use HTTP COOKIEs?
7 Can a Web page be refreshed/reloaded after a given interval?
8 How can one page forward and backwards through a table?
9 How to do multi-user updates using the Oracle WebServer?
10 Can one use Oracle Designer to generate Web applications?
11 Can one use a different Web Server from the one included by Oracle?
12 Should one access Oracle via the CGI interface or the WRB?
13 We want to do some more advanced authentication. What are my options?
14 I'm storing userids in a table. How does one encrypt the passwords?
15 Are there alternatives to keeping authentication information in the configuration file?
16 How does one program using the WRB API?
17 Can one store and retrieve images from an Oracle table?
18 I've lost the Web Server Administrator's password. What can one do?

[edit] How does one start and stop MOD_PLSQL?
By default MOD_PLSQL is started when the Oracle HTTP Server (Apache) is started. There are no special commands to stop and start it.

[edit] What is MOD_PLSQL and what can one use it for?
MOD_PLSQL is an Apache (Web Server) extension module that allows one to create dynamic web pages from PL/SQL packages and stored procedures. It is ideal for developing fast and flexible applications that can run on the Internet or an Intranet. MOD_PLSQL was formerly called the Oracle PL/SQL Cartridge and OWA (Oracle Web Agent).

For more information about the Apache server, see the HTTP Server FAQ. More information about PL/SQL can be obtained from the PL/SQL FAQ.

The Mod_PLSQL Architecture:

+-CLIENT-+ +-----------------S E R V E R---------------+
| | | |
| Web | <--Internet--> | Oracle HTTP <--> mod_plsql <--> Oracle |
| Browser| HTTP | Server Database |
| | | |
+--------+ +-------------------------------------------+
[edit] How does one configure MOD_PLSQL?
Start a Web Browser like Netscape Navigator and Internet Explorer and navigate to the MOD_PLSQL Gateway Configuration Menu (http://your.host.name:7777 and click on "mod_plsql"). Click on "Gateway Database Access Descriptor Settings". Select one of the options to add a new DAD (Database Access Descriptor). Enter at least the following fields:

Database Access Descriptor (DAD) Name
Schema Name
Oracle User Name
Oracle Password
Oracle Connect String (if not the local DB)
Click on "Apply" to make your changes permanent.

Configuration parameters and log files are stored in the $ORACLE_HOME/Apache/modplsql subdirectory.

[edit] Can I install MOD_PLSQL on a non-Apache server?
No, you cannot. MOD_PL/SQL is an Apache add-on module that was specifically written for Apache. Luckily Apache is available on almost all operating systems including Windows, Linux, etc.

[edit] How does one program using MOD_PLSQL?
Standard Oracle PL/SQL programs can be extended to include MOD_PLSQL The Oracle Web Agent extends the Common Gateway Interface (CGI) to Oracle PL/SQL stored procedures. Programming is done in PL/SQL using the following set of packaged procedures:

HTP - Hypertext Procedures
HTF - Hypertext Functions
OWA_UTIL - Oracle Web Agent Utilities
OWA_COOKIE - Send end retrieve Web Browser Cookies
Etc.
Example PL/SQL procedure:

CREATE OR REPLACE PROCEDURE HelloWorld AS
BEGIN
htp.htitle('My first dynamic Web page');
htp.print('Hello world');
htp.line;
END HelloWorld;
/
To run this example you would typically provide an URL like this to your Web Browser:

http://your.host.name/pls//HelloWorld
[edit] How does one use HTTP COOKIEs?
Cookies allow any site to store information on a WEB Browser's hard disk (cookie.txt file). This information is sent back to the originating site whenever you access it again. Look at this code example:

owa_util.mime_header ('text/html', FALSE);
owa_cookie.send (cuid, xsession_id, sysdate+1);
owa_util.http_header_close;
[edit] Can a Web page be refreshed/reloaded after a given interval?
Yes, use the OWA_UTIL.REDIRECT_URL function. Alternitively, look at the code example below:



Post a Comment

Receive All Free Updates Via Facebook.