Bluehost.com Web Hosting $6.95

Oracle + PHP + long process

This is a discussion on Oracle + PHP + long process within the PHP Language forums, part of the PHP Programming Forums category; Hi all, Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB on a separate Linux ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-05-2006
Geoff Muldoon
 
Posts: n/a
Default Oracle + PHP + long process

Hi all,

Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB
on a separate Linux box.

I need to create a PHP web interface to allow an end-user to run a PL/SQL
stored proc that will do a force refresh of a series of materialized views
following the loading (through another PHP interface) of additional flat
file data into the underlying tables. I want to allow multiple data
uploads and then do a single refresh, so I won't be able to use fast
refresh or other internal database trigger mechanisms.

My real problem is that the time taken to execute the stored proc is
likely to considerably exceed the max script execution time for PHP, and I
don't want the end-user interface to just sit there bubbling away waiting
for the Oracle processes to return a response anyway.

I am considering creating a "master" PL/SQL stored procedure which would
use the Oracle DBMS_SCHEDULER package to run a nearly-immediate job as a
"background" (to the PHP interface) process.

Is this the way to go, or are there other better solutions that I am
overlooking?

TIA

Geoff M

Reply With Quote
  #2 (permalink)  
Old 10-05-2006
Andy Hassall
 
Posts: n/a
Default Re: Oracle + PHP + long process

On Thu, 5 Oct 2006 15:03:17 +1000, Geoff Muldoon <geoff.muldoon@trap.gmail.com>
wrote:

>Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB
>on a separate Linux box.
>
>I need to create a PHP web interface to allow an end-user to run a PL/SQL
>stored proc that will do a force refresh of a series of materialized views
>following the loading (through another PHP interface) of additional flat
>file data into the underlying tables. I want to allow multiple data
>uploads and then do a single refresh, so I won't be able to use fast
>refresh or other internal database trigger mechanisms.
>
>My real problem is that the time taken to execute the stored proc is
>likely to considerably exceed the max script execution time for PHP, and I
>don't want the end-user interface to just sit there bubbling away waiting
>for the Oracle processes to return a response anyway.
>
>I am considering creating a "master" PL/SQL stored procedure which would
>use the Oracle DBMS_SCHEDULER package to run a nearly-immediate job as a
>"background" (to the PHP interface) process.
>
>Is this the way to go, or are there other better solutions that I am
>overlooking?


Sounds like a reasonable approach to me; I was thinking of DBMS_JOB whilst
reading this, but since you're on 10g then DBMS_SCHEDULER is better. You may be
able to monitor the progress of the refresh through v$session_longops - I don't
remember whether mview refreshes show up in there, though - not all operations
do.

--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Reply With Quote
  #3 (permalink)  
Old 10-05-2006
Colin McKinnon
 
Posts: n/a
Default Re: Oracle + PHP + long process

Geoff Muldoon wrote:

>
> Oracle 10g RAC on Linux, with an end-user interface via Apache/PHP/AdoDB
> on a separate Linux box.
>

<snip>
>
> I am considering creating a "master" PL/SQL stored procedure which would
> use the Oracle DBMS_SCHEDULER package to run a nearly-immediate job as a
> "background" (to the PHP interface) process.
>
> Is this the way to go, or are there other better solutions that I am
> overlooking?
>


You mean apart from
1) not using materialized views
2) ditching Oracle and rewriting with just about any other DBMS ?
;)

You could look at the thread started slightly later today in comp.lang.php
'process a BIG string' but using the DBMS scheduler is probably the
practical way to go.

C.

Reply With Quote
  #4 (permalink)  
Old 10-06-2006
Mladen Gogala
 
Posts: n/a
Default Re: Oracle + PHP + long process

On Thu, 05 Oct 2006 15:07:11 +0100, Andy Hassall wrote:

> Sounds like a reasonable approach to me; I was thinking of DBMS_JOB whilst
> reading this, but since you're on 10g then DBMS_SCHEDULER is better. You may be
> able to monitor the progress of the refresh through v$session_longops - I don't
> remember whether mview refreshes show up in there, though - not all operations
> do.


I second that. DBMS_SCHEDULER is the way to go. Unfortunately,
materialized view refreshes do not show as longops.

--
http://www.mladen-gogala.com

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 12:29 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0