01.09.2016 Views

Beginning Oracle Database 11g Administration From Novice to Professional

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 13 RECOVERY 291<br />

<br />

<br />

<br />

<br />

<br />

<br />

Note that LogMiner works as advertised only if you have enabled minimal supplemental<br />

logging. According <strong>to</strong> the <strong>Oracle</strong> <strong>Database</strong> <strong>11g</strong> documentation, this “ensures that<br />

LogMiner (and any products building on LogMiner technology) has sufficient information<br />

<strong>to</strong> support chained rows and various s<strong>to</strong>rage arrangements such as cluster tables<br />

and index- organized tables.” The command that enables minimal supplemental logging<br />

is .<br />

A complete discussion of LogMiner can be found in Chapter 18 of <strong>Oracle</strong> <strong>Database</strong><br />

<strong>11g</strong> Utilities.<br />

Data Recovery Advisor<br />

Physical recovery usually requires the use of Recovery Manager. The two most powerful<br />

RMAN repair commands are simply and . The first command<br />

res<strong>to</strong>res all data files from the last backup. The second command uses the redo logs<br />

and recovers all the changes made since the backup. But full database recovery using the<br />

and commands is not required in all cases. The most<br />

appropriate database strategy is one that is tailored <strong>to</strong> the situation, and RMAN provides<br />

a wide range of repair options that might overwhelm the beginner. However, <strong>Oracle</strong> <strong>Database</strong><br />

<strong>11g</strong> also provides a powerful <strong>to</strong>ol called Data Recovery Advisor (DRA) that greatly<br />

simplifies the database administra<strong>to</strong>r’s job.<br />

We demonstrate physical recovery by using DRA <strong>to</strong> repair corrupt blocks, the same<br />

situation described in my first horror s<strong>to</strong>ry. In those days, <strong>Oracle</strong> did not offer the capability<br />

<strong>to</strong> repair individual blocks while the rest of the database was still being used, though<br />

it did offer the capability <strong>to</strong> repair individual files. Block recovery is the least invasive of<br />

all recovery operations, and DRA makes the process as easy as it is possible <strong>to</strong> imagine.<br />

I decided <strong>to</strong> intentionally corrupt one of the data blocks in the table in the<br />

sample schema, and the view gave me the information I needed <strong>to</strong> determine<br />

exactly which blocks <strong>to</strong> corrupt. I shut down the database and modified the file<br />

containing those blocks by using a binary edi<strong>to</strong>r. Then I started the database, and everything<br />

worked normally until I tried <strong>to</strong> list the contents of the table. SQL Developer then<br />

displayed the error dialog shown in Figure 13-2.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!