Aman sharma RMAN_12c_new_features_sangam2013

2,339 views

Published on

Published in: Technology
3 Comments
3 Likes
Statistics
Notes
No Downloads
Views
Total views
2,339
On SlideShare
0
From Embeds
0
Number of Embeds
19
Actions
Shares
0
Downloads
148
Comments
3
Likes
3
Embeds 0
No embeds

No notes for slide

Aman sharma RMAN_12c_new_features_sangam2013

  1. 1. What’s New in 12c RMAN? Aman Sharma
  2. 2. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multitenant database Using RMAN in multitenant environment Using RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Multi-section Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 2
  3. 3. Who Am I?          Aman Sharma About 12+ years using Oracle Database Oracle ACE Frequent Contributor to OTN Database forum(Aman….) Oracle Certified Sun Certified Twitter : @amansharma81 * Oracle Blog : http://blog.aristadba.com * Email: amansharma@aristadba.com Aman Sharma- Sangam 2013 3
  4. 4. My Books Aman Sharma- Sangam 2013 4
  5. 5. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multitenant database architecture Using RMAN in multitenant environment Using RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Multi-section Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 5
  6. 6. 11g Database Architecture(simplified) Instance SALES App Buffer Cache Shared Pool LGWR DBWR System Metadata ORL User Metadata User Data SALES Database PMON ARCH SYSTEM SYSAUX FLBLOG Aman Sharma- Sangam 2013 BKUP CTL UNDO TEMP 6
  7. 7. The More The Merrier? SALES App HR App Shared Pool LGWR System Metadata DBWR Shared Pool PMON LGWR PMON HR ARCH ORL CTL ARCH ORL SYSAUX UNDO DBWR User Data User Metadata SALES SYSTEM Buffer Cache System Metadata User Data User Metadata Buffer Cache SALES TEMP SYSTEM SYSAUX UNDO Aman Sharma- Sangam 2013 CTL HR TEMP 7
  8. 8. Not really!! • The databases are created for each client/account • Each database is a tenant at the server • Each database would need its own system resources • Consolidation, if the number of db’s is large, becomes a major challenge • Schemas are used to ensure privacy • Provisioning takes a huge time • Patching, not only becomes complex but also takes a huge time Aman Sharma- Sangam 2013 8
  9. 9. Which Is Better? Aman Sharma- Sangam 2013 9
  10. 10. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multi-tenant database architecture Using RMAN in multi-tenant environment Using RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Multi-section Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 10
  11. 11. 12c Multi-tenant Database • First database release made for cloud and consilidation • Using 12c Multitenant architecture, DBA’s can create private database clouds • Enables database to be used as DbaaS • Much efficient resource sharing among databases • Reduced overhead for memory and storage • Ensures privacy and enables role separation for database management • Rapid provisioning and cloning • Patching and upgrading becomes easier, less time consuming Aman Sharma- Sangam 2013 11
  12. 12. 12c Multi-tenant Database (cont.) • Fully RAC compatible • Compatible with non-CDB databases • Using Cloud Control 12c and SQL Developer, management of CDB’s and PDB’s become much easier • Ease in performance troubleshooting • Easy migration of PDB’s between different environments i.e. database releases • Complete control over resource management using Resource Manager for both CDB and PDB • Manage many databases as one!! Aman Sharma- Sangam 2013 12
  13. 13. Multi-tenant Database Architecture(simplified) CDB Instance CDB Database CON_ID=0 ROOT container SEED CON_ID=1 SALES PDB CON_ID=3 CON_ID=2 HR PDB FINANCE PDB CON_ID=4 CON_ID=5 Aman Sharma- Sangam 2013 13
  14. 14. Containers in Multitenant Database • A multitenant CDB database always contains – ROOT container – SEED container • A CDB may also contain – PDB container • Within one CDB, there can be maximum 252 PDB’s(for Enterprise Edition) • Crossing the threshold throws ORA-65010 • Within one CDB,one PDB is allowed for free. More than 1 would require you to pay $ • For Standard Edition, only one Pluggable database is allowed • An Instance is allocated for the whole CDB database • V$CONTAINERS Aman Sharma- Sangam 2013 14
  15. 15. CDB Instance CDB Instance SGA PDB1    SGA PDB2  LGWR DBWR PMON   Alert Log Maintained by SYS user Allocated for the CDB only Maintained by CDB SPfile/PFILE enable_pluggable_database= TRUE No PDB specific SPFILE/PFILE Parameter(s) changed at PDB level don’t go up to their CDB database SPFILE Aman Sharma- Sangam 2013 15
  16. 16. Root Container CDB Database CON_ID=0 PDB$SEED CDB$ROOT CON_ID=1 OBJ$ CON_ID=2 RSRCMGR TAB$ USER$ System Metadata ORL SYSTEM SYSAUX FLBLOG Aman Sharma- Sangam 2013 ARCH BKUP CTL UNDO TEMP 16
  17. 17. Root Container • • • • • • • • The very first tenant of the multitenant database CDB$ROOT(predefined) Contains data files, online redo logs, control files, Undo Contains system metadata Contains information about underlying PDB’s Contains common users Shouldn’t contain user data Resource Manager-for both CDB and underlying PDB’s • Managed by a Container DBA(CDBA) • Backup support by RMAN Aman Sharma- Sangam 2013 17
  18. 18. Seed Container     PSDB$SEED SYSTEM SYSAUX CON_ID=2 TEMP     Aman Sharma- Sangam 2013 Default Pluggable database Created at the time of creation of the multitenant database Named as PDB$SEED Acts as a template for creating pluggable databases in the future Users/DBA’s can’t create and modify objects in the seed database Can not be deleted One CDB contains only one SEED container Backup support by RMAN 18
  19. 19. Pluggable Container/DB(PDB) CDB Database CDB$ROOT OBJ$ PDB$SEED TAB$ USER$ System Metadata SYSTEM Metadata Link OBJ$ TAB$ Customers USER$ SALES ARCH CTL RSRCMGR Country USER Metadata SYSTEM SYSAUX TEMP RSRCMGR ORL SALES PDB SYSAUX USERS USER Data TEMP Aman Sharma- Sangam 2013 SYSTEM SYSAUX UNDO FLBLOG TEMP 19
  20. 20. Pluggable Container • • • • • • • User defined and created Explicitly named Stores user-data & user-metadata For applications, appear as a normal database Contains local users-specific to exactly one PDB PDB specific Resource Manager 252 Pluggable containers maximum are allowed in one CDB • Managed by PDB DBA(PDBA) • Linked with other PDB’s using inter-PDB DB link • V$PDBS, DBA_PDBS Aman Sharma- Sangam 2013 20
  21. 21. SGA PDB1 SALES App SGA PDB2 HR App CDB Instance LGWR CDB$ROOT TAB$ SMON CDB Database PSDB$SEED RSRCMGR OBJ$ DBWR USER$ SYSTEM SYSAUX ARCH ORL TEMP SYSTEM CTL SYSAUX System Metadata UNDO TEMP FLBL Metadata Link SALES PDB RSRCMGR RSRCMGR Customers OBJ$ TAB$ USER$ USER Metadata SYSTEM SYSAUX USER Data Country HR PDB EMP Inter PDB DB Link OBJ$ TAB$ USER$ USER Metadata SALES TEMP SYSTEM Aman Sharma- Sangam 2013 SYSAUX USER Data DEPT HR TEMP 21
  22. 22. Are You Thinking? Aman Sharma- Sangam 2013 22
  23. 23. Well, Don’t Forget!! Aman Sharma- Sangam 2013 23
  24. 24. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multi-tenant database architecture Using RMAN in multi-tenant environment Using RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c enhancements for multi-section backups & database duplication  12c enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 24
  25. 25. RMAN in Multitenant Environment PDB Non-CDB RMAN CDB CDB$ROOT Aman Sharma- Sangam 2013 25
  26. 26. BACKUP command-12c! RMAN>BACKUP DATABASE; • Backup of whole database(CDB/non-CDB) RMAN>BACKUP PLUGGABLE DATABASE HRPDB; • Backup of pluggable database(s) RMAN>BACKUP PLUGGABLE DATABASE ROOT; • Backup of ROOT container database RMAN> BACKUP TABLESPACE HRPDB:HR_TBS; • Partial backup of pluggable database Aman Sharma- Sangam 2013 26
  27. 27. RECOVER command -12c! RMAN>RECOVER DATABASE; • To recover whole database(CDB/non-CDB) RMAN>RECOVER PLUGGABLE DATABASE HRPDB; • To recover pluggable database(s) RMAN>RECOVER PLUGGABLE DATABASE ROOT; • To recover ROOT container database RMAN>RECOVER TABLESPACE HRPDB:HR_TBS; • TO recover partially pluggable database Aman Sharma- Sangam 2013 27
  28. 28. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multitenant database RMAN in multitenant environment RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Multi-section Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 28
  29. 29. Performing Recovery of Table-pre 12c • Using Tablespace Point-in-time recovery(TSPITR) • Using Database Point-in-time recovery(DBPITR) • Using Recycle Bin • Using Flashback Table command You know it already! Sounds good, so why we need anything new? Aman Sharma- Sangam 2013 29
  30. 30. Limitations in table recovery using old techniques • Using DBPITR for a one or just a few tables is just likereplacing engine too along with the flat wheel of your car! • For recovery of a single table, TSPITR is also not much different from DBPITR . • Both DBPITR & TSPITR move the entire database or tablespace back in the time. • For TSPITR, the tablespace must be self-contained. • Table dropped with PURGE option can’t be recovered using Recycle Bin. • Flashback Table command only works if there is no structural change done over the table. • If there is no sufficient Undo data available, Flashback Table won’t work. Aman Sharma- Sangam 2013 30
  31. 31. 12c RMAN Table-mode Recovery • New feature in RMAN 12c • Enables the recovery of table(s) and table-partition(s) using RMAN • Uses database backups(Backup Sets) and archived redo logs • Database remains online(read-write) while recovery proceeds • Happens at an auxiliary location • Uses an automatically created & maintained Auxiliary instance • Other database objects remain untouched and accessible • Requires that the database must be – Archive log mode – COMPATIBLE=12.0 – OPEN_MODE=READ WRITE Aman Sharma- Sangam 2013 31
  32. 32. RMAN Table Recovery-Process Flow Recover Table(along with options) Backup is located Auxiliary instance creation at the mentioned destination Automatic Import of the recovered table in the database Automatic creation of EXPDP Dump File containing the recovered table Recovery gets performed using the backups at the auxiliary location Auxiliary instance, DUMP file are removed RMAN renames the recovered table(optional) Table Recovery is complete! Aman Sharma- Sangam 2013 32
  33. 33. RMAN Table Recovery-Options • Recovery Point-in-Time options – Until Time(requires NLS_LANG & NLS_DATE_FORMAT) – Until SCN – Until Sequence • Optional Configurations – AUXILIARY DESTINATION: • Path for the auxiliary instance creation – DUMP FILE • Name of the dump file which would contain the recovered table – DATAPUMP DESTINATION • OS path for the export dump file – NOTABLEIMPORT • To not do the automatic import of the recovered table in the target database – REMAP TABLE/TABLESPACE • To rename the recovered table or to move to a new tablespace Aman Sharma- Sangam 2013 33
  34. 34. RMAN Table Recovery-Examples RMAN> RECOVER TABLE AMAN.TESTTAB OF PLUGGABLE DATABASE APDB UNTIL TIME "to_date('2013-09-13:22:30:00','YYYY-MMDD:HH24:MI:SS')" AUXILIARY DESTINATION '/tmp' DATAPUMP DESTINATION '/tmp' DUMP FILE 'rtab_dump.dmp'; RMAN> RECOVER TABLE AMAN.TESTTAB OF PLUGGABLE DATABASE APDB UNTIL SCN 2235227 AUXILIARY DESTINATION '/tmp/aux' DATAPUMP DESTINATION '/tmp/dump/' DUMP FILE 'rtab_dump.dmp'; Aman Sharma- Sangam 2013 34
  35. 35. RMAN Table Recovery-Limitations • Tables and table partitions belonging to SYS schema can not be recovered • Tables and table partitions belonging to the tablespaces SYSTEM and SYSAUX can not be recovered • Tables and table partitions on standby databases can not be recovered • Tables with named NOT NULL constraints can not be recovered with the REMAP option Aman Sharma- Sangam 2013 35
  36. 36. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multitenant database RMAN in multitenant environment RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Incremental Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 36
  37. 37. Support for SQL statements in RMAN • RMAN of versions before 12.1 requires SQL prefix RMAN> SQL ‘alter system archive log current’; • From 12.1 onwards, no SQL prefix is required RMAN> select INSTANCE_NAME,STATUS from V$INSTANCE; • DESC[RIBE]command is supported natively RMAN> DESC HR.DEPARTMENTS Aman Sharma- Sangam 2013 37
  38. 38. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multi-tenant database architecture Using RMAN in multi-tenant environment Using RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Multi-Section Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 38
  39. 39. SYSBACKUP Role in 12c • New predefined role-exclusively for backup/recovery operations • Enables to create separation of duties for different database administration related tasks – SYS user with the SYSDBA role, for complete control – Non-default user with the DBA role, for day-to-day activities and normal usage – Non-default user with the SYSBACKUP Role-for backup/recovery related tasks • Privileges included in the SYSBACKUP role (partial list) – STARTUP/SHUTDOWN – Create Control File, SPFILE, PFILE – FLASHBACK DATABASE • Does not include SELECT ANY TABLE privilege • Created with the database installation • Using SYSBACKUP role in the OS authentication logs you as (new) SYSBACKUP schema • Best practice- create a new, non-default schema with the SYSBACKUP role assigned to it, for both CDB and PDB containers Aman Sharma- Sangam 2013 39
  40. 40. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multi-tenant database architecture Using RMAN in multi-tenant environment Using RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Multi-section Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 40
  41. 41. Multi-section Backup Enhancements • Multi-section backups, in the previous release – For Backup Set format only – For full backups only • Since 12c onwards, Multi-section backups are supported for – Backup Set & Image Copy formats – Full & Incremental Backups • Applies only to the data files • Benefits remain the same-faster backups/restores Aman Sharma- Sangam 2013 41
  42. 42. RMAN DUPLICATE command Enhancements • 11.1 introduced ACTIVE DATABASE DUPLICATION – Uses Image Copies – Known as Push method • 11.2 enhanced the same – Connection to the target database made optional • 12c further enhances the DUPLICATE command – Support for Backup Sets – Termed as Pull method • Support for – – – – Compressed backup sets Encryption Multi-section backups NOOPEN option Aman Sharma- Sangam 2013 42
  43. 43. Presentation Agenda        Introduction to pre 12.1 Databases Introduction to 12c Multi-tenant database architecture Using RMAN in multi-tenant environment Using RMAN for Table-mode recovery Enhanced support for SQL statements Separation of duties using SYSBACKUP role 12c Enhancements for Multi-section Backups & Database Duplication  12c Enhancements for Cross platform Data transport  Q&A Aman Sharma- Sangam 2013 43
  44. 44. Cross-Platform Transport Enhancements • 8i introduced the feature of Transport Tablespace – Databases, source and destination , must match in the block size – OS must be the same across the source and target databases • 9i enhanced the same feature with Multiple Block Size support – OS still must be the same across the source and target database • 10.1 introduced Cross Platform Tablespace Feature – Uses Image Copies – Convert DATAFILE/TABLESPACE • 10.2 enhanced the same feature with the option of Cross Platform Database – Convert DATABASE • 12c further enhances the Cross Platform Transport – Support for Backup Sets • Support for – Compressed backup sets – Multi-section backups – Allows inconsistent tablespace backups • Completely supported for Multitenant environment Backup sets created for cross platform transport are NOT cataloged in the control file Aman Sharma- Sangam 2013 44
  45. 45. 12c Cross Platform Transport-Going Deeper • Prerequisites – COMPATIBLE = 12.0 – Source Database= Read Only (for Cross Platform Database transport) – Source Database= Read Write(for Cross Platform Tablespace transport) • New Options – To perform Cross Platform database backup using Backup Sets • BACKUP To Platform(conversion would be done on the source host) • BACKUP For Transform(conversion would be done on the target host) – To restore the cross platform database backup over the destination host • RESTORE FOREIGN – To perform the Cross Platform tablespace backup • BACKUP To Platform….DATAPUMP • BACKUP For Platform….DATAPUMP – To perform the inconsistent tablespace backup • ALLOW INCONSISTENT Aman Sharma- Sangam 2013 45
  46. 46. Cross Platform Tablespace Inconsistent Backups • Cross Platform Tablespace transport in prior versions – Source Tablespace= Read Only – Source Database= Read Write – Can be used right away to plug-in the tablespace at the destination database – Tablespace being in read-only mode may cause application a downtime • Cross Platform Tablespace transport using Inconsistent backup – – – – – – – – – – Uses new option ALLOW INCONSISTENT The source tablespace remains ONLINE (READ ONLY) get host) The resultant backup is inconsistent as DML’s keep on hitting the data file The foreign data file, resulted during this backup, can not be used directly into the destination database Inconsistent data file is made consistent using the cross platform incremental backups A base level 0 backup and subsequent level 1 backups are created and applied over the destination database These backups are taken when the tablepsace is online A final level 1 backup is taken with the tablespace as read only RESTORE FOREIGN TABLESPACE/DATAFILE RECOVER FOREIGN DATAFILE COPY Aman Sharma- Sangam 2013 46
  47. 47. 12c Cross Platform Transport-Example RMAN>BACKUP To Platform ‘Linux x86 64-bit’ Format ‘/tmp/bkup_trans.bck’ DATABASE; • To perform the conversion on the source host RMAN>BACKUP For Transport Format ‘/tmp/bkup_trans.bck’ DATABASE; • To perform the conversion on the target host RMAN>RESTORE Foreign Database to NEW from BACKUP SET ‘/tmp/bkup_trans.bck’; • To restore the backup in the target host RMAN>BACKUP For Transport ‘/tmp/bkup_tbstrans.bck’ DATAPUMP ‘/tmp/tbs.dmp’ TABLESPACE USERS; • To perform the conversion for tablespace on the source host Aman Sharma- Sangam 2013 47
  48. 48. Final words!  Usually when it’s about RMAN, response is or  But remember, RMAN is      oracle database’s “the tool” for performing backups and recovery tasks Have been around from a loong time(since 8.0.3) FREE!! Getting improved and more feature-rich with almost every release Worth giving a try and implemented so give RMAN a chance! Aman Sharma- Sangam 2013 48
  49. 49. Thank You! Aman Sharma- Sangam 2013 49

×