SlideShare a Scribd company logo
1 of 20
Download to read offline
Oracle 12c New Features
Recovery Manager
@saifulmuhajir
Pluggable Database Support
• RMAN supports Pluggable Databases
• Back up entire Container Database or individual Pluggable Databases
• PDB point in time recovery: recover PDB individually
RMAN> alter pluggable database PLUG1 close;
RMAN> RUN {
SET UNTIL SCN 1674493;
RESTORE PLUGGABLE DATABASE PLUG1;
RECOVER PLUGGABLE DATABASE PLUG1;
}
RMAN> alter pluggable database PLUG1 open resetlogs;
Using SQL in RMAN
• No SQL prefix or quotes required
• Provides SQL*Plus DESCRIBE functionality
• Earlier releases:
RMAN> sql 'ALTER TABLESPACE users
ADD DATAFILE “/testdata/users02.dbf” SIZE 10M';
• With Oracle Database 12c:
RMAN> ALTER TABLESPACE users ADD DATAFILE '/testdata/users02.dbf' SIZE 10M;
RMAN> SELECT NAME, DBID, LOG_MODE FROM V$DATABASE;
RMAN> DESC table1
Name Null? Type
--------- -------- -------------------
TEST_NAME VARCHAR2(128)
Separation of DBA Duties
Introducing task-specific and least-privileged administrative privilege
SYSBACKUP
• Includes permissions for backup and recovery (connecting to a closed
database)
• Does not include data access privileges such as SELECT ANY TABLE
• Is granted to the SYSBACKUP user that is created during database installation
• Can be explicitly used in RMAN connection by a SYSBACKUP privileged user
$ rman TARGET “john@orcl AS SYSBACKUP”
connected to target database: ORCL (DBID=1297344416)
Backing Up and Restoring Very Large Files
Multisection backups of a single data file:
• Created by RMAN, with your specified size value
• For backup sets and image copies
• For full and incremental backups
Benefits:
• Reduce image copy creation time
• Are processed independently (serially or in parallel)
• Benefit Exadata
Requirements and restrictions:
• COMPATIBLE=12.0
• Not for control files or spfiles
• Not for a large value of parallelism
RMAN> BACKUP AS COPY SECTION SIZE 1024M DATABASE;
RMAN> BACKUP INCREMENTAL LEVEL 1 SECTION SIZE 1G
DATABASE;
Active Duplicate Enhancements
Default use of backup sets for active duplication
• Original «push» process based on image copies becomes «pull» process based on
backup sets
• Automatic «pull» process when a clause is used:
- Compression
- Section size
- Encryption
RMAN> SET ENCRYPTION …;
RMAN> DUPLICATE TARGET DATABASE TO orcl2 FROM ACTIVE DATABASE
[USING BACKUPSET] [SECTION SIZE …] [USING COMPRESSED BACKUPSET] …;
Data is encrypted on the source database,
before transmission.
The NOOPEN Option
• Option to end database duplication with database in mounted
• Potential NOOPEN use cases:
- Avoid any startup problems: opening the database conflict with other
source database
- Adjust the initialization parameters: BCT, flashback
- Moving the location of the database (for example, to ASM)
- Upgrading a database (where the database must not be open with
resetlogs, prior to running upgrade scripts)
RMAN> DUPLICATE TARGET DATABASE TO ORCL12 FROM ACTIVE
DATABASE NOOPEN;
Duplicating Pluggable Databases
• A single pluggable database:
RMAN> DUPLICATE DATABASE TO cdb1 PLUGGABLE DATABASE pdb1;
• Several pluggable databases:
RMAN> DUPLICATE DATABASE TO cdb1 PLUGGABLE DATABASE pdb1, pdb3;
• All pluggable databases except one:
RMAN> DUPLICATE DATABASE TO cdb1 SKIP PLUGGABLE DATABASE pdb3;
• A PDB and tablespaces of other PDBs:
RMAN> DUPLICATE DATABASE TO cdb1 PLUGGABLE DATABASE pdb1
TABLESPACE pdb2:users;
Storage Snapshot Optimization
• Take a storage snapshot using third-party technologies
• BACKUP mode is not necessary
• Point-in-Time of the snapshot can be used for recovery
• Requirements:
- The snapshot preserves the write order for each file
- The database is crash consistent during the snapshot
- The snapshot technology stores the time at which the snapshot is
completed
• Structural changes during the snapshot will make the snapshots unusable
Recovering Databases with
Third-Party Snapshots
• Recover a database using the most recent snapshot:
RMAN> RECOVER DATABASE;
• Recover a database using a particular snapshot:
RMAN> RECOVER DATABASE UNTIL TIME ‘02/15/2012 11:00:00’
SNAPSHOT TIME ‘02/15/2012 10:00:00’;
• Perform a partial recovery using archived redo log files:
RMAN> RECOVER DATABASE UNTIL CANCEL SNAPSHOT TIME
‘02/15/2012 10:00:00’;
Table Recovery
• Table recovery from RMAN backups
- Not affecting the remaining database objects
- Reduces time and disk space
• Useful when you can’t use flashback
• Recover tables or table partitions
• Must connect “as sysdba” or “as sysbackup”
RMAN> RECOVER TABLE NCBSHOST.CS_TABLE
UNTIL SCN 1674493
AUXILIARY DESTINATION '/tmp/oracle/recover’
DATAPUMP DESTINATION '/tmp/recover/dumpfiles’
REMAP TABLE ‘NCBSHOST'.‘CS_TABLE':‘CS_RECOVERED’;
Supported options: UNTIL TIME,
UNTIL SCN, UNTIL SEQUENCE
RMAN Recover Table: Tips
• Target database must be in READ WRITE mode
• Determine if there are dependent tables that need to be included in the recovery, based
on foreign key constraints
• Ensure sufficient disk space on database server for auxiliary instance: SUM [SYSTEM,
SYSAUX, UNDO, SYSEXT (if present), User Tablespace(s) that contain table(s)]
• At least one full backup has been taken of the above tablespaces, along with backup of
all archived logs
• For recovering tables within a PDB, connect to CDB as ROOT user
• If source table does not exist anymore (e.g. dropped), then table and all associated
indexes, constraints, triggers will also be recovered
• If source table exists, then table must be recovered with a new name (REMAP TABLE) or
to a new tablespace (REMAP TABLESPACE).
RMAN Recover Table - Process
• Create a temporary auxiliary database on local database server
• Restore and recover the table or table partition
• Export the table/partition that is being recovered using the data pumps
• Optionally import and rename the table/partition in the source database
• Destroys the auxiliary database upon completion
Restore/Recover over Network
• Flexibility to restore full database, specific datafile, controlfile, spfile etc
• Using RESTORE… FROM SERVICE and RECOVER… FROM SERVICE
• Useful to fill-in the huge gap between primary and standby databases
• restore/recover a data file from standby to primary
RMAN> CONNECT TARGET “backupuser@primary_tns AS SYSBACKUP”;
RMAN> RESTORE DATAFILE 9 FROM SERVICE standby_tns section size 5120M;
• Roll-forward to in-sync standby with primary
RMAN> CONNECT TARGET “backupuser@standby_tns AS SYSBACKUP”;
RMAN> RECOVER DATABASE FROM SERVICE primary_tns USING COMPRESSED
BACKUP;
Transporting Data Across Platforms
• Transporting databases, data files, and tablespaces
• Using image copies and backup sets
• Allows inconsistent tablespace backups
Benefits:
• Reduced down time for platform migrations
• Choice of compression and multisection
• Not catalogued in control file, not used for regular restore operations
Notes
• COMPATIBLE=12.0 (or greater)
• Read-only mode for creation of cross-platform database backup
• Database in read-write mode for creation of cross-platform tablespace
backup
• FOR TRANSPORT: backup can be transported to any destination
• TO PLATFORM: conversion performs on the source database
• DATAPUMP clause required for tablespace for last incremental backup
• RESTORE FOREIGN: restore the cross-platform data backup set
Transporting Database
• Database mode: READ_ONLY
• Back up the source database including control files
• RMAN> BACKUP FOR TRANSPORT FORMAT '/bkp_dir/transp.bck‘
DATABASE;
• RMAN> RESTORE FROM PLATFORM ‘AIX-Based Systems (64-bit)’
FOREIGN DATABASE TO NEW FROM BACKUPSET
'/bkp_dir/transp.bck';
Transporting Tablespace (AIX to Linux)
On destination Linux host:
- Create ‘shell’ database (SYSTEM, SYSAUX, UNDO)
On source AIX database:
- ALTER TABLESPACE PROJECTS, TASKS READ ONLY;
- EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK(PROJECTS, TASKS, TRUE)
- SELECT * FROM TRANSPORT_SET_VIOLATIONS;
- Check that user tablespaces are self-contained
- BACKUP FOR TRANSPORT FORMAT ‘/tmp/xplat_backups/trans_ts.bck’
DATAPUMP FORMAT ‘/tmp/xplat_backups/trans_ts_dmp.bck’
TABLESPACE PROJECTS, TASKS;
- Copy all backups to destination server
(cont’d)
On destination Linux database:
- Create tablespace users as they exist on source database
- RESTORE FROM PLATFORM ‘AIX-Based Systems (64-bit)’ FOREIGN
TABLESPACE PROJECTS, TASKS TO NEW FROM BACKUPSET
‘/tmp/xplat_restores/trans_ts.bck’ DUMP FILE FROM BACKUPSET
‘/tmp/xplat_restores/trans_ts_dmp.bck’;
- Data file blocks automatically endian-converted during restore
- Data Pump metadata dump file automatically imported to plug in user
tablespaces
- SQL> ALTER TABLESPACE PROJECTS, TASKS READ WRITE;
Demo
Recover Table Using RMAN Backupset
Oracle Database 12c

