Oracle flashback and restore

hi,

what is the difference between flashback and restore in oracle ? flashback is faster is it read the old data in memory  ?
LVL 1
marrowyungSenior Technical architecture (Data)Asked:
Who is Participating?
 
slightwv (䄆 Netminder) Commented:
Flashback takes all the objects/tables and data back to a previous point in time.  It will not recover a lost data file.

Flashback requires the database to be in tact.

If you create a table at 12:00 and load 1 million rows at 1:00.  Then you flashback the database to 11:59.  That table and 1 million rows are gone.

The documentation should help out with everything it can and cannot do:
https://docs.oracle.com/en/database/oracle/oracle-database/12.2/rcmrf/FLASHBACK-DATABASE.html
Use the FLASHBACK DATABASE command to rewind the database to a target time, SCN, log sequence number, or restore point.
This command undoes changes made by Oracle Database to the data files that exist when you run the command. Flashback can fix logical failures, but not physical failures. As a result, you cannot use the command to recover from disk failures or the accidental deletion of data files.
FLASHBACK DATABASE is usually much faster than a RESTORE operation followed by point-in-time recovery because no data files are restored. The time needed to perform FLASHBACK DATABASE depends on the number of changes made to the database since the desired flashback time. On the other hand, the time needed to do a traditional point-in-time recovery from restored backups depends on the size of the database.
0
 
Sam Simon NasserIT Support ProfessionalCommented:
The main difference is that flashback rolls back changes including the changes made by others in the whole table or database to any point of time in the past within the range of flashback setting. To roll back to restored points will only rollback what you change in your transaction, and changes by others won't be affected.

more explained here (flashback vs recovery)
http://www.dba-oracle.com/t_callan_oracle_database_flashback_vs_recovery.htm
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
flashback restore everything including other users, restore only restore my own change ?
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
slightwv (䄆 Netminder) Commented:
I think Sam sort of mixed up flashback and savepoints.  You can rollback to a savepoint for a transaction.  Flashback spans transactions.


What flashback are you most interested in?  There are a few different things you can do:  Flashback Query, Table and Database.

Query lets you query a table based on how it looked at a previous point in time.  There is a limited window to do this.  It relies on UNDO to look at previous values.

Flashback table just restores a table to a previous time.  You have the option t restore it to a new table name.

Flashback database, well, the entire database.

The previously mentioned Restore Point is basically a way to name a specific SCN.


Restore pulls necessary files from backups.  That is pretty much it.  Recovery is what brings the database back to a specific point in time.


Flashback database and Recovery are more or less the same thing.  It takes a database back to a point in time.
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
"Flashback database and Recovery are more or less the same thing."

I think flashback is restore from flashback cache area in Oracle, which can be very fast! backup need to load file from disk or tape, so much slower ?

"Restore pulls necessary files from backups."

flashback don't pull file from backup you mean ?

"What flashback are you most interested in?  "

as I am reading RMAN, I keep seeing restore + recovery and flashback, i want to clean up what it means... must be diff.
0
 
slightwv (䄆 Netminder) Commented:
>>I think flashback is restore from flashback cache area in Oracle, which can be very fast! backup need to load file from disk or tape, so much slower ?

Assuming "flashback database":  That doesn't mean that they aren't basically the same thing.  They both bring a database to a specific point in time.

As far as speed goes, it depends.  FLashback database CAN pull from backups if it needs an archived redo log that is no longer on disk.  It can also be slower depending on how much data needs to be rolled back.

Flashback database rolls back all committed transactions in revers order back to a point in time.  If it has a LOT of transactions, that can be slower.

>>i want to clean up what it means... must be diff.

Again, assuming flashback database:  They both to the same thing but use different methods to achieve it.
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
":Flashback database rolls back all committed transactions in revers order back to a point in time.  If it has a LOT of transactions, that can be slower.:

and restore and recovery is NOT the same and go though other process?

there mush be sth different.

"They both to the same thing but use different methods to achieve "
what is the diff ?
0
 
slightwv (䄆 Netminder) Commented:
A restore and recovery is more for disaster recovery.  Flashback database is more for a development and test baseline.  Can you do a restore for baselines, yes.

Flashback cannot rebuild a database from a lost data file or other disaster.


As far as them being the same:  Think about taking a trip cross country:  You can walk, ride a bike, drive a car or fly.  No matter what path you take, the end result is the same.  Same with Flashback database and recovery:  The end result is the same.  Just different methods to get there.
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
" Flashback database is more for a development and test baseline.  Can you do a restore for baselines, yes."

seems flashback is more on restore configuration but not data? or just a small data set?
0
 
slightwv (䄆 Netminder) Commented:
>>seems flashback is more on restore configuration but not data? or just a small data set?

Flashback database is everything in the database.  Most configuration is in the spfile and is outside the database so, it isn't flashed back.
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
Hi,

But you said "Flashback cannot rebuild a database from a lost data file or other disaster.", bit you said:

Flashback database is everything in the database.  

I am not sure what is included in flashback and what is not!
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
"Flashback takes all the objects/tables and data back to a previous point in time.  It will not recover a lost data file.
"

is that mean we need to use restore +recovery first and then Flashback to fully recover everything ?

so diff is restore is more on physical repair and flashback is more on logical repair ?
0
 
slightwv (䄆 Netminder) Commented:
>>is that mean we need to use restore +recovery first and then Flashback to fully recover everything ?

No.  restore+recovery brings you back to a point in time and makes the database operational.

>>so diff is restore is more on physical repair and flashback is more on logical repair ?

More or less.  BUT you can still restore/recover without any physical damage.  Flashback needs enabled before it can be used.  It might not be an option if you need to roll back an entire database.
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
"It might not be an option if you need to roll back an entire database."

I understood this, tks.

"No.  restore+recovery brings you back to a point in time and makes the database operational."

flashback can't do PITR ?
0
 
slightwv (䄆 Netminder) Commented:
>>flashback can't do PITR ?

I have already covered this.  YES, both perform a PITR.  You asked if you must do a recovery and a flashback.  I was pointing out that recovery ALSO does a PITR so no need to flashback.
0
 
marrowyungSenior Technical architecture (Data)Author Commented:
yeah! tks.

so it is restore + recover / flashback.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.