Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Sunny.

Asked: April 29, 2017 - 12:56 pm UTC

Last updated: May 02, 2017 - 2:54 am UTC

Version: 11G R2

Viewed 10K+ times! This question is

You Asked

I read " professional oracle programming 2005 " book.

http://arsamandish.com/dl/ebook/oracle/Professional%20Oracle%20Programming%202005.pdf

On page number 4 , I snippet a text as here.

Redo Log Files :-
---------------
One of key features of a relational database is its ability to recover to a logically consistent state, even in
the event of a failure. Every relational database, including Oracle, uses a set of redo log files. These files
keep track of every interaction with the database. In the event of a database failure, an administrator can
recover the database by restoring the last backup and then applying the redo log files to replay user
interactions with the database.
Redo log files eventually fill up and roll over to start a new volume. You can set up Oracle to avoid writing
over existing log-files by creating the database to automatically archive log files in ARCHIVELOG mode,
which is discussed in detail in the Oracle documentation.
Since redo logs are crucial for restoring a database in the event of a failure, many Oracle shops set up an
instance to keep multiple copies of a redo log file.


Now When I try to practically I take backup of database using RMAN and I do create some table and insert some record so new changes done on after taking backup.
But I want to learn or do practically live how to recover database using redo log file.

so how to simulate it our own laptop?

and Connor said...

With RMAN, an easy way would be a recovery to a point in time, eg

1) 9am, take a full backup
2) 9:10am, create some new tables, add rows etc etc
3) use RMAN to recover to 9:05am
4) prove that the new changes are no longer there

Then you've proven that RMAN can recover to a point that is *not* the same as the point in time that the backup was taken.

If you want to do all this manually to understand the process, you can do:

1) alter database begin backup
2) copy all the datafiles somewhere
3) alter database end backup

then do

shutdown abort
copy the backed up copies of the datafiles over the real files
startup mount
recover database until time ...

and you'll be prompted for archive logs etc to be applied..

Lots of good walk throughs in the docs:

http://docs.oracle.com/database/122/BRADV/rman-complete-database-recovery.htm#GUID-D908719C-9D46-4084-850C-0F81C25094EB

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

In 11g R2

David, May 01, 2017 - 12:20 pm UTC

How to following steps of rman alternative in oracle database 11G R2 version?

1) alter database begin backup
2) copy all the datafiles somewhere
3) alter database end backup
Connor McDonald
May 02, 2017 - 2:54 am UTC

1) sqlplus / as sysdba

SQL> alter database begin backup;

2) copy / cp / tar / dd / etc etc ... any OS tool to copy the files

You can get a list of all your files via

v$controlfile
v$datafile
v$logfile

depending on what scenario you want to test.

3) sqlplus / as sysdba

SQL> alter database end backup;

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.