Support for Container and Pluggable Databases
RMAN in 12c provides full backup and recovery support for a Pluggable Database environment. You can perform backup of the entire container database (CDB), either full or using incremental backup strategy, or one/many pluggable databases (PDB).
The following articles explains this feature in detail:
RMAN Pluggable Database Point in Time Recovery (Note 1521075.1)
RMAN Pluggable Database Backup and Recovery (Note 1521005.1)
SYSBACKUP Privilege
In 12c, Oracle support for separation of database administration (DBA) duties by introducing task specific administration duties. For backup and recovery administration this privilege is called SYSBACKUP. This allows grantees to perform backup and recovery tasks without the access to table data (as is the case with SYSDBA). This privilege includes permissions for backup and recovery (such as connecting to a closed database), does not include data access such as SELECT ANY TABLE. The SYSBACKUP privilege is automatically created during the installation of the Oracle database. Before it can be used, the SYSBACKUP user must be unlocked and granted. If you are using OS authorization, the SYSBACKUP=Y clause must be added when recreating the password file with orapwd. SYSDBA is still the default connection and thus if neither AS SYSBACKUP nor AS SYSDBA is specified in the connection string, then the connection will be made AS SYSDBA.
The SYSBACKUP user is granted the following:
SQL> select privilege from dba_sys_privs where grantee=’SYSBACKUP’;
PRIVILEGE —————————————- ALTER SYSTEM AUDIT ANY SELECT ANY TRANSACTION SELECT ANY DICTIONARY RESUMABLE CREATE ANY DIRECTORY UNLIMITED TABLESPACE ALTER TABLESPACE ALTER SESSION ALTER DATABASE CREATE ANY TABLE DROP TABLESPACE CREATE ANY CLUSTER
SQL Interface Improvements
In RMAN 12c, you can now execute SQL commands and PL/SQL procedures from the RMAN command line without prefixing the command with the SQL keyword. This includes select statements as well as the describe command which offers the same functionality as the sql*plus describe command. To access a table in a particular schema, you must have select privileges on the object. As SYSBACKUP privilege does not grant access to user tables or views, this privilege must be granted manually or a connection to SYSDBA must be made.
Recovery Manager: Release 12.1.0.1.0 – Production on Wed Feb 27 08:02:54 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target /
connected to target database: ORACLE (DBID=1558452677)
RMAN> alter session set nls_date_format = ‘dd-mon-yyyy hh24:mi:ss’;
using target database control file instead of recovery catalog
Statement processed
RMAN> select sysdate from dual;
SYSDATE ——————– 27-feb-2013 08:03:25
RMAN> desc v$logfile;
Name Null? Type —————————————– ——– —————————- GROUP# NUMBER STATUS VARCHAR2(7) TYPE VARCHAR2(7) MEMBER VARCHAR2(513) IS_RECOVERY_DEST_FILE VARCHAR2(3) CON_ID NUMBER
Multisection Backup Improvements
The smallest unit for an rman backup is an entire datafile. With the increase in datafile sizes, multisectional backup functionality was added in 11g. With this functionality RMAN can break up a large file into sections with backup and restore. The backup administrator selects a size (using SECTION SIZE keyword) for each process (channel) to read allowing the individual database to be backed up in parallel. Each process (channel) creates a separate file within the backupset.
In 12c, multisectional backups are available for all backup types, this includes backupsets (which was the functionality added in 11g), image copies and incremental backups. The use of this feature can reduce the completion time for non-backup use cases such as copying a file as part of transportable tablespace procedure or for creating a clone with the active database duplication.
This new functionality requires compatible to be set to 12.0 and is only used for datafiles. For example, it cannot be used to backup a controlfile. If a section size selected is larger than the file, then rman will not use multisectional backup for that file. By the same token, if the section size chosen is so small that more than 256 sections will be produced, RMAN will increase the section size to a value which will result in 256 sections. Note, depending on the syntax chosen, you can specify different section sizes for different files in the same backup job.
Recovery Manager: Release 12.1.0.1.0 – Production on Tue Mar 5 06:03:19 2013 Copyright (c) 1982, 2013, Oracle and/or its affiliates. All rights reserved.
connected to target database: ORACLE_C (DBID=2144146745)
RMAN> backup incremental level 1 section size 300M database; Starting backup at 05-MAR-13 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=365 device type=DISK allocated channel: ORA_DISK_2 channel ORA_DISK_2: SID=16 device type=DISK allocated channel: ORA_DISK_3 channel ORA_DISK_3: SID=133 device type=DISK allocated channel: ORA_DISK_4 channel ORA_DISK_4: SID=254 device type=DISK channel ORA_DISK_1: starting incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00003 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_SYSAUX_8LYWMRBC_.DBF backing up blocks 1 through 38400 channel ORA_DISK_1: starting piece 1 at 05-MAR-13 channel ORA_DISK_2: starting incremental level 1 datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00005 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_UNDOTBS1_8LYWR7B5_.DBF backing up blocks 1 through 38400 channel ORA_DISK_2: starting piece 1 at 05-MAR-13 channel ORA_DISK_3: starting incremental level 1 datafile backup set channel ORA_DISK_3: specifying datafile(s) in backup set input datafile file number=00001 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_SYSTEM_8LYWOT2Q_.DBF backing up blocks 1 through 38400 channel ORA_DISK_3: starting piece 1 at 05-MAR-13 channel ORA_DISK_4: starting incremental level 1 datafile backup set channel ORA_DISK_4: specifying datafile(s) in backup set input datafile file number=00004 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_SYSAUX_8LYX0ZLS_.DBF skipping datafile 00004 because it has not changed channel ORA_DISK_4: backup cancelled because all files were skipped channel ORA_DISK_4: starting incremental level 1 datafile backup set channel ORA_DISK_4: specifying datafile(s) in backup set input datafile file number=00003 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_SYSAUX_8LYWMRBC_.DBF backing up blocks 38401 through 76800 channel ORA_DISK_4: starting piece 2 at 05-MAR-13 channel ORA_DISK_2: finished piece 1 at 05-MAR-13 piece handle=C:APPORACLEFAST_RECOVERY_AREAORACLE_CDBBACKUPSET2013_03_05O1_MF_NNND1_TAG20130305T060331_8MCYSO3X_.BKP tag=TAG20130305T060331 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:09 channel ORA_DISK_2: starting incremental level 1 datafile backup set channel ORA_DISK_2: specifying datafile(s) in backup set input datafile file number=00003 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_SYSAUX_8LYWMRBC_.DBF backing up blocks 76801 through 103680 channel ORA_DISK_2: starting piece 3 at 05-MAR-13 channel ORA_DISK_3: finished piece 1 at 05-MAR-13 piece handle=C:APPORACLEFAST_RECOVERY_AREAORACLE_CDBBACKUPSET2013_03_05O1_MF_NNND1_TAG20130305T060331_8MCYSOC7_.BKP tag=TAG20130305T060331 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:13 channel ORA_DISK_3: starting incremental level 1 datafile backup set channel ORA_DISK_3: specifying datafile(s) in backup set input datafile file number=00005 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_UNDOTBS1_8LYWR7B5_.DBF backing up blocks 38401 through 76800 channel ORA_DISK_3: starting piece 2 at 05-MAR-13 channel ORA_DISK_1: finished piece 1 at 05-MAR-13 piece handle=C:APPORACLEFAST_RECOVERY_AREAORACLE_CDBBACKUPSET2013_03_05O1_MF_NNND1_TAG20130305T060331_8MCYSNVV_.BKP tag=TAG20130305T060331 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:16 channel ORA_DISK_1: starting incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00005 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_UNDOTBS1_8LYWR7B5_.DBF backing up blocks 76801 through 103680 channel ORA_DISK_1: starting piece 3 at 05-MAR-13 channel ORA_DISK_3: finished piece 2 at 05-MAR-13 piece handle=C:APPORACLEFAST_RECOVERY_AREAORACLE_CDBBACKUPSET2013_03_05O1_MF_NNND1_TAG20130305T060331_8MCYT36N_.BKP tag=TAG20130305T060331 comment=NONE channel ORA_DISK_3: backup set complete, elapsed time: 00:00:05 channel ORA_DISK_3: starting incremental level 1 datafile backup set channel ORA_DISK_3: specifying datafile(s) in backup set input datafile file number=00001 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_SYSTEM_8LYWOT2Q_.DBF backing up blocks 38401 through 76800 channel ORA_DISK_3: starting piece 2 at 05-MAR-13 channel ORA_DISK_1: finished piece 3 at 05-MAR-13 piece handle=C:APPORACLEFAST_RECOVERY_AREAORACLE_CDBBACKUPSET2013_03_05O1_MF_NNND1_TAG20130305T060331_8MCYT54L_.BKP tag=TAG20130305T060331 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06 channel ORA_DISK_1: starting incremental level 1 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00001 name=C:APPORACLEORADATAORACLE_CDBDATAFILEO1_MF_SYSTEM_8LYWOT2Q_.DBF backing up blocks 76801 through 98560 channel ORA_DISK_1: starting piece 3 at 05-MAR-13 channel ORA_DISK_2: finished piece 3 at 05-MAR-13 piece handle=C:APPORACLEFAST_RECOVERY_AREAORACLE_CDBBACKUPSET2013_03_05O1_MF_NNND1_TAG20130305T060331_8MCYT2XM_.BKP tag=TAG20130305T060331 comment=NONE channel ORA_DISK_2: backup set complete, elapsed time: 00:00:13 …………
Active Database Duplication Improvements
The active duplicate option was implemented in RMAN 11g, this functionality used a push process from target (source) to the auxiliary (destination) sending full image datafile copies across the network. The target channels did the work pushing the datafile across the network to the auxiliary instance from the target database.
In 12c, by default RMAN uses a “pull” (or restore) process and uses backupsets for active duplication. Rather than the image copy of the datafile, rman sends datafile data as backupsets to the auxiliary instance and from within that instances restores the datafiles. Preexisting backups are not used by this operation, instead, rman will create a new backupset on the source and directly transmit (through Sql*net) to the auxiliary. With the use of backupsets, options such as compression, section size and/or encryption become available and can be added within the duplicate command.
In 12c to parallelize the active duplicate execution, multiple auxiliary channels must be allocated rather than target channels as is the case in 11g.
This new functionality reduces the impact on the source database during the active duplication process by off-loading the data transfer operations to the auxiliary server. A reduced duplication time for database with large files can be achieved by spreading out the restore workload using compression and/or multisectional backup.
NOOPEN option for rman duplicate
In 12c, you can now specify that you do not want the auxiliary database to be opened once the duplicate command completes. With this option, rman will complete its tasks and leave the cloned database in a MOUNT state ready for opening. In prior versions the duplicated database was automatically opened by RMAN as the last step of the process. Besides other potential uses, the NOOPEN option allows you to:
Configure fast incremental backups or flashback database settings.
Modify block change tracking file name/location.
Upgrade a database by opening the database in UPGRADE mode and running the appropriate upgrade scripts.
Backup/restore with 3rd party snapshot technology
In earlier version of RMAN, in order to create a backup using third-party snapshots, you had to place the database in backup mode (begin backup) to take a storage snapshot. In 12c, this requirement has been removed as long as ALL the following conditions are met:
Database crash consistent at the point of the snapshot AND
Write ordering is preserved for each file within a snapshot AND
Snapshot stores the time at which a snapshot is completed.
In 12c, you can use the new keyword SNAPSHOT TIME with the RECOVER command to recover a snapshot that is taken without the datafiles being placed in backup mode. For example, you can now:
Recover a database using most recent snapshot:
RMAN> recover database;
Recover a database using a particular snapshot:
RMAN> recover database UNTIL TIME ‘02/26/2013 11:00:00’ SNAPSHOT TIME ‘02/26/2013 10:00:00’;
Perform a partial recovery using archivelog files:
RMAN> recover database until cancel SNAPSHOT TIME ‘02/26/2013 10:00:00’;
Cross-Platform Backup and Restore Improvements
RMAN enables you to transport databases, datafiles and tablespaces across platforms. This includes transporting tablespaces across platforms with different endian formats. Prior to 12c, all cross-platofm data transport required the use of image copies. In 12c, you can now transport data across platforms by using backupsets. Also, Oracle 12c allows the use of inconsistent backup, that is one created when a tablespace is in READ WRITE. Prior versions required it to be in READ ONLY.
With the use of backupsets, you can choose compression and multisection options which may reduce the overall transport time. When developing a database transport strategy, you need to consider the endian format of the platform and the database open mode. For example:
Transport at the database level requires the same endian format (on source and destination) and READ ONLY mode of the source database (which may not be desirable).
Tablespaces and backupsets can be transported across platforms of same OR different endian format while the source database remains online in READ WRITE mode. In this case, most of the work is done with the source database available in READ WRITE mode. One final step (a small incremental backup) is taken with the database in READ ONLY mode. This is required so that the database can be opened in a consistent state
In 12c, rman offers the option following options with the backup command:
FOR TRANSPORT: This options creates a backupset which can be transported to any destination. If the destination database uses a different endian format than the source, the endian format conversion is performed on the destination database.
TO PLATFORM: This option results in the endian format conversion to be performed on the source database and must be used by that supported platform only.
DATAPUMP: This specifies that a data pump export dump file is created while performing a cross-platform backup. The dump file is created in s separate backup set.
Recovering Tables and Table Partitions from RMAN Backups
Within RMAN 12c, you can now recover a particular table or table partition back in time without affecting the rest of the objects within the database and/or tablespace. This includes recovering a purged (truncated) or dropped table. RMAN 12c will create an auxiliary instance in a separate disk location of required files, recovers the tables or table partitions up to a desired point in time. It will then create a data pump export dump containing the recovered objects. Options are available to not import the table (NOTABLEIMPORT) or optionally rename the recovered tables or table partition with the REMAP TABLE or REMAP TABLESPACE clauses.
This option is available for:
Small number of tables
Tables not in self-contained tablespaces
Purged tables
Table data beyond available undo
Tables which have had a structural DDL change.
The following article explains this feature in detail: RMAN RECOVER TABLE Feature New to Oracle Database 12c (Note 1521524.1)
Restoring and Recovering Files Over a Network
In RMAN 12c, you can restore or recover files over the network. Backupsets are used and thus allows for use of multisection backups, encryption, and compression to improve the backup and restore performance.
This option is very useful in scenarios involving a standby database. You can:
Restore or recover files lost by connecting through the network on one database (standby/primary) which is available on the other database.
Recover a standby database to using an incremental backup taken off the primary to roll forward the standby.
Unified auditing and RMAN:
In 12c Oracle, the UNIFIED_AUDIT_TRAIL data dictionary view has a set of fields (prefixed with RMAN_) which automatically record RMAN related events. However, you must have the AUDIT_ADMIN or AUDIT_VIEWER role in order to query the UNIFIED_AUDIT_TRAIL view to see these events.
Comments