0% found this document useful (0 votes)
3 views27 pages

06 Rman

The document outlines new features and best practices for RMAN in Oracle Database 12c, including fine-grained recovery for tables, cross-platform backup and restore capabilities, improved performance for cloning and standby databases, and multitenant database support. Key enhancements include simplified procedures for platform migration, reduced downtime during backups, and new commands for managing pluggable databases. The document also provides practical examples and tips for implementing these features effectively.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views27 pages

06 Rman

The document outlines new features and best practices for RMAN in Oracle Database 12c, including fine-grained recovery for tables, cross-platform backup and restore capabilities, improved performance for cloning and standby databases, and multitenant database support. Key enhancements include simplified procedures for platform migration, reduced downtime during backups, and new commands for managing pluggable databases. The document also provides practical examples and tips for implementing these features effectively.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

Oracle RMAN in
Oracle Database 12c:
New Features & Best Practices
Agenda

 RMAN..Through The Years


 What’s New in RMAN?
– Fine-Grained Recovery: Table Recovery from Backup
– Simplify Platform Migration: Cross-Platform Backup & Restore
– Improved Performance: Faster Clone and Standby Database Creation
– Multitenant Database: Pluggable Database Backup & Recovery

 Summary / Q&A

3 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


RMAN..Through The Years
15+ Years of Innovation

• Table Recovery
• Fast Recovery Area
• Parallel Backups • Cross-Platform
• DUPLICATE
• Fast Incremental
Backups
Backup & Restore
• Block Media Recovery
• Incrementally • Fast Active DUPLICATE
• Automatic Control File &
SPFILE Backup Updated Backups • Fast Standby Database
• CONFIGURE Persistent • SWITCH TO COPY Synchronization
Settings
• BACKUP BACKUPSET • Offload Backups to • Multitenant Database
Standby Database Backup & Recovery

Oracle8, Oracle8i, Oracle9i Oracle 10g, Oracle 11g Oracle Database 12c
Circa 1997-2002 Circa 2003-2012 June 2013

4 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Table Recovery From Backup
Fine-Grained Recovery
 Simple RECOVER TABLE command to
recover one or more tables/partitions
(most recent or older version) from an
101 RMAN backup
01 010
 Eliminates time and complexity associated
1 1 101001
1 011011110 with manual restore, recover & export
0 0 1 0 1 00 0 0
– Enables fine-grained point-in-time recovery
1001101
1010 of individual tables/partitions instead of the
01 RMAN contents of the entire tablespace
Backups
 Useful when there is insufficient UNDO to
perform Flashback Table

5 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Table Recovery: Under the Hood
Primary Auxiliary  RMAN backups taken as normal
Instance Instance
using DISK and/or SBT channels.
 Upon RECOVER TABLE, an auxiliary
instance is started using the primary
Data Pump control file,SYSTEM,SYSAUX,UNDO,
Import
and user tablespaces containing the
table(s).
 Auxiliary instance is recovered to the
desired time/SCN.
RMAN
Backups  Tables are imported by primary
instance via SQL*Net.
6 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Table Recovery: Under the Hood
Primary Auxiliary  RMAN backups taken as normal
Instance Instance
using DISK and/or SBT channels.
 Upon RECOVER TABLE, an auxiliary
instance is started using the primary
Data Pump control file,SYSTEM,SYSAUX,UNDO,
Import
and user tablespaces containing the
table(s).
 Auxiliary instance is recovered to the
desired time/SCN.
RMAN
Backups  Tables are imported by primary
instance via SQL*Net.
7 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Table Recovery Tips

 Database must be in ARCHIVELOG 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)]
 Ensure that at least one full backup has been taken of the above
tablespaces, along with backup of all archived logs since that time.

8 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Table Recovery Tips

 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).
– Indexes, constraints, triggers will NOT be recovered in this case.
 To manage table import yourself, use:
– RECOVER TABLE .. NOTABLEIMPORT
DATAPUMP DESTINATION <dir> DATAPUMP FILE <filename>

9 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Cross-Platform Backup & Restore
Simplified Platform Migration
Source Database (AIX) Destination Database (Linux)

1001
00 1010000 1
1 0110111101
1 1 101
1 0000101 00
1011110110 1

Backup User Restore Backup &


101 1 1
1001

Tablespaces & Plugin Tablespaces


DP Metadata Export (includes platform
to Disk/Tape conversion)

 Simplifies procedure for platform migration


 Minimize read-only impact using incremental-based approach

10 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Cross-Platform Backup & Restore Example
AIX to Linux
 On destination Linux host:
– Create ‘shell’ database (SYSTEM, SYSAUX, UNDO)

 On source AIX database:


– ALTER TABLESPACE PROJECTS, TASKS READ ONLY;
– SQL> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK(PROJECTS, TASKS, TRUE)
– SQL> 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

11 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Cross-Platform Backup & Restore Example
AIX to Linux (cont.)
 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;

12 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Minimize Read-Only Downtime on Source DB
How It Works

 Successive incrementals are converted & applied to restored data files,


while tablespaces are in read-write.
 Final incremental is taken while tablespaces are in read-only, including
backup of Data Pump metadata export.
 After final incremental is converted and applied to restored data files,
then user tablespaces are plugged in.
Reduce downtime by 8X versus traditional migration approaches

Oracle Database 10.2 and 11g Backups Can Be


Restored & Recovered Cross-Platform to Oracle Database 12c

13 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Minimize Read-Only Downtime Example
AIX to Linux using Incremental Backups
 On destination Linux host:
– Create ‘shell’ database (SYSTEM, SYSAUX, UNDO)

 On source AIX database (while tablespaces are read-write):


– Check that tablespaces are self-contained using DBMS_TTS.TRANSPORT_SET_CHECK
– Day 1: BACKUP FOR TRANSPORT ALLOW INCONSISTENT
INCREMENTAL LEVEL 0
TABLESPACE PROJECTS, TASKS
FORMAT '/tmp/xplat_backups/my_tbs_incon.bck';
– Day 2..N: BACKUP FOR TRANSPORT ALLOW INCONSISTENT
INCREMENTAL LEVEL 1
TABLESPACE PROJECTS, TASKS
FORMAT '/tmp/xplat_backups/my_tbs_incon1.bck';
– Copy backups to destination server
– Repeat INCREMENTAL LEVEL 1 backup + copy to destination server, as desired

14 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Minimize Read-Only Downtime Example
AIX to Linux using Incremental Backups (cont.)

 On destination Linux database (in parallel with incrementals taken on source):


– RESTORE FROM PLATFORM 'AIX-Based Systems (64-bit)’
FOREIGN DATAFILE
6 FORMAT '/tmp/aux/projects_tbs_6.df',
10 FORMAT '/tmp/aux/tasks_tbs_10.df'
FROM BACKUPSET '/tmp/xplat_restores/my_tbs_incon.bck';
– DATAFILE <#> is the <#> used in source AIX database
– RECOVER FROM PLATFORM 'AIX-Based Systems (64-bit)’
FOREIGN DATAFILECOPY
'/tmp/aux/projects_tbs_6.df',
'/tmp/aux/tasks_tbs_10.df'
FROM BACKUPSET '/tmp/xplat_restores/my_tbs_incon1.bck';
– Restores and converts incremental blocks, then applies blocks to the restored data files
– Run RECOVER command for each new incremental taken on source

15 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Backup & Restore: Minimize Read-Only Impact
Example: AIX to Linux using Incremental Backups (cont.)
 On source AIX database:
– Place user tablespaces in read-only mode, prior to final incremental and Data Pump dump file backups
– BACKUP FOR TRANSPORT INCREMENTAL LEVEL 1 TABLESPACE PROJECTS, TASKS
FORMAT '/tmp/xplat_backups/my_tbs_ro_incr.bck'
DATAPUMP FORMAT '/tmp/xplat_backups/my_tbs_dp.bck‘;
– Copy incremental and Data Pump metadata dump file backups to destination Linux host

 On destination Linux database:


– RECOVER FROM PLATFORM 'AIX-Based Systems (64-bit)’
FOREIGN DATAFILECOPY
'/tmp/aux/projects_tbs_6.df',
'/tmp/aux/tasks_tbs_10.df‘
FROM BACKUPSET '/tmp/xplat_restores/my_tbs_ro_incr.bck';
– RESTORE FROM PLATFORM ‘AIX-Based Systems (64-bit)'
DUMP FILE 'my_tbs_dp.dmp'
DATAPUMP DESTINATION '/tmp/dump'
FROM BACKUPSET '/tmp/xplat_restores/my_tbs_dp.bck';

16 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Backup & Restore: Minimize Read-Only Impact
Example: AIX to Linux using Incremental Backups (cont.)
 On destination Linux database:
– Create tablespace users as they exist on source database
– Run CREATE DIRECTORY to create DP_DIR directory object, mapped to dump file
directory
– IMPDP DIRECTORY=DP_DIR
DUMPFILE=my_tbs_dp.dmp
TRANSPORT_DATAFILES='/tmp/aux/projects_tbs_6.df’,
'/tmp/aux/tasks_tbs_10.df'
NOLOGFILE=Y
– Import Data Pump metadata dump file to ‘plug in’ new user tablespaces
– SQL> ALTER TABLESPACE PROJECTS, TASKS READ WRITE;

17 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Active DUPLICATE
One-Command Database Cloning

Copy Data Files, Archived Logs

Source Database Clone Database

 Active DUPLICATE debuted in Oracle Database 11g


– Create clone or standby database as of the current time
– Utilizes source (TARGET) database channels to copy data files and
archived logs to clone (AUXILIARY) database server – eliminates backup
staging area
– Performance typically gated by network bandwidth

18 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Oracle Database 12c Active DUPLICATE
Improved Performance via Reduced Network Consumption

Initiate RESTORE request

Data File & Archived Log Backup Sets


Source Database Clone Database

 New Active DUPLICATE


– Utilizes clone database channels to pull (i.e. restore) data files and archived
logs from source database
– Configure or allocate AUXILIARY channels >= TARGET channels
– Data files are packaged as backup sets – much smaller than copies
 RMAN compression and multi-section settings can also be specified

19 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Fast Standby Database Synchronization
Simplified Standby Sync-Up with Primary Database

Initiate Incremental Restore Request

Incremental Backup + Apply


Primary Database Standby Database
 RECOVER DATABASE FROM SERVICE <PRIMARY DB SID>
– Run command connected to standby database as TARGET and primary as AUXILIARY
– Generates incremental backup on primary as of the current SCN on standby database
– Incremental backup pulled from primary & applied on standby data files to sync up changes
– Refer to documentation for full procedure details:
 [Link]

20 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Multitenant Database Backup & Restore
• New PLUGGABLE DATABASE and ROOT keywords
• Connect in RMAN as:
• ROOT common user: Backup, Restore, Recover CDB or selected PDBs
• PDB local user: Backup & Restore PDB (excludes archived logs)
• Backup commands as ROOT user:
RMAN> BACKUP DATABASE; -- Backup CDB, including all PDBs
RMAN> BACKUP (PLUGGABLE DATABASE <PDB1>, <PDB2>);
RMAN> BACKUP TABLESPACE <PDB1>:<TBS1>, <PDB2>:<TBS1>;
• Restore commands as ROOT user:
RMAN> RESTORE DATABASE; -- Restore CDB, including all PDBs
RMAN> RESTORE DATABASE ROOT; -- Restore ROOT data files
RMAN> RESTORE PLUGGABLE DATABASE <PDB1>;
RMAN> RESTORE TABLESPACE <PDB2>:<TBS1>;

21 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Multitenant Database Recovery (ROOT user)
• CDB Complete Recovery (Root + All PDBs)
RMAN> RECOVER DATABASE;
• CDB Point-in-Time Recovery (Root + All PDBs)
RMAN> RUN {
SET UNTIL <TIME/SCN> <xxx>;
RESTORE DATABASE;
RECOVER DATABASE;
ALTER DATABASE OPEN RESETLOGS; }
• PDB Complete and Point-in-Time Recovery
RMAN> RUN {
SET UNTIL <TIME/SCN> <yyy>;
RESTORE PLUGGABLE DATABASE <PDB>;
RECOVER PLUGGABLE DATABASE <PDB>;
ALTER PLUGGABLE DATABASE <PDB> OPEN RESETLOGS; }

22 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Additional New Features

 Expanded Multisection Backup Support


– Multisection (BACKUP .. SECTION SIZE) debuted for full backups in
Oracle Database 11g
– Divides large data files into smaller sections that are backed up in parallel
– Now supported for incremental backups and image copies
– Incremental backup for each data file is divided into sections & backed up in parallel
– For image copies, sections are backed up in parallel & recomposed at the end
 Enhanced Separation of Duty
– New SYSBACKUP privilege only authorizes RMAN operations
 RMAN TARGET ‘<USER>/<PWD>’@<SID> AS SYSBACKUP

23 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


The Oracle Database Backup Logging
Recovery Appliance
 Leverages your existing RMAN skill set for centralized, consolidated
data protection of your entire Oracle database enterprise..more info at:
– [Link]/databasebackupappliance

24 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


Summary / Q&A
Oracle Database 12c RMAN Continues the Innovation..

 Fine-Grained Recovery: Table Recovery from Backup


 Simplify Platform Migration: Cross-Platform Backup and Restore
 Improved Performance:
– Fast Clone and Standby Database Creation
– Fast Synchronization of Standby Database
 Multitenant Database: Pluggable Database Backup and Recovery
 More Efficient Backups: Multisection Incrementals and Image Copies
 Enhanced Separation of Duty: SYSBACKUP Privilege

25 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.


26 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
27 Copyright © 2013, Oracle and/or its affiliates. All rights reserved.

You might also like