More Related Content

What's hot

The Top 12 Features new to Oracle 12c
The Top 12 Features new to Oracle 12cThe Top 12 Features new to Oracle 12c
The Top 12 Features new to Oracle 12cDavid Yahalom
 
Best New Features of Oracle Database 12c
Best New Features of Oracle Database 12cBest New Features of Oracle Database 12c
Best New Features of Oracle Database 12cPini Dibask
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi TenantRed Stack Tech
 
Oracle database 12c intro
Oracle database 12c introOracle database 12c intro
Oracle database 12c intropasalapudi
 
Ensuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback FeaturesEnsuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback FeaturesPini Dibask
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesSaiful
 
What is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? PresentationWhat is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? PresentationFrancisco Alvarez
 

What's hot (20)

Les 12 fl_db
Les 12 fl_dbLes 12 fl_db
Les 12 fl_db
 
The Top 12 Features new to Oracle 12c
The Top 12 Features new to Oracle 12cThe Top 12 Features new to Oracle 12c
The Top 12 Features new to Oracle 12c
 
Best New Features of Oracle Database 12c
Best New Features of Oracle Database 12cBest New Features of Oracle Database 12c
Best New Features of Oracle Database 12c
 
Les 19 space_db
Les 19 space_dbLes 19 space_db
Les 19 space_db
 
