 |
|
Oracle Database Tips by Donald Burleson
|
Tour of
the Source Code
Since this book is about PHP and Oracle, how are
all those screens above written? Here is the first look at the
directory containing the tool:
$ ls
access.php helper.inc.php RCS
sql.html
alter_parameter.php init.php resource_limit.php
sql_info.php
csr2html.php instance.html schema_filter.php
system_event.php
dba_helper.php kill_session.php security.php
system_stat.php
dba_helper.sql lock_holders.php session_info.php
tablespaces.php
db_files.php locks.html sessions_cpu.php
tblspc_free.php
event_info.php lock_waiters.php sessions.php
temp_free.php
expensive_sql.php login_form.php sessions_reads.php
user_info.php
files.html main_menu.html sessions_wait.php
wait_info.php
filestat.php parameters.php sessions_writes.php
worksheet.php
frames.html plan_info.php sga_stat.php
The tool is written as a bunch of HTML files,
mostly menus, and PHP5 scripts. Wherever it is possible, a single
menu item corresponds to a single script. This architecture makes it
easy to write new scripts or extend the old ones, if needed. What are
the prerequisites to get this tool to work? DBA_Helper depends on the
following PHP modules:
-
PEAR HTML_Table
-
PEAR HTML Form
-
ADOdb
These three modules have to be installed if the
tool is to function. Because the ADOdb module can be installed in
different places, there is a file called helper.inc.php which contains
only four rows:
<?php
require_once('adodb/adodb.inc.php');
require_once('adodb/adodb-exceptions.inc.php');
set_time_limit(0);
?>
This file has to be modified to reflect the place
where ADOdb is installed. It also turns off the time limitations for
all scripts included in the DBA_Helper tool. PHP5 has a parameter,
turned on by default, which limits the execution time of any script.
This parameter is called max_execution_timeand defaults to 30 seconds. This value can be modified or
completely eliminated for each script by using the set_time_limit
function. This function, together with the accompanying php.ini
parameter is further discussed in Chapter 8.
This feature is very useful because it ensures
that there are no runaway scripts. Whenever the limit is turned off,
it must be done with full awareness of the possible consequences. If
you want to limit the time allotted for a big database query, you can
do so by modifying the set_time_limit
line in helper.inc.php. The argument is in seconds. Occasionally, I
modify this to 60 seconds.
See
code depot for complete scripts
This is an excerpt from the book
Easy Oracle PHP. You can get it
for more than 30% by buying it directly from the publisher and get
instant HTML-DB scripts from the code depot:
 |
Easy Oracle PHP
Create Dynamic Web Pages with Oracle Data
Includes online HTML-DB code depot
Buy it now for 30% off
- Only $19.95
|
HTML-DB support:
 |
For HTML-DB development support just call to gat an
Oracle Certified professional for all HTML-DB development
projects. |
|