Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Marcus.

Asked: May 06, 2013 - 9:37 pm UTC

Last updated: April 20, 2026 - 2:43 am UTC

Version: 11.2.0.3

Viewed 10K+ times! This question is

You Asked

Hello Tom,

I use Oracle Flashback features a lot. We have several development and test environments here and the combination flashback database + replay is priceless. My question is this: why don't we have a "flashback schema" feature ? I know you can simulate that with PL/SQL, but that's just for tables. A schema is much more than that: pl/sql code, grants, etc. If you consolidate databases into schemas inside a large machine, you lose the ability to flashback them; to maintain this ability you'll need virtualization (or pluggable databases :)). So, why was it never done ? Is it impossible and I fail to see the reason ?

Thank you for your time.


and Tom said...

we have flashback at various levels -

flashback query/versions query - UNDO based
flashback transaction query/flashback transaction - UNDO and a bit of REDO based
flashback data archive - UNDO based to generate archive into table
flashback undrop table - recycle bin based, works object by named object
flashbck table - UNDO based

those work on individual named objects, data only. they are object by object capabilities. The next leap is

flashback database - fast recovery area based, used pre-checkpoint images of blocks and redo to put the database back the way it was (or before) and then roll it forward. Replaces all blocks on disk that were modified since the flashback time with a pre-checkpoint image of the block from the fast recovery area. Works on the ENTIRE database (or none of the database, it is all or nothing).


There is nothing even close in between these two areas. We have flashback that works object by object - object by individual object. We have flashback that works at the entire database level.

There is nothing in the middle that could even come close to putting a schema back the way it was at a former point in time.

The individual object by object technologies cannot do it since they would put entire objects back the way they were (and we need a very selective update to the data dictionary here - not the ENTIRE dictionary) and they do not cover things like code.

The flashback database technology could never be tweaked to do it - that works on basic recovery principles - you have a set of blocks that need to be rolled forward, recovered. There is no way to do that selectively - to just roll back the changes made on behalf of a schema.


so, I frankly do not see it happening at a schema level, there is a lot involved - the code needs to be put back, the data (that part is "easy" - we can do that in a trivial sense already), the grants - both internal and external (things this schema GRANTED and things granted TO this schema - or revoked), the synonyms, the views and so on and so on...


In the future - looking at pluggable database - we will likely have a flashback pluggable database at some point (not in the first release) which would be a valid solution going forward.



Rating

  (4 ratings)

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

Comments

Alexander, May 08, 2013 - 7:06 pm UTC

This makes me wonder, and maybe this is stupid, but why is code stored in the data dictionary system tablespace and not in user tablespaces? That would be kind of neat to have that option, and define a default code ts similarly to a default profile, or temp, for a user.
Tom Kyte
May 08, 2013 - 7:23 pm UTC

and even then, that is just thinking about code, there are *thousands* of other bits of metadata that would need working on as well.




it will sort of be like that in pluggable databases in the future... Each plugged in database would have its own slice of the data dictionary (but the entire data dictionary - not just code, but grants and everything)

right now, in a single database per instance architecture, it wouldn't make sense to have multiple code repositories sitting all over the place.


No flashback for pluggable DBs ?

Marcus Rangel, May 08, 2013 - 7:17 pm UTC

Thank you for your answer. One thing worried me, though: did I get it right ? won't it be possible to flashback a pluggable database ? How is it going to work then ? Will I issue "flashback database to X" in the container DB and as a result flashback the CDB and all its PDBs ?


Tom Kyte
May 08, 2013 - 7:25 pm UTC

in release one, it won't be possible to flashback a pluggable database in all likelihood.

You will be able to point in time restore it, but probably not flash it back.

in release one.

The container would be a different story, probably.

A reader, May 19, 2016 - 3:33 pm UTC

It would be a great option if you could flashback a schema to a point time. I guess the schema would require to spin up its own rollback and archivelogs to start with when you create a restore point. Plus it would have to be in some sort of restricted mode during the entire life cycle of the restore point. I hope oracle figures it out soon because it would make my life a lot easier.
Chris Saxon
May 19, 2016 - 3:40 pm UTC

If you'd like us to implement a feature, submit an enhancement request.

Or submit it to the database ideas forum and get others to vote on it:

https://community.oracle.com/community/database/database-ideas

Link out of date

Clark Pearson, April 13, 2026 - 1:34 pm UTC

The link provided on May 19, 2016 is no longer valid. I suspect the answer itself is still valid, so I've not marked "Answer out of date". But might
FLASHBACK SCHEMA
be in the pipeline for development?
Connor McDonald
April 20, 2026 - 2:43 am UTC

Here's a more up to data link

https://forums.oracle.com/ords/apexds/domain/dev-community/category/database-software?tags=database-ideas,database-ideas-ideas

To my knowledge, there are not plans for flashback schema :-(

More to Explore

Multitenant

Need more information on Multitenant? Check out the Multitenant docs for the Oracle Database