2011-04-28

Trial Recovery

Trial Recovery [ID 283262.1]
n the case of stuck recovery, you have a difficult choice. If the block is relatively unimportant, and if the problem is isolated, then it is better to corrupt the block. But if the problem is not isolated, then it may be better to open the database with the RESETLOGS option.

Because of this situation, Oracle supports trial recovery. A trial recovery applies redo in a way similar to normal media recovery, but it never writes its changes to diskand it always rolls back its changes.
Trial recovery occurs only in MEMORY.
If a trial recovery encounters a stuck recovery or similar problem, then it always marks the data block as corrupt in MEMORY when this action can allow recovery to proceed. Oracle writes errors generated during trial recovery to ALERT.log files. Oracle clearly marks these errors as test run errors.

Like normal media recovery, trial recovery can prompt you for archived log filenames and ask you to apply them

Solution

How Trial Recovery Works ?


If a trial recovery encounters a stuck recovery or similar problem, then it always marks the data block as corrupt in memory when this action can allow recovery to proceed. The database writes errors generated during trial recovery to alert files. These errors are clearly marked as test run errors.

Like normal media recovery, trial recovery can prompt you for archived log filenames and ask you to apply them.

When Trial recovery ends ?

  • The database runs out of the maximum number of buffers in memory that trial recovery is permitted to use.
  • An unrecoverable error is signaled, that is, an error that cannot be resolved by corrupting a data block
  • You cancel or interrupt the recovery session.
  • The next redo record in the redo stream changes the control file.
  • All requested redo has been applied.
When trial recovery ends, the database removes all effects of the test run from the system—except the possible error messages in the alert files. If the instance fails during trial recovery, then the database removes all effects of trial recovery from the system because trial recovery never writes changes to disk.

Trial recovery lets you foresee what problems might occur if you were to continue with normal recovery. For problems caused by ongoing memory corruption, trial recovery and normal recovery can encounter different errors.


How to use TEST option for any RECOVER command ?

For example, you can start SQL*Plus and then issue any of the following commands:
RECOVER DATABASE TEST
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL TEST
RECOVER TABLESPACE TEST
RECOVER DATABASE UNTIL CANCEL TEST



By default, trial recovery always attempts to corrupt blocks in memory if this action allows trial recovery to proceed. In other words, trial recovery by default can corrupt an unlimited number of data blocks. You can specify the ALLOW n CORRUPTION clause on the RECOVER ... TEST statement to limit the number of data blocks trial recovery can corrupt in memory. For an example
SQL>RECOVER DATABASE TEST ALLOW n CORRUPTION;


-- where n is the number of blocks.

Note :
  • A trial recovery command is usable in any scenario in which a normal recovery command is usable.
  • Trial recovery only works for Enterprise Edition and Personal Edition.

Niciun comentariu:

Trimiteți un comentariu