0⃣ I've heard many misconceptions about restoring tablespaces in @OracleDatabase so here a a little #backToTheBasics restore+recover concepts & how-to
👇
1⃣ A tablespace is a subset of the (monolith) database. There are physical operations (backup, transport, snapshot,...) that you don't want to do for the whole TB database. Then you dedicate some tablespaces to applications, datastores, large tables, read-only workloads,...
2⃣You may want to restore some data as-of yesterday (because you dropped a table by mistake for example) without having to restore the whole database. This is Tablespace Point In time Recovery (TSPITR). Let's say you dropped the tablespace USERS by mistake at 11:42 👇
3⃣ I've seen people thinking they can restore a TBS without mentioning a Point In Time, or by mentioning a PIT after the drop, to get its the latest state. But that's wrong because you don't actually restore the tablespace. You restore the database, skipping other tablespaces
4⃣ If you restore and recover beyond 11:42 in my example, this will just replay the DROP... You need to recover until the Point In Time just before the drop. Because you don't restore a tablespace. You restore a subset of the database and recover all what happens until the PIT
5⃣ Restoring tablespace USERS is actually restoring USERS datafiles, plus SYSTEM and SYSAUX (because you need the dictionary mapping logical tables to physical segments), and UNDO because there were ongoing transactions at this PIT that needs to be rolled back to stay ACID
6⃣ And of course, you cannot restore this in-place because you cannot overwrite the current SYSTEM/SYSAUX/UNDO with the one from the recovery Point In Time. You do that to an auxiliary instance and then move the recovered tablespace.
RMAN can automate it:
7⃣ you may prefer to just open the auxiliary database so that users can query to get their data back. Or you can recover further (if you opened it read-only)… Be careful if you have jobs running. Be careful about the service registered to the listener. RMAN DUPLICATE helps.
8⃣ with multitenant there's an intermediate level between the CDB database and the tablespaces. You can restore a PDB in-place (PDBPITR) because they contain their own metadata (SYSTEM) and local UNDO. When you connect RMAN to a CDB, prefix the tablespace names with PDB: name
9⃣ the importance of learning concept before using an easy GUI or API: if you ever did this operation manually (with SKIP TABLESPACE in RMAN RESTORE/RECOVER or DUPLICATE) you get it. If you just see 'restore tablespace' as a black box button, you may not know which PIT to set🤷‍♂️
🔟 and remember a dump is not a backup. A backup is not only there to restore to the PIT where it was taken. You can recover at any Point In Time within the retention window, in a predictable time
Allow yourself to make mistakes without loosing any data😎 blog.dbi-services.com/what-is-a-data…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Franck Pachot

Franck Pachot Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @FranckPachot

8 Nov
5 critical features of managed DB services
@awscloud RDS PostgreSQL checks all five 👍

1/5⌚✅be able to recover to a point-in-time beyond the last backup (any point-in-time within the retention) ImageImageImage
2/5⏱️✅enable automatic backups (and be warned if not). They occur during the defined window but do not block the database activity. And RDS takes an initial backup at creation. Image
3/5🦺✅ prevent accidental deletion of an instance (remember in case of sh.t happening, you are in stress and can make things worse) Image
Read 5 tweets
26 Nov 19
🔴⏬ Here I start a thread about some Oracle Database concepts. We will see how far it goes - all questions/comments welcome.
🔴⏬ A database (or DBMS - database management system) stores (for short and long term) and manipulates (from many concurrent users/devices) your #data.
🔴⏬ #data is logically structured (tablespaces, schemas, tables, columns, datatypes, constraints,…). The structure is described by #metadata.
Read 73 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!