Oracle Database 12c has new enhancements and additions to Recovery Manager (RMAN).  The Recovery Manager continues to enhance and extend the reliability, efficiency, and availability of Oracle Database Backup and Recovery. In this article series, I will be explaining the new features and how it will help the Oracle community.

See new features covered in Part 1 – Oracle Database 12c – RMAN New Features: Part 1

In this article I will cover:

  • Multisection Backup Improvements
  • Restoring and Recovering Files Over Network
  • Storage Snapshot Optimization
  • Active Database Duplication Improvements

Multisection Backup Improvements

The multisection backup functionality was introduced in Oracle 11g to handle large data file backups. Using this functionality RMAN can break up a large file into sections during the backup and recovery, which can improve the performance of large datafiles backup. You can select the size using the SECTION SIZE keyword and each channel will create separate files within the backup set, and backup the database in parallel. This functionality supports only backup sets in 11g.

In Oracle 12c, the multisection backup supports incremental backups and image copies, including backup sets (introduced in 11g).  This functionality can only be used for data files, you cannot use this to backup control files.

If the SECTION SIZE that you selected is larger than the actual file then RMAN does not use multisection backup. If you specify a small SECTION SIZE that produces more than 256 sections then RMAN increases the SECTION SIZE to a value that results 256 sections.

The following example creates a multisection backup of the database using image copies.
RMAN> BACKUP AS COPY SECTION SIZE 1024M DATABASE;

The following example creates multisection incremental level1 backup
RMAN> BACKUP INCREMENTAL LEVEL 1 SECTION SIZE 1024M DATABASE;

To improve the backup performance, use unused block compression and block change tracking in conjunction with multisection incremental backups.

Restoring and Recovering Files over Network

Using RMAN you can restore and recover a database, datafile, controlfile, tablespace or spfile over the network from a physical standby database. To restore the database over the network, use the RESTORE… FROM SERVICE command and use the RECOVER…FROM SERVICE command to recover the database over the network. The FROM SERVICE clause specifies the service name of the physical standby.

You can also use multisection, compression and encryption to improve backup and restore performance.

  • Use SECTION SIZE with RESTORE command to perform multisection restore
  • Use SET ENCRYPTION clause before the RESTORE command to specify the encryption
  • Use USING COMPRESSED BACKUPSET clause to compress backup sets

This feature is useful to synchronize primary and standby database.  Here are the few scenarios

  • Roll-forward a physical standby database to sync with the primary database
  • Restore the primary database using physical standby database.
  • Restore physical standby database using the primary database.

In the following example restoring data file over the network from physical standby to primary database

Connected to primary database implicitly
RMAN> CONNECT TARGET /

Backup sets encrypted using AES128 encryption algorithm
RMAN> SET ENCRYPTION ALGORITHM 'AES128';

Restoring the datafile on the primary using datafile on physical database with service “standby_db”
RMAN> RESTORE DATAFILE '/db1/oradata/users.dbf' FROM SERVICE standby_db SECTION SIZE 1024M;

Storage Snapshot Optimization

This new feature enables you to take a storage snapshot of your database using third-party technologies without keeping the database in BACKUP mode. When you need to recover, you can use point in time of the snapshot. You can roll forward by using the database archive logs, and use this snapshot feature to recover part or all of the database.

The best practice is to use different storage location to keep snapshot than the one where the database currently running.

In order to backup your Oracle database using storage snapshot optimization, the third-party snapshot technologies must meet the following 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.

If third-party snapshot technology vendor cannot guarantee compliance with above requirements then you must keep the database in BACKUP mode to take the snapshot.

Follow these steps to keep the database in BACKUP mode and take snapshot

  1. SQL> ALTER DATABASE BEGIN BACKUP
  2. Take Snapshot using third-part technologies
  3. SQL> ALTER DATABASE END BACKUP

Use RECOVER…SNAPSHOT TIME command to recover the database in one step from RMAN or SQL*Plus. You can recover the database to a point-in-time or current time after the snapshot was taken. When performing point-in-time make sure that the recovery time cannot be earlier than the snapshot time.

To recover database completely use below command
RECOVER DATABASE;

To recover database using particular snapshot use below command
RECOVER DATABASE UNTIL TIME ‘10/10/2014 10:00:00’ SNAPSHOT TIME ‘10/10/2014 09:00:00’

In this example database will be recovered until ‘10/10/2014 10:00:00’ using snapshot taken on ‘10/10/2014 09:00:00’

To perform partial recovery using archived redo logs use below command
RECOVER DATABASE UNTIL CANCEL SNAPSHOT TIME ‘10/10/2014 09:00:00’

Note that UNTIL CANCEL clause is valid only in SQL*Plus

If there are any structural changes during the snapshot then the snapshots are unusable.  Do not perform the operations such as ONLINE, OFFLINE, DROP, RENAME, ADD, READONLY and SHRINK on data files and table spaces.

Active Database Duplication Improvements

Active Database duplication was introduced in Oracle Database 11g. Using this feature you can create clone or standby database by copying the data files and archive logs using the TARGET (Source) database channels over the network to clone AUXILIARY database. As you are using the TARGET database channels you will see processing load on the TARGET instance. In this method no backups of the TARGET database are required.

rman2pic1

In Oracle 11g, Performance typically gated by network bandwidth

In Oracle 12c, you can perform Active Database duplication using the backup sets. You can allocate sufficient AUXILIARY channels to connect TARGET database and retrieve the backup’s sets over the network, this reduced the load on the TARGET (source) database. You can use unused block compression to reduce the size of the backups transported over the network.

While performing the Active database duplication you can also encrypt backups and multisection backups.

rman2pic2

In Oracle 12c, it helps to reduce network consumption and improve performance

As you see in below duplication example, it is using AUXILIARY channel.

oracle@gc12c ~]$ rman target sys/password@TESTDB auxiliary sys/password@DUPDB 
Recovery Manager: Release 12.1.0.1.0 - Production on Wed Oct 15 10:26:58 2014 
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved. 

connected to target database: TESTDB (DBID=488428308732) 
connected to auxiliary database: DUPDB (not mounted) 

RMAN> run { 
2> duplicate target database to DUPDB from active database 
3>   db_file_name_convert('TESTDB','DUPDB'); 
4> } 

Starting Duplicate Db at 15-OCT-2014 10:27:11 
using target database control file instead of recovery catalog 
allocated channel: ORA_AUX_DISK_1 
channel ORA_AUX_DISK_1: SID=20 device type=DISK 
current log archived ……………….

Note that if the numbers of AUXILIARY channels allocated are less than target channels, or no auxiliary channels are allocated, then RMAN uses image copies to perform active database duplication. In order to RMAN use backup sets you need to establish connection to target database using a net service name and one of the following conditions must be satisfied.

  • The number of AUXILIARY channels should be equal or greater than TARGET channels
  • The DUPLICATION …FROM ACTIVE DATABASE should contain either USING BACKUPSET, USING COMPRESSED BACKUPSET or SECTION SIZE clause

Conclusion

Oracle Database 12c offers new enhancements and additions in Recovery Manager (RMAN). The above listed features will help user to backup the database in parallel, improve the backup performance, reduce the load on the source database during the active duplication, quickly create point-in-time copies using storage snapshot and easily synchronize primary and standby databases over the network. Take the advantage of new features for efficient backup and recovery.

 

Tags: , ,