TIME() - 1){ // users will get this message if they make requests faster than 1 per second print "
To prevent overloading our server, please lower the rate of your page requests to less than 1 per second."; // try and get the real IP address... if (getenv('HTTP_CLIENT_IP')) { $ip_address = getenv('HTTP_CLIENT_IP'); }elseif (getenv('HTTP_X_FORWARDED_FOR')) { $ip_address = getenv('HTTP_X_FORWARDED_FOR'); }elseif (getenv('HTTP_X_FORWARDED')) { $ip_address = getenv('HTTP_X_FORWARDED'); }elseif (getenv('HTTP_FORWARDED_FOR')) { $ip_address = getenv('HTTP_FORWARDED_FOR'); }elseif (getenv('HTTP_FORWARDED')) { $ip_address = getenv('HTTP_FORWARDED'); }else { $ip_address = $_SERVER['REMOTE_ADDR']; } $REQUEST_LIMIT = 20; include('/var/www/virtual/psoug.org/htdocs/psconfig.php'); $_SESSION['request_count'] = $_SESSION['request_count'] + 1; $req_count = $_SESSION['request_count']; // try to update the offending IP... $throttle_sql = "UPDATE `bw_throttle` SET req_count = (req_count+1), last_req_time = NOW() WHERE req_ip = '$ip_address'"; $throttle_result = mysql_query($throttle_sql); if(mysql_affected_rows() <> 1){ // if the update wasn't successful then the record // doesn't exist, so add the offender to the list if($DIAG=='1'){print 'Adding Offender.....
';} $throttle_sql = "INSERT INTO `bw_throttle` (init_time, last_req_time, req_ip, req_count, delay_time) VALUES (NOW(), NOW(), '$ip_address', '1', '$delay_time')"; $throttle_result = mysql_query($throttle_sql); }else{ // the offender was updated. Check to see if they've hit the limit if($DIAG=='1'){print 'Updated.....
';} $limit_check = "SELECT * FROM bw_throttle WHERE req_ip = '$ip_address'"; $limit_result = mysql_query($limit_check); list($init_time, $last_req_time, $req_ip, $req_count, $delay_time) = mysql_fetch_array($limit_result); if($DIAG=='1'){print "LIMIT COUNT: $req_count
";} if($req_count > $REQUEST_LIMIT){ // add them to the blacklist table, delete from bw_throttle table if($DIAG=='1'){print 'Adding Offender to BLACKLIST table...
';} // get difference between the two in seconds $time_period = ( strtotime($last_req_time) - strtotime($init_time) ); $request_data = "Made $req_count overload requests in $time_period seconds"; if($time_period > 60){ $hours = intval(intval($time_period) / 3600); $hms .= ($padHours) ? str_pad($hours, 2, "0", STR_PAD_LEFT). ':' : $hours. ':'; $minutes = intval(($time_period / 60) % 60); $hms .= str_pad($minutes, 2, "0", STR_PAD_LEFT). ':'; $seconds = intval($time_period % 60); $hms .= str_pad($seconds, 2, "0", STR_PAD_LEFT); $request_data .= "($hms)"; } $bl_sql = "INSERT INTO `ip_blacklist` (`ip_address`, `time_stamp`, `qstring`) VALUES ('$ip_address', NOW(), '$request_data')"; $bl_result = mysql_query($bl_sql); /////////////////////////////////////////// $headers = ''; $to = 'info@psoug.org'; $subject = "ORA User Block Added: $ip_address"; $message = "Oracle Error Reference Library\nA user block was added:\n\nIP: $ip_address\nRequest Data: $request_data"; $headers = "From: waylon@deltabravo.net\r\n"; $headers .= "Return-Path: waylon@deltabravo.net\r\n"; // send email mail($to,$subject,$message,$headers); /////////////////////////////////////////// // remove from bw_throttle table if($DIAG=='1'){print 'Deleting Offender from bw_throttle table...
';} $remove_sql = "DELETE FROM bw_throttle WHERE req_ip = '$ip_address'"; $remove_result = mysql_query($remove_sql); } } exit; } $_SESSION['last_session_request'] = TIME(); ////////////////////////////////////////////// ///////////////////////////////////// // possible include files include('/var/www/virtual/psoug.org/htdocs/psconfig.php'); include('/var/www/virtual/psoug.org/htdocs/util/sanitize.php'); include('/var/www/virtual/psoug.org/htdocs/util/paginator.php'); $use_bottom_ad='1'; $expand_tag = <<
Want to expand, correct, or add to this information? Please contact us!
EOM; ///////////////////////////////////// $header_code = << EOM; // any error message to display? if($_SESSION['error_message'] != ''){ $error_message = $_SESSION['error_message']; unset($_SESSION['error_message']); } ///////////////////////////////////// // get incoming vars $term = preg_replace("/[^0-9a-zA-Z-]/i",'', $_REQUEST['term']); $pageURL .= $_SERVER["REQUEST_URI"]; // get just the term with no path or '.htm' $term = strtolower(substr($pageURL, strrpos($pageURL, '/')+1, -4)); //$term = strtolower(basename($pageURL,'.htm')); // set meta description $meta_desc = "18,000 Oracle Error Codes: ORA, SQL*Loader, RMAN, NNL, TNS, DRG, IMG, PCC, LPX, LSX, and many others."; $term_sql = "SELECT * from ora_errors WHERE e_errnum = '$term'"; $term_result = mysql_query($term_sql); if(mysql_num_rows($term_result) < 1){ // clear the term, skip any further processing, // then re-display the selection box and list $term = ''; }else{ // end term not found $error_found = '1'; $term_row = mysql_fetch_array($term_result); $e_errnum = $term_row['e_errnum']; $e_title = trim($term_row['e_title']); $e_cause = trim($term_row['e_cause']); $e_action = trim($term_row['e_action']); $e_title = ucfirst($e_title); $e_cause = ucfirst($e_cause); $e_action = ucfirst($e_action); // cosmetic fixups // if there isn't a period at the end of the CAUSE, add one if(substr($e_cause, -1) != '.'){$e_cause .= '.';} // if there isn't a period at the end of the ACTION, add one if(substr($e_action, -1) != '.'){$e_action .= '.';} ///////////////////////////////////// $comment_table .= <<
Add a comment 
EOM; ///////////////////////////////////// ///////////////////////////////////// // deal with missing cause and action if($e_cause == 'missing'){ $e_cause = "We don't have the cause information for Oracle error #$e_errnum. If you have information on the cause of this error, please leave a comment below."; } if($e_action == 'missing'){ $e_action = "We don't have any information on the action required to resolve Oracle error #$e_errnum. If you have information on resolving this error, please leave a comment below."; } ///////////////////////////////////// // check to see if there are any comments for this page $comment_sql = "SELECT * FROM comments WHERE page_id = '$e_errnum' AND enabled = 'y' LIMIT 20"; $comment_result = mysql_query($comment_sql); $num_comments = mysql_num_rows($comment_result); //print "COMSQL: $comment_sql
"; //print "Comments Found: $num_comments"; // if there are comments, format them if($num_comments > 0){ $comment_table .= ''; while($comment_row = mysql_fetch_array($comment_result)){ $cm_name = $comment_row['user_name']; $cm_site = $comment_row['user_site']; $cm_comment = nl2br($comment_row['user_comment']); $cm_date = $comment_row['time_date']; $posted_date = date('M jS, Y g:ia', strtotime($cm_date)); // add link if present if($cm_site != ''){$cm_name = "$cm_name";} $comment_table .= "\n"; $comment_table .= "\n"; // remove uneeded tags $comment_table = str_replace('', '', $comment_table); $comment_table = str_replace('', '', $comment_table); } $comment_table .= '
$cm_name$posted_date
$cm_comment
'; }else{ // add the 'no comments yet' text and styling to the comments box line $comment_table = str_replace('', 'There haven't been any comments added for this error yet. You may add one if you like. ', $comment_table); $comment_table = str_replace('', 'background-color:#a5d8f6;padding:3px;', $comment_table); } // set meta description $meta_desc = "$e_errnum: " . strip_tags(substr($e_title, 0, 150)); // for seo style links $term_def = preg_replace("|(.+?)|si", "$1", $e_errnum); // check for the tag $term_def = str_replace('', $expand_tag, $term_def); // strip breaks from zones $term_def = preg_replace_callback('/(.*)<\/NBRK>/msi', create_function('$matches', 'return preg_replace(array("/
/msi","/\n/"),"", $matches[1]);'), $term_def); } // end if term found $term_box = <<18,000 Oracle Error Codes currently indexed for searching, including error codes for SQL*Loader, RMAN, NNL, TNS, DRG, IMG, PCC, LPX, LSX, and many others.

Type the Oracle Error code into the Search box to find the associated error:
 

Or, browse the Oracle Error list below:

EOM; if($term_title == ''){$term_title = 'Oracle PL/SQL Error Codes and Explanations';} ///////////////////////////////////// // set title bar if($e_errnum != ''){ $titlebar_text = "Oracle Database Error: $e_errnum - " . strip_tags(substr($e_title, 0, 35)); }else{ $titlebar_text = "Oracle Error Code Reference Library"; } if($e_errnum != ''){ $page_title = "Oracle Database Error: $e_errnum"; }else{ $page_title = "Oracle Error Code Reference Library"; } $header_bar_text = $page_title; // add index link to $header_bar_text $header_bar_text .= "      [Return To Oracle Error Index]"; ///////////////////////////////////// // optional page bgcolor //$BCOLOR = "bgcolor='#D8D8C4'"; ///////////////////////////////////// // get header include('/var/www/virtual/psoug.org/htdocs/header.php'); print << $error_message EOM; if($error_found == '1'){ print <<Oracle Error: $e_errnum

Error Description:
$e_title

Error Cause:
$e_cause

Action:
$e_action

$comment_table EOM; }else{ print << 50){$e_title = substr($e_title, 0, 47) . '...';} $e_title = ucfirst($e_title); ///////////////////////////////////// if($itemcount == 0){ $tableblock = << EOM; } if($itemcount == ($limit / 2)){ $tableblock .= ''; $LIST1 = $tableblock; $tableblock=''; $tableblock = << EOM; } $tableblock .= <<$e_errnum: $e_title EOM; $itemcount++; // if we've hit the limit, finish the 2nd table if($itemcount == $limit ){ $tableblock .= ''; $LIST2 = $tableblock; } ///////////////////////////////////// } print << $LIST1$LIST2 EOM; print $paginator; } print << EOM; // get footer include('/var/www/virtual/psoug.org/htdocs/footer.php'); ?>