Home > Ask the Oracle Experts > Oracle 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.


>
EXPERT RESPONSE
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 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 internals
LAST_OPER_TYPE column in v$sga_dynamic_components
Inside the Oracle 11g SQL Performance Advisor, part 1
Inside the Oracle 11g SQL Performance Advisor, part 2
How to read a STATSPACK report
Tuning the Oracle database with initialization parameters
Cannot create services in Oracle 9i
Move tables from system tablespace to users tablespace
Move Oracle home to another partition
Limit on CLOB datatype in Oracle 10g
Logging into Oracle utilities when database is down
Oracle internals Research

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
autonomous transaction  (SearchOracle.com)
delimiter  (SearchOracle.com)
extent  (SearchOracle.com)
flexfield  (SearchOracle.com)
responsibility  (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

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

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




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