Database Reference
In-Depth Information
recover database;
alter database open resetlogs;
}
Instead of relying on the defined NLS_DATE_FORMAT environment variable it has proved to be less ambiguous
to use the to_date() function inside the set until clause. Instead of a human readable format you can also use the
SCN or a sequence number instead if you have them documented. As you can also see, you need to open the database
with the resetlogs option as with any incomplete recovery.
Restoring a Pluggable Database
One of the main contention points of the multi-schema/multi-tenancy approach in Oracle before 12c was the fact
that it was very difficult from an operation point of view to perform a (point-in-time) restore of the Oracle database.
Any such operation affected everyone in the database, and you can imagine how difficult it was to agree on a restore
operation. Some database administrators tried to separate the different schemas as much as possible by creating
dedicated tablespaces for each user, which in theory could have been recovered using Tablespace-Point-In-Time
Recovery but even then this was a process that was difficult to coordinate.
Again, the notion of the Pluggable Database makes these tasks easier, allowing you to complete the recovery of
individual PDBs without affecting others. Consider for example that a point in time recovery of PDB1 has been agreed
between the product manager and all the other stakeholders. In this case you need to follow these steps to recover the
PDB to a point in time. For any recovery operation-complete or incomplete, the PDB(s) in question must be in mount
mode or closed in other words.
SYS@CDB$ROOT> select con_id,open_mode,name from v$pdbs;
CON_ID OPEN_MODE NAME
---------- ---------- ------------------------------
2 READ ONLY PDB$SEED
3 MOUNTED PDB1
Assume for the example that a user error has been identified at 10:00 AM, and all other means of fixing the
problem have already been exhausted and all the approvers have given the database team the nod to restore the
database to 09:00 AM at an SCN of 2188563 which has been obtained by using the timestamp_to_scn() function. Table
t_1 in the schema USER1 contains a column ID. Someone accidentally inserted the value “10000” into it sometime
after SCN 2188563. The contents of the table—simplified for readability—is shown here:
SQL> select * from user1.t_1;
ID
----------
100000
3
1
The PDB Point-in-Time recovery is initiated in RMAN using the familiar set until clause followed by the magic
triple “restore-recover-open resetlogs”:
RMAN> run {
2> set until scn = 2188563;
3> restore pluggable database pdb1;
4> recover pluggable database pdb1 auxiliary destination='xxx';
5> alter pluggable database pdb1 open resetlogs;
6> }
 
Search WWH ::




Custom Search