Oracle 12c Multi Tenant
Oracle 12c Multi TenantOracle 12c Multi Tenant
Oracle 12c Multi Tenant
 
Oracle database 12c intro
Oracle database 12c introOracle database 12c intro
Oracle database 12c intro
 
Les 03 catalog
Les 03 catalogLes 03 catalog
Les 03 catalog
 
Les 14 perf_db
Les 14 perf_dbLes 14 perf_db
Les 14 perf_db
 
Oracle ASM Training
Oracle ASM TrainingOracle ASM Training
Oracle ASM Training
 
Xpp c user_rec
Xpp c user_recXpp c user_rec
Xpp c user_rec
 
Les 09 diag
Les 09 diagLes 09 diag
Les 09 diag
 
Ensuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback FeaturesEnsuring Data Protection Using Oracle Flashback Features
Ensuring Data Protection Using Oracle Flashback Features
 
Les 02 config
Les 02 configLes 02 config
Les 02 config
 
Les 01 core
Les 01 coreLes 01 core
Les 01 core
 
RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA RMAN – The Pocket Knife of a DBA
RMAN – The Pocket Knife of a DBA
 
Les 08 tune_rman
Les 08 tune_rmanLes 08 tune_rman
Les 08 tune_rman
 
PostgreSQL 9.5 Features
PostgreSQL 9.5 FeaturesPostgreSQL 9.5 Features
PostgreSQL 9.5 Features
 
