?
Solved

Backup and recovery questions

Posted on 2013-01-28
9
Medium Priority
?
393 Views
Last Modified: 2013-01-29
What exactly happens behind the scenes (I understand that database restore process is started and that's not what I am asking) when you run

RESTORE DATABASE;

statement?

Does it retrieve the last backup whether it was full or incremental backup? Or does it only work for full backups?

Also what happens behind the scenes when you run

RECOVER DATABASE;
0
Comment
Question by:YZlat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38828147
>>Does it retrieve the last backup whether it was full or incremental backup?

In a nutshell: It does everything it needs to do to restore the database to the present.  It will use whatever resources it needs to perform the restore/recovery.

It may not even need a backup.  It may just need an online archived redo log file.

Depending on how detailed you want to dig, the online docs are probably the best place to start about what each of these commands does.
0
 
LVL 35

Author Comment

by:YZlat
ID: 38828170
I have trouble with online documents and learn a lot better if someone explains it to me. If I could just read online docs, I would not post a question, would I?

I understand that it does everyhting it needs to but I was looking for a more fine-grained answer - how does it figure out which backup to use, etc.?
0
 
LVL 35

Author Comment

by:YZlat
ID: 38828215
From what I read so far, looks like RESTORE command is not actually doing the resotre, but decided which files are to be used for the restore and verifies their contants. Is this correct?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 35

Author Comment

by:YZlat
ID: 38828241
Another thing I wanted to ask is does BACKUP DATABASE backs up the control files or do you need to do that separately?
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38828305
>>If I could just read online docs, I would not post a question, would I?

Unfortunately this site isn't really set up to be a training substitute.  It also doesn't lend itself well to very broad questions.   This is a very broad question.

>>how does it figure out which backup to use, etc.?

I believe everything is driven by the SCN.  It checks the current SCN in the control file then does some magic to figure out how far back it needs to go and if it has everything it needs.

I'm sure you are asking about the 'magic' that it does.  Sorry, but I don't know.

>>but decided which files are to be used for the restore and verifies their contants. Is this correct?

Sorry but I honestly don't know.  I've never really jumped into this end of the pool.  It is one of those commands that 'works' so I've never had a reason to ask 'how'.

Hopefully some other Experts will be aslong soon and might be able to help fill in some gaps.
0
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 1500 total points
ID: 38830027
in short:
RESTORE DATABASE;
> this only works if you have a started instance and restored the controlfiles first.
> checks what time your system is on: in this case: 29/01/2013 08:00:00
> looks in the controlfile for a list of available backups
>> in rman: list backups all;
> finds the first full backup before the current time
> restore all the datafiles

RECOVER DATABASE;
> checks current time
> finds what the restored database time is
>> oldest entry in v$recover_file
> checks all available backups after this time
> uses level 1 incremental backups to apply
> after this it uses archivelogs found in the backups

after restoring the controlfile, it's best to run a crosscheck backups with rman to verify backups are available

>>If I could just read online docs, I would not post a question, would I?
What's the difference between reading our comments and reading online docs ?
> the online docs are very extensive and explain almost everything
> we just give a summary here
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 38830030
restore level 1 incremental did require a extra step but can't remember exactly what
0
 
LVL 35

Author Comment

by:YZlat
ID: 38831764
>>What's the difference between reading our comments and reading online docs ?
For me the difference is pretty big and I only need a summary. I am learning too much at this time and I just would not be able to get details on everything and my life would be much more difficult without you guys and your "summaries":)


Another advantage is the ability to ask questions and clarifications:)

Sobasically RESTORE does not do the recovery but copies the files from backup and checks if everything is ready for the recovery? Is that correct?
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 38833248
yes, restore only extracts the datafiles from the backup files
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question