Stopping and restarting Oracle

From: Date: Fri, 12 Apr 2002 10:41:49 +0000
Subject: Stopping and restarting Oracle
Groups: php.db 
Request: Send a blank email to php-db+get-18450@lists.php.net to get a copy of this message
Can anyone help. this is driving me insane. I am trying to write a script that allows users to configure their Oracle server (change tnsnames.ora, listener.ora, update some synomyms to allow them to connect to a remote Oracle server, etc). I'm using exec() and sudo on Linux to allow the Apache's nobody user to run the startup and shutdown scripts for Oracle. I can shut down Oracle and start it back up again (soft of) using the script below. print "Closing down Oracle "; flush(); exec("sudo /etc/rc.d/init.d/dbora stop"); print "Done "; flush(); // Write out new tnsnames.ora and listener,.ora from the data provided by the user print "<br>Restarting Oracle with new configuration"; flush(); exec("sudo /etc/rc.d/init.d/dbora start"); print "Done"; flush(); Everything works EXCEPT I cannot get it to return from the 'dbora start' command. The PHP script just sits there and won't budge. I've tried putting an exit command into the dbora script to make it die when it's finished but that doesn't seem to work either. Why should the same script, with different parameters, act differently? I've tried using shell_exec() to see if that makes any difference. Sometime it works and continues after restarting Oracle, sometimes is doesn't!!! $msg=shell_exec("sudo /etc/rc.d/init.d/dbora start"); echo $msg; flush(); Any help would be greatly appreciated. Brian Higgins

« previous php.db (#18450) next »