Skip to content

Flashback CDB 12с

Flashback CDB 12с published on Комментариев к записи Flashback CDB 12с нет

Flashback CDB
Enable flashback:

SQL> SHUTDOWN IMMEDIATE
SQL> STARTUP MOUNT
SQL> ALTER DATABASE ARCHIVELOG; 
SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=2880 SCOPE=BOTH;
SQL> ALTER DATABASE FLASHBACK ON;
SQL> ALTER DATABASE OPEN;

If the CDB is in ARCHIVELOG mode, there is no need to restart it.

Restrictions:
• You cannot flash back the root alone without flashing back the entire CDB.
• Flashback Database operations on a CDB may not be permitted if point-in-time recovery has been performed on any of its PDBs. When point-in-time recovery is performed on a PDB, you cannot directly rewind the CDB to a point that is earlier than the point at which DBPITR for the PDB was performed.

Flashback CDB

A common user is dropped.

1. Flashback CDB: CDB mounted in exclusive mode

SQL> STARTUP MOUNT
SQL> FLASHBACK DATABASE TO SCN 53943;

2. To review changes: Open CDB and PDBs in READ ONLY

SQL> ALTER DATABASE OPEN READ ONLY;
SQL> ALTER PLUGGABLE DATABASE ALL OPEN READ ONLY;

3. To finalize: Flash back again if necessary and open CDB with RESETLOGS.

RMAN> SHUTDOWN IMMEDIATE
RMAN> STARTUP MOUNT
RMAN> FLASHBACK DATABASE TO SCN 10; 
RMAN> ALTER DATABASE OPEN RESETLOGS; 
RMAN> ALTER PLUGGABLE DATABASE ALL OPEN;

A common schema has been accidently dropped in the root. You have to flash back the CDB to the time before the common user was dropped impacting all PDBs.
You can use the RMAN FLASHBACK DATABASE command to execute the Flashback Database operation. You can use SEQUENCE and THREAD to specify a redo log sequence number and thread as a lower limit.
Alternatively, you can use the SQL FLASHBACK DATABASE command to return the database to a past time or SCN. If you use the TO SCN clause, you must provide a number. If you specify TO TIMESTAMP, you must provide a time stamp value. You can also specify a restore point name.
Note
• The CDB must be mounted in exclusive mode to issue the FLASHBACK DATABASE command and opened read-only to review changes. The CDB must be opened read/write with the RESETLOGS option when finished.
• When the CDB is opened in READ ONLY mode, the PDBs are still mounted. Open PDBs in READ ONLY mode, too, to review changes.

*While performing a hot CDB backup, you cannot close any PDB.

rman catalog sbt_tape backup piece

rman catalog sbt_tape backup piece published on Комментариев к записи rman catalog sbt_tape backup piece нет
RMAN> configure channel device type 'SBT_TAPE' parms='ENV=(NB_ORA_SERVER=dc1-nb01,NB_ORA_CLIENT=DC1-DWHODI)';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'ENV=(NB_ORA_SERVER=dc1-nb01,NB_ORA_CLIENT=DC1-DWHODI)';
new RMAN configuration parameters are successfully stored

now catalog works fine:

RMAN> catalog device type 'SBT_TAPE'  backuppiece 'al_11820_1_834711630';

allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=3 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle - Release 7.5 (2012020807)
cataloged backup piece
backup piece handle=al_11820_1_834711630 RECID=11820 STAMP=834950531

Primary Sidebar