Les 11 fl2
Les 11 fl2Les 11 fl2
Les 11 fl2
 
What is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? PresentationWhat is new on 12c for Backup and Recovery? Presentation
What is new on 12c for Backup and Recovery? Presentation
 
Les 20 dup_db
Les 20 dup_dbLes 20 dup_db
Les 20 dup_db
 

Viewers also liked

ZFS for Databases
ZFS for DatabasesZFS for Databases
ZFS for Databasesahl0003
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowAlex Zaballa
 
Backup & recovery with rman
Backup & recovery with rmanBackup & recovery with rman
Backup & recovery with rmanitsabidhussain
 
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and AdministerOracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and AdministerAndrejs Karpovs
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and ArchitectureSidney Chen
 
How to document a database
How to document a databaseHow to document a database
How to document a databasePiotr Kononow
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overviewhonglee71
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseNikhil Kumar
 

Viewers also liked (10)

DBA oracle
DBA oracleDBA oracle
DBA oracle
 
ZFS for Databases
ZFS for DatabasesZFS for Databases
ZFS for Databases
 
ZFS appliance
ZFS applianceZFS appliance
ZFS appliance
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
Backup & recovery with rman
Backup & recovery with rmanBackup & recovery with rman
Backup & recovery with rman
 
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and AdministerOracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
Oracle E-Business Suite R12.2.6 on Database 12c: Install, Patch and Administer
 
Oracle Basics and Architecture
Oracle Basics and ArchitectureOracle Basics and Architecture
Oracle Basics and Architecture
 
How to document a database
How to document a databaseHow to document a database
How to document a database
 
Oracle Database Overview
Oracle Database OverviewOracle Database Overview
Oracle Database Overview
 
RAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and DatabaseRAC-Installing your First Cluster and Database
RAC-Installing your First Cluster and Database
 

Similar to Oracle 12c New Features_RMAN_slides

RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)Gustavo Rene Antunez
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recoveryaltistory
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezInsight Technology, Inc.
 
Presentation recovery manager (rman) configuration and performance tuning ...
Presentation    recovery manager (rman) configuration and performance tuning ...Presentation    recovery manager (rman) configuration and performance tuning ...
Presentation recovery manager (rman) configuration and performance tuning ...xKinAnx
 
Dp sql restore latest
Dp sql restore latestDp sql restore latest
Dp sql restore latestJyothirmaiG4
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsMydbops
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAiougVizagChapter
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)Gustavo Rene Antunez
 
Flashback - The Time Machine..
Flashback - The Time Machine..Flashback - The Time Machine..
Flashback - The Time Machine..Navneet Upneja
 
Collaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryCollaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryNelson Calero
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryNelson Calero
 
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseParesh Patel
 
Reduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technologyReduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technologyKirill Loifman
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Recvivaankumar
 

Similar to Oracle 12c New Features_RMAN_slides (20)

Presentation day2 oracle12c
Presentation day2 oracle12cPresentation day2 oracle12c
Presentation day2 oracle12c
 
RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)RMAN in 12c: The Next Generation (PPT)
RMAN in 12c: The Next Generation (PPT)
 
Les 07 Rman Rec
Les 07 Rman RecLes 07 Rman Rec
Les 07 Rman Rec
 
Les 07 rman_rec
Les 07 rman_recLes 07 rman_rec
Les 07 rman_rec
 
[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery[Altibase] 13 backup and recovery
[Altibase] 13 backup and recovery
 
MySQL Backup & Recovery
MySQL Backup & RecoveryMySQL Backup & Recovery
MySQL Backup & Recovery
 
B35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarezB35 all you wanna know about rman by francisco alvarez
B35 all you wanna know about rman by francisco alvarez
 
Presentation recovery manager (rman) configuration and performance tuning ...
Presentation    recovery manager (rman) configuration and performance tuning ...Presentation    recovery manager (rman) configuration and performance tuning ...
Presentation recovery manager (rman) configuration and performance tuning ...
 
Dp sql restore latest
Dp sql restore latestDp sql restore latest
Dp sql restore latest
 
Percona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient BackupsPercona Xtrabackup - Highly Efficient Backups
Percona Xtrabackup - Highly Efficient Backups
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
5895640.ppt
5895640.ppt5895640.ppt
5895640.ppt
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
 
Flashback - The Time Machine..
Flashback - The Time Machine..Flashback - The Time Machine..
Flashback - The Time Machine..
 
15362590.ppt
15362590.ppt15362590.ppt
15362590.ppt
 
Collaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mysteryCollaborate 2012 - RMAN Eliminate the mystery
Collaborate 2012 - RMAN Eliminate the mystery
 
Collaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mysteryCollaborate 2012 - RMAN eliminate the mystery
Collaborate 2012 - RMAN eliminate the mystery
 
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_DatabaseNoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
NoCOUG_201411_Patel_Managing_a_Large_OLTP_Database
 
Reduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technologyReduce planned database down time with Oracle technology
Reduce planned database down time with Oracle technology
 
Les 06 Perform Rec
Les 06 Perform RecLes 06 Perform Rec
Les 06 Perform Rec
 

Oracle 12c New Features_RMAN_slides

  • 1. Oracle 12c New Features Recovery Manager @saifulmuhajir
  • 2. Pluggable Database Support • RMAN supports Pluggable Databases • Back up entire Container Database or individual Pluggable Databases • PDB point in time recovery: recover PDB individually RMAN> alter pluggable database PLUG1 close; RMAN> RUN { SET UNTIL SCN 1674493; RESTORE PLUGGABLE DATABASE PLUG1; RECOVER PLUGGABLE DATABASE PLUG1; } RMAN> alter pluggable database PLUG1 open resetlogs;
  • 3. Using SQL in RMAN • No SQL prefix or quotes required • Provides SQL*Plus DESCRIBE functionality • Earlier releases: RMAN> sql 'ALTER TABLESPACE users ADD DATAFILE “/testdata/users02.dbf” SIZE 10M'; • With Oracle Database 12c: RMAN> ALTER TABLESPACE users ADD DATAFILE '/testdata/users02.dbf' SIZE 10M; RMAN> SELECT NAME, DBID, LOG_MODE FROM V$DATABASE; RMAN> DESC table1 Name Null? Type --------- -------- ------------------- TEST_NAME VARCHAR2(128)
  • 4. Separation of DBA Duties Introducing task-specific and least-privileged administrative privilege SYSBACKUP • Includes permissions for backup and recovery (connecting to a closed database) • Does not include data access privileges such as SELECT ANY TABLE • Is granted to the SYSBACKUP user that is created during database installation • Can be explicitly used in RMAN connection by a SYSBACKUP privileged user $ rman TARGET “john@orcl AS SYSBACKUP” connected to target database: ORCL (DBID=1297344416)
  • 5. Backing Up and Restoring Very Large Files Multisection backups of a single data file: • Created by RMAN, with your specified size value • For backup sets and image copies • For full and incremental backups Benefits: • Reduce image copy creation time • Are processed independently (serially or in parallel) • Benefit Exadata Requirements and restrictions: • COMPATIBLE=12.0 • Not for control files or spfiles • Not for a large value of parallelism RMAN> BACKUP AS COPY SECTION SIZE 1024M DATABASE; RMAN> BACKUP INCREMENTAL LEVEL 1 SECTION SIZE 1G DATABASE;
  • 6. Active Duplicate Enhancements Default use of backup sets for active duplication • Original «push» process based on image copies becomes «pull» process based on backup sets • Automatic «pull» process when a clause is used: - Compression - Section size - Encryption RMAN> SET ENCRYPTION …; RMAN> DUPLICATE TARGET DATABASE TO orcl2 FROM ACTIVE DATABASE [USING BACKUPSET] [SECTION SIZE …] [USING COMPRESSED BACKUPSET] …; Data is encrypted on the source database, before transmission.
  • 7. The NOOPEN Option • Option to end database duplication with database in mounted • Potential NOOPEN use cases: - Avoid any startup problems: opening the database conflict with other source database - Adjust the initialization parameters: BCT, flashback - Moving the location of the database (for example, to ASM) - Upgrading a database (where the database must not be open with resetlogs, prior to running upgrade scripts) RMAN> DUPLICATE TARGET DATABASE TO ORCL12 FROM ACTIVE DATABASE NOOPEN;
  • 8. Duplicating Pluggable Databases • A single pluggable database: RMAN> DUPLICATE DATABASE TO cdb1 PLUGGABLE DATABASE pdb1; • Several pluggable databases: RMAN> DUPLICATE DATABASE TO cdb1 PLUGGABLE DATABASE pdb1, pdb3; • All pluggable databases except one: RMAN> DUPLICATE DATABASE TO cdb1 SKIP PLUGGABLE DATABASE pdb3; • A PDB and tablespaces of other PDBs: RMAN> DUPLICATE DATABASE TO cdb1 PLUGGABLE DATABASE pdb1 TABLESPACE pdb2:users;
  • 9. Storage Snapshot Optimization • Take a storage snapshot using third-party technologies • BACKUP mode is not necessary • Point-in-Time of the snapshot can be used for recovery • Requirements: - The snapshot preserves the write order for each file - The database is crash consistent during the snapshot - The snapshot technology stores the time at which the snapshot is completed • Structural changes during the snapshot will make the snapshots unusable
  • 10. Recovering Databases with Third-Party Snapshots • Recover a database using the most recent snapshot: RMAN> RECOVER DATABASE; • Recover a database using a particular snapshot: RMAN> RECOVER DATABASE UNTIL TIME ‘02/15/2012 11:00:00’ SNAPSHOT TIME ‘02/15/2012 10:00:00’; • Perform a partial recovery using archived redo log files: RMAN> RECOVER DATABASE UNTIL CANCEL SNAPSHOT TIME ‘02/15/2012 10:00:00’;
  • 11. Table Recovery • Table recovery from RMAN backups - Not affecting the remaining database objects - Reduces time and disk space • Useful when you can’t use flashback • Recover tables or table partitions • Must connect “as sysdba” or “as sysbackup” RMAN> RECOVER TABLE NCBSHOST.CS_TABLE UNTIL SCN 1674493 AUXILIARY DESTINATION '/tmp/oracle/recover’ DATAPUMP DESTINATION '/tmp/recover/dumpfiles’ REMAP TABLE ‘NCBSHOST'.‘CS_TABLE':‘CS_RECOVERED’; Supported options: UNTIL TIME, UNTIL SCN, UNTIL SEQUENCE
  • 12. RMAN Recover Table: Tips • Target database must be in READ WRITE mode • Determine if there are dependent tables that need to be included in the recovery, based on foreign key constraints • Ensure sufficient disk space on database server for auxiliary instance: SUM [SYSTEM, SYSAUX, UNDO, SYSEXT (if present), User Tablespace(s) that contain table(s)] • At least one full backup has been taken of the above tablespaces, along with backup of all archived logs • For recovering tables within a PDB, connect to CDB as ROOT user • If source table does not exist anymore (e.g. dropped), then table and all associated indexes, constraints, triggers will also be recovered • If source table exists, then table must be recovered with a new name (REMAP TABLE) or to a new tablespace (REMAP TABLESPACE).
  • 13. RMAN Recover Table - Process • Create a temporary auxiliary database on local database server • Restore and recover the table or table partition • Export the table/partition that is being recovered using the data pumps • Optionally import and rename the table/partition in the source database • Destroys the auxiliary database upon completion
  • 14. Restore/Recover over Network • Flexibility to restore full database, specific datafile, controlfile, spfile etc • Using RESTORE… FROM SERVICE and RECOVER… FROM SERVICE • Useful to fill-in the huge gap between primary and standby databases • restore/recover a data file from standby to primary RMAN> CONNECT TARGET “backupuser@primary_tns AS SYSBACKUP”; RMAN> RESTORE DATAFILE 9 FROM SERVICE standby_tns section size 5120M; • Roll-forward to in-sync standby with primary RMAN> CONNECT TARGET “backupuser@standby_tns AS SYSBACKUP”; RMAN> RECOVER DATABASE FROM SERVICE primary_tns USING COMPRESSED BACKUP;
  • 15. Transporting Data Across Platforms • Transporting databases, data files, and tablespaces • Using image copies and backup sets • Allows inconsistent tablespace backups Benefits: • Reduced down time for platform migrations • Choice of compression and multisection • Not catalogued in control file, not used for regular restore operations
  • 16. Notes • COMPATIBLE=12.0 (or greater) • Read-only mode for creation of cross-platform database backup • Database in read-write mode for creation of cross-platform tablespace backup • FOR TRANSPORT: backup can be transported to any destination • TO PLATFORM: conversion performs on the source database • DATAPUMP clause required for tablespace for last incremental backup • RESTORE FOREIGN: restore the cross-platform data backup set
  • 17. Transporting Database • Database mode: READ_ONLY • Back up the source database including control files • RMAN> BACKUP FOR TRANSPORT FORMAT '/bkp_dir/transp.bck‘ DATABASE; • RMAN> RESTORE FROM PLATFORM ‘AIX-Based Systems (64-bit)’ FOREIGN DATABASE TO NEW FROM BACKUPSET '/bkp_dir/transp.bck';
  • 18. Transporting Tablespace (AIX to Linux) On destination Linux host: - Create ‘shell’ database (SYSTEM, SYSAUX, UNDO) On source AIX database: - ALTER TABLESPACE PROJECTS, TASKS READ ONLY; - EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK(PROJECTS, TASKS, TRUE) - SELECT * FROM TRANSPORT_SET_VIOLATIONS; - Check that user tablespaces are self-contained - BACKUP FOR TRANSPORT FORMAT ‘/tmp/xplat_backups/trans_ts.bck’ DATAPUMP FORMAT ‘/tmp/xplat_backups/trans_ts_dmp.bck’ TABLESPACE PROJECTS, TASKS; - Copy all backups to destination server
  • 19. (cont’d) On destination Linux database: - Create tablespace users as they exist on source database - RESTORE FROM PLATFORM ‘AIX-Based Systems (64-bit)’ FOREIGN TABLESPACE PROJECTS, TASKS TO NEW FROM BACKUPSET ‘/tmp/xplat_restores/trans_ts.bck’ DUMP FILE FROM BACKUPSET ‘/tmp/xplat_restores/trans_ts_dmp.bck’; - Data file blocks automatically endian-converted during restore - Data Pump metadata dump file automatically imported to plug in user tablespaces - SQL> ALTER TABLESPACE PROJECTS, TASKS READ WRITE;
  • 20. Demo Recover Table Using RMAN Backupset Oracle Database 12c