Posts Tagged Database

ShwetaHow to Avert and Resolve Oracle Database Corruption

Friday, April 16th, 2010

A database administrator needs to perform various operations like performing incremental backups, identifying and resolving network issues, viewing archive log destination, error generation in alert log, etc. in order to ensure that the database always remains in a running state. However, the possibility of database corruption exists due to human mistakes, virus attacks, and hardware corruption.

Database remains unmountable in most cases after it is corrupted, further rendering to inaccessibility of all its records. In such situations, if the administrator wants to access the Oracle database records, then he/she will need to use a cold backup to restore the database. However, if the administrator has not created any backup or the backup is not sufficient to meet all his/her requirements, then he/she needs to use an advanced third-party Oracle Recovery utility to repair the database.

Let’s consider a practical case, where you, as a database administrator, perform below steps:

1.You copy your database file when your database is alive.
2. Then you update the table stored in the data file.
3. After this, you shutdown the database using ’shutdown immediate’ command and change the datafile with its ‘alive’ copy.

After this, when you try to mount your Oracle database, it does not mount. The reason is-

The fundamental reason for unmountability of the database is corruption in datafile. To prevent the corruption of datafile, you should never follow the above steps sequentially.

Resolution:

It is advisable to restore the database from a standby database in order to resolve datafile corruption and to mount your Oracle database. However, if no such database exists, then you will need to repair the database. To effectively do so, you will need to search for a commercial dbf recovery application that can repair your corrupted database.

A repair tool to recover Oracle database and to bring it back to a reusable state can be easily downloaded from the Internet. Such tools can Recover Oracle Database after any logical corruption scenario using powerful recovery algorithms. Moreover, these tools do not make any change in the original database, making them completely non-destructive in nature.

For most of the Oracle database administrators, Oracle Recovery Software is a utility that they use to recover Oracle database after all kinds of logical crashes. The tool supports recovery of Oracle 9i databases. Designed for Windows XP and 2003, the read only software leaves the original database untouched and unmodified.

Tags: , , , , , ,
Posted in Editorial, Purely Technical | No Comments »

NaggieHow to build a PHP Link Scraper with cURL?

Thursday, March 4th, 2010

Let’s build a robot, which scrapes links from web pages and dumps them in a database, and then it read those links from the database and follows them, scraping up the links on those pages, and so on ad infinitum.

To begin, let’s have a look at the groundwork.

The cURL Component-

cURL (or “client for URLS”) is a command-line tool for getting or sending files using URL syntax. It was first used in 2007 by Daniel Stenberg as a way to transfer files via protocols such as HTTP, FTP, Gopher, and many others, via a command-line interface. Since then, many more contributors has participated in further developing cURL, and the tool is used widely today.

Using cURL with PHP-

PHP is one of the languages that provide full support for cURL. (Find a listing of all the PHP functions you can use for cURL.) Luckily, PHP also enables you to use cURL without invoking the command line, making it much easier to use cURL while the server is executing. The example below demonstrates how to retrieve a page called example.com using cURL and PHP.

<?php
$ch = curl_init(”http://www.example.com/”);
$fp = fopen(”example_homepage.txt”, “w”);
curl_setopt($ch, cURLOPT_FILE, $fp);
curl_setopt($ch, cURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

<?php


$ch = curl_init(”http://www.example.com/”);
$fp = fopen(”example_homepage.txt”, “w”);


curl_setopt($ch, cURLOPT_FILE, $fp);
curl_setopt($ch, cURLOPT_HEADER, 0);


curl_exec($ch);
curl_close($ch);
fclose($fp);
?>

The Link Scraper-

For the link scraper, you will use cURL to get the content of the page you are looking for, and then you will use some DOM to grab the links and insert them into your database. You can build the database from the information below; it is really simple stuff.

$query = mysql_query(”select URL from links where visited != 1);
if($query)
{

 	while($query = mysql_fetch_array($result))
 	{

$target_url = $query['url'];
$userAgent = ‘ScraperBot’;

Next, grab the URL from the database table inside a simple while loop.

$ch = curl_init();
curl_setopt($ch, cURLOPT_USERAGENT, $userAgent);
curl_setopt($ch, cURLOPT_URL,$target_url);

After instantiating cURL, you use curl_setopt() to set the USER AGENT in the HTTP_REQUEST, and then tell cURL which page you are hoping to retrieve.

curl_setopt($qw, cURLOPT_FAILONERROR, true);
curl_setopt($qw, cURLOPT_FOLLOWLOCATION, true);
curl_setopt($qw, cURLOPT_AUTOREFERER, true);
curl_setopt($qw, cURLOPT_RETURNTRANSFER,true);
curl_setopt($qw, cURLOPT_TIMEOUT, 20);

You’ve set a few more HEADERS with curl_setopt(). This time, you made sure that when an error occurs the script will return a failed result, and you set the timeout of each page followed to 20 seconds. Usually, a standard server will time-out at 30 seconds, but if you run this from your localhost you should be able to set up a no-timeout server.

$html= curl_exec($qw);
if (!$html)
{

 	echo "ERROR NUMBER: ".curl_errno($ch);
 	echo "ERROR: ".curl_error($ch);
 	exit;

}

Grab the actual page by sending the HEADERS along while executing the cURL request using curl_exec(). If an error occurs, it will be reported to PHP by the number and description inside curl_errno() and curl_error, respectively. Obviously, if such an error exists, you exit the script.

$dom = new DOMDocument();
@$dom->loadHTML($html);

Next, you create a document model of your HTML (that you grabbed from the remote server) and set it up as a DOM object.

$xpath = new DOMXPath($dom);
$href = $xpath->evaluate(”/html/body//a”);

Use XPATH to grab all the links on the page.

for ($i = 0; $i < $href->length; $i++) {

 	$data = $href->item($i);
        $url = $data->getAttribute('href');
 	$query = "INSERT INTO links (url, gathered_from) VALUES ('$url', '$gathered_from')";
 	mysql_query($query) or die('Error, insert query failed');
        echo "Successful Link Harvest: ".$url;
 	}

}

Dump all the links into the database, as well as the URL they are gathered from, just so you never go back there again. A more intelligent system might have a separate table for URLs already visited, as well as a normalized relationship between the two.

Going a step further than just grabbing the links enables you to harvest images or entire HTML documents as well. This is kind of where you start when building a search engine. Creating your own search engine may seem naively ambitious, and this little bit of code may inspire you a bit.

Source:- http://www.developer.com

http://www.all1social.com

http://www.all1martpro.com

Tags: , , , , ,
Posted in Editorial, Expert's Opinions, Purely Technical | No Comments »

Suzanne[PHP]Sending MySQL data.

Saturday, February 27th, 2010
<?Php
$db_host = "1.3.3.7"; // mySQL database host
$db_user = "dbplz"; // mySQL database user
$db_password = "rofl"; // mySQL database password
$db_name = "dbplz"; // the name of your mySQL database

//connect to our database.
  mysql_connect($db_host,$db_user,$db_password) or die(mysql_error());
// Select the database.
  mysql_select_db($db_name) or die(mysql_error());
//Define the data as $query
$query = "INSERT INTO tablename (row1, row2, row3, row4)
VALUES ('$variable1','$variable2','$variable3','$variable4')";
  mysql_query($query);
  mysql_close();

// it's almost always imperative to strip tags or the data usually doesn't send properly.
$variable = strip_tags($_POST['variable'], '');
//and now send the data
  mysql_query($query);
  mysql_close();
?>

http://www.all1martpro.com

http://www.all1sourcetech.com

Tags: , , , ,
Posted in Editorial, Purely Technical | 1 Comment »

NaggieOpenOffice.org Releases Version 3.2

Saturday, February 13th, 2010

openof11 OpenOffice.org Releases Version 3.2

On Thursday, the organization announced that OpenOffice 3.2 is now available for download.

The latest version of the productivity suite- which is intended to be an open-source alternative to Microsoft Office- boasts faster start-up times, ODF support, proprietary file support, support for postscript-based OpenType fonts, and more.

The release comes after OpenOffice.org hit a milestone of 300 million downloads over the course of its 10-year history, 100 million of which occurred from the organization’s main Web site.

The suite includes basic components like word processor, spreadsheet, presentation, graphics, and formula and database capabilities. Improvements to those components the version 3.2 boasts, including the Calc spreadsheet. The Chart module, meanwhile, received a “usability makeover” and includes new chart types.

Some people are currently locked in to other personal productivity tools – maybe by corporate IT policy, or by tie-in to other legacy software. For everyone else, we want OpenOffice.org to be the 2010 office software of choice, and 3.2 takes us another step towards that goal,” said Florian Effenberger, marketing project lead of OpenOffice.org.

Version 3.2 is available for download on the organization’s Web site.

Tags: , , , , , , , , , , , ,
Posted in Linux Technology, Opensource, Technical News | No Comments »

NaggieOpera Develops Mini Browser for Apple’s iPhone

Saturday, February 13th, 2010

Opera announced to release it’s newly developed version of its Opera Mini web browser for Apple’s iPhone, which will be demonstrated at the Mobile World Conference in Barcelona, Spain.

The cofounder of Opera Software, Jon von Tetzchner said he is “thrilled” to offer the preview and added that the software provides a “fast, feature-rich” experience for iPhone users. Opera on the iPhone brings the company “one step closer” to its mission of “bringing the web to the world”.

Will Apple Approve?

However, the big question is whether Apple will approve Opera as an iPhone application on its App Store. Apple currently only accepts browsers that run on the WebKit engine — the same engine that powers Apple’s Safari browser.

But Apple has gotten into hot water with the Federal Trade Commission over its initial refusal to certify Voice over Internet Protocol applications, Rob Enderle, principal analyst with the Enderle Group, noted. This time around, Apple will be hard-pressed to exclude competitors.

Enderle said, Given Apple is under FTC review for their application approval process, I don’t think they can refuse this application — but they could break it or limit its capability. “For instance, both the ARM processor and the Opera browser support flash on other platforms, but Apple will likely make sure Flash doesn’t work on Opera any better than it does on Safari on the iPhone.”

“Changing defaults will likely be difficult as well,” Enderle added, “so that it is the Safari browser that opens when you click on a link. If Opera gets on the phone, it is likely that [Google's] Chrome will soon follow, and Apple will do whatever it can to make sure that never happens.”

Advanced Features

Currently, Opera Mini 5 in beta boasts quite a few advanced features over Safari, including tabbed browsing so users can view several sites simultaneously and “easily jump from one to another,” the company said. Another feature is Speed Dial, a display of frequently used pages so users can launch a favorite site with just one click, a feature Safari and Chrome offer in desktop versions but not on smartphones. There’s also Opera Link, which synchronizes bookmarks and Speed Dial between the user’s mobile phone and desktop computer, and Download Manager, which manages downloads from the browser.

According to Opera, its browser offers an intuitive, easy-to-user interface, and is much faster than other browsers because it compresses web pages as much as 90 percent before downloading. Other features include adaptive zoom, in-page searching, landscape mode, and kinetic scrolling.

A senior research analyst at IDC, Raman Llamas said, Opera has a great browser and offers a great experience.

Lucky in 2010?

In 2008, von Tetzchner told The New York Times that Opera had started work on an iPhone version of Opera but stopped development because of Apple’s restrictive developer agreements. Apple initially banned all third-party browsers but finally allowed other browsers based on WebKit.

Around this time, von Tetzchner clearly feels he will have more luck with Apple. Indeed, given that Opera is making a big deal about the availability of Opera Mini 5 for iPhone, Opera may have already received Apple’s blessing.

According to Christen Krogh, Opera’s chief development officer, Opera Mini is compatible with every requirement for the App Store. Krogh also said, there aren’t any identical applications on the iPhone, discounting Safari as an identical application. Opera Mini is a different kind of browser, so we cannot see any conflict with any requirements in the App Store.

Krogh said Opera hasn’t yet submitted the application to the App Store. “We’re comfortable enough [with] where Opera Mini is at to show it to select partners and journalists,” he said. “It won’t take long before we’re ready to submit it to the App Store.”

Tags: , , , , , , , , , , ,
Posted in New Product Release, Opensource, Technical News | No Comments »

NaggieGoogle launches Chinese holiday travel map amid row

Wednesday, February 3rd, 2010

A map search service has been launched by Google in China for travelers taking trips during the Lunar New Year holiday season, despite a row over cyber attacks and censorship.

According to a spokeswoman for Google China, Marsha Wang, the service is available online now. The Google Spring Festival Map is based on the company’s regular map service but has “more features” targeting users’ special needs during this month’s holiday, the busiest travel period of the year in China, she said.

The statement posted on googlechinablog.com said, the special map provides information including real-time flight status, train schedules and ticket prices, highway conditions and weather updates.

The government estimates says that about 240 million people are expected to crowd China’s trains and planes for the holiday.

Chinese traditionally return to their home towns and villages for family reunions with this year’s travel period stretching from January 30 to March 10. The Lunar New Year falls on February 14.

Last month, Google threatened to abandon its Chinese-language search engine google.cn, and perhaps end all operations in the country, following hack attacks it says targeted the email accounts of Chinese human rights activists. It has also said it is no longer willing to bow to Beijing’s army of Internet censors — and will stop filtering search results soon, a move China says would violate its laws.

The US and Chinese officials have discussed the issue at length, with US Secretary of State Hillary Clinton qualifying her latest talks with Chinese Foreign Minister Yang Jiechi as “open and candid.” But the row is one of an ever-increasing list of issues threatening relations between the United States and China.

Google chief executive Eric Schmidt reiterated last week at the World Economic Forum in Davos that the Internet giant wanted to stay in China, but also said he hoped censorship rules would change.

According to Wang, it was “business as usual” at Google China’s headquarters in Beijing.

http://get-a-designer.com

http://www.all1sourcetech.com

Tags: , , , , , , , , , , ,
Posted in Expert's Opinions, Technical News | No Comments »

NaggieChina Tablet PC Maker May Sue Apple Over IPad Design

Monday, February 1st, 2010

ipad touch cover China Tablet PC Maker May Sue Apple Over IPad Design

A Chinese company, selling a tablet PC like Apple’s newly announced iPad, may sue the US Company over the similar design between the devices, said the company Monday.

Last Year, Shenzhen Great Loong Brother Industrial started selling its P88 tablet and is not ruling out a lawsuit against Apple, a company representative surnamed Wu said by phone.

The company is based in a southern Chinese city known for producing knock-off phones, which are called “shanzhai,” or “bandit” phones, and sometimes takes the form of counterfeit iPhones or other popular handsets.

According to Wu, we are not shanzhai for these things, because we were first.

The P88 weighs more than the iPad and has much shorter battery life at just over one hour during active use, compared to Apple’s stated battery life of 10 hours for the iPad. But both devices use touchscreens that have a black border and a similar size, at 10.2 inches for the P88 and 9.7 inches for the iPad. Wu said his company’s tablet is sold in the U.S., but declined to say at which outlets.

No immediate comment was returned from an Apple’s spokeswoman.

China’s gray market for electronic devices also reacted quickly to Apple’s announcement of the iPad last week. Some users on Taobao.com, a Chinese auction and retail site, are taking pre-orders for iPads they will first obtain in Hong Kong or elsewhere. Popular devices such as the iPhone or the Hero from Taiwan’s High Tech Computer (HTC) are often brought into China informally and sold there online or at electronics bazaars.

Apple has not yet cleared that if the iPad will be sold in China. Local carrier China Unicom started selling the iPhone last year, but gray-market versions of the device were already widely sold in China.

And according to Japanese electronics company Fujitsu, it owns the rights to the name “iPad,” raising another possible legal challenge for the Apple device.

http://www.all1martpro.com

http://www.all1sourcetech.com

Tags: , , , , , , , , , , , , ,
Posted in Technical News | No Comments »