Home > Ask the Oracle Database / Applications Experts > Oracle database internals Questions & Answers > How do I find out if a Web page is static?
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

How do I find out if a Web page is static?

Mike Ault EXPERT RESPONSE FROM: Mike Ault

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Oracle tips, scripts, and expert advice
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


>
QUESTION POSED ON: 21 September 2005
How can I automatically test for interactivity of a Web site? In other words, sometimes the site is down, and there is just a static Web page at the address. When ITBS is working, users can type in query text and receive output from the database.

I want to write a program that will email me if the database is not up and running, as opposed to just having a static page that may be working fine.


>
Mike Ault thanks Michael Cunningham for his help in responding to this question.

Here is a way to do this. This sample assumes the site is NOT https. For that the reader would need to read up on this package in Oracle document B10802-01. It also assumes the machine Oracle is on can make http requests from the Internet.

The anonymous block below looks at the Google site. On that site there is an HTML input item with the name of "q" (where the search text is typed in). The code below checks to see if the item with "name=q" exists on the HTML page. For the reader I would think he/she could do the same, but for a particular item on the page of the 'interactive' page mentioned. If the item does not exist on the page, then the text returned in the request is likely for a static page.

Also note: The http response is returned in a TABLE type. I'm only checking the first array item in the TABLE. If the http response is larger you would need to check more array items.

declare
   html_pieces utl_http.html_pieces; -- TABLE type each item is VARCHAR2(2000)
   n_length pls_integer;
begin
   html_pieces := utl_http.request_pieces( 'http://www.google.com/', 10 );
   n_length := instr( html_pieces(1), 'name=q' );
   if n_length <> 0 then
      dbms_output.put_line( 'Page is not static.' );
   else
      dbms_output.put_line( 'Page is static.' );
   end if;
end;
/


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Oracle database internals
How to find a dropped table?
Removing carriage returns at the end of clob fields
Finding length of numeric datatype field
Problem with incoming parameter in dynamic SQL statement
Reading WSID from back-end
Making a select statement faster
Select * from loc
Difference between 9i and 10g OCP exams
Concatenate values separated with commas
How to free up more space for Oracle?

Oracle database design and architecture
Why am I receiving Oracle memory allocation errors?
How to join two tables with unique keys in Oracle
Can I check an Oracle instance without logging into the Oracle server?
How does the Oracle LGWR write to online redo log files?
How to determine your SQL database through needs analysis
Breaking down the contenders in the SQL database market
The MySQL open source database in the enterprise
Diving deeper into the SQL database features
What managers should consider when starting a database scaling project
How to use V$SEGMENT_STATISTICS to find the most accessed Oracle table

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
E. F. Codd  (SearchOracle.com)
extent  (SearchOracle.com)
flexfield  (SearchOracle.com)
foreign key  (SearchOracle.com)
multidimensional database  (SearchOracle.com)
object-oriented database management system  (SearchOracle.com)
quad tree  (SearchOracle.com)
relational online analytical processing  (SearchOracle.com)
row  (SearchOracle.com)
splay tree  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts