Backup & Recovery Oracle 12c New Features Peter Jensch Principial Consultant DOAG Regionaltreffen Stuttgart BASEL BERN BRUGG LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN 1
AGENDA Backup & Recovery 1. Multitenant und Backup 2. Flashback 3. Duplicate 4. Table Recovery from Backup 5. Cross Platform Migration 6. New Security Features 7. TVD-Backup 2
Backup & Recovery Multitenant 12c Database Non-Container 12c Database (non-cdb) Architecture System Metadata PMON SMON LGWR DBW0 DIAG OBJ$ COL$ TAB$ User Metadata SYSTEM SYSAUX UNDO DATA IDX EMP DEPT HR SH connect target / backup database...; backup archivelog all...; 3
Backup & Recovery Multitenant 12c Database Container 12c Database (CDB) Architecture PMON SMON LGWR DBW0 DIAG SYSTEM SYSAUX UNDO TEMP REDO CTL CDB$ROOT [RW] PDB$SEED [RO] SYSTEM SYSAUX TEMP CRM01 [RW] SYSTEM SYSAUX TEMP CRM DBA FA01 [RW] SYSTEM SYSAUX TEMP FA DBA APP DBA CDB DBA 4
Backup & Recovery Multitenant 12c Database Vollständiges Backup der Container Datenbank (CDB) Anmeldung am root container root, seed und alle PDB s werden gesichert zusätzliche Archivelog Sicherung ist möglich connect target / backup database plus archivelog; RMAN syntax fully supports the multitenant architecture feature 5
Backup & Recovery Multitenant 12c Database Backup von Pluggable Datenbanken (PDB) Anmeldung am root container Anmeldung an der PDB Archivelog Sicherung ist möglich connect target / backup pluggable database pdb01, pdb02 plus archivelog; 6
Backup & Recovery Multitenant 12c Database Backup von Pluggable Datenbanken (PDB) Anmeldung am root container Anmeldung an der PDB keine zusätzliche Archivelog Sicherung ist möglich connect target sys/manager@pdb01.trivadis.com backup database; 7
Backup & Recovery Multitenant 12c Database Backup Tablespaces und Data Files Backup Tablespaces Tablespace Bezeichnungen sind nicht eindeutig Anmeldung an der PDB Backup Data Files File-ID und File-Name sind eindeutig connect target / backup tablespace pdb01:system, pdb02:sysaux; 8
Backup & Recovery Multitenant 12c Database CDB und RMAN Catalog RMAN Catalog Objekte wurden erweitert RC_PDBS RC_PLUGGABLE_DATABASE_INC Einige Views wurden um das Attribut PDB_KEY ergänzt [list crosscheck] backup of pluggable database pdb01; report need backup pluggable database pdb01; 9
Backup & Recovery Multitenant 12c Database Vollständiger Restore und Recovery Für CDB Datenbanken wie bisher Für Pluggable Databases connect target / alter pluggable database pdb01 close; restore pluggable database pdb01; recover pluggable database pdb01; alter pluggable database pdb01 open; 10
Backup & Recovery Multitenant 12c Database Unvollständiger Restore und Recovery (PITR) Für CDB Datenbanken wie bisher Für Pluggable Databases gemeinsam verwendete Tablespaces werden in einer auxiliary destination restored connect target / alter pluggable database pdb01 close; restore pluggable database pdb01 until sequence 61; recover pluggable database pdb01 until sequence 61 auxiliary destination '/u02/oradata/aux'; alter pluggable database pdb01 open resetlogs; 11
AGENDA Backup & Recovery 1. Multitenant und Backup 2. Flashback 3. Duplicate 4. Table Recovery from Backup 5. Cross Platform Migration 6. New Security Features 7. TVD-Backup 12
Backup & Recovery Multitenant 12c Database Flashback Database CDB Für CDB Datenbanken wie bisher Für Pluggable Databases nicht verwendbar nur mit Workaround über PDB PITR möglich Offline PDB PITR data files Flashback CDB PITR für die PDB Open database resetlogs und alle Datenfiles online nehmen 13
AGENDA Backup & Recovery 1. Multitenant und Backup 2. Flashback 3. Duplicate 4. Table Recovery from Backup 5. Cross Platform Migration 6. New Security Features 7. TVD-Backup 14
Backup & Recovery Active Database Duplicate Active duplicate verwendet backup sets per default (12c) pull-based method neue Optionen mit 12c Backup Sets werden direkt über Oracle Net angesprochen unused block compression Advanced Compression - BASIC algorithm (free) - ansonsten ACO notwendig Multi Section Backup Methode verwendbar - z.bsp. bei Big-File Tablespace Reduzierung der Netzwerk Last bei Verwendung der Komprimierung 15
Backup & Recovery Active Database Duplicate (CDB) Zusätzlicher Parameter notwendig *.enable_pluggable_database = true CDB Option bei unterschiedlichen PDBs Tablespace Option (SKIP) Exclude PDBs with SKIP Option Include PDBs ohne SKIP Option duplicate target <...> [skip] pluggable database pdb01; 16
Backup & Recovery Active Database Duplicate (CDB) Beispiel Compression backup sets Multi Section Backup NOOPEN Option Skip Pluggable Database (PDB02) run { allocate auxiliary channel chaux1 device type disk; allocate channel ch1 device type disk; duplicate target database to cdbdup from active database skip pluggable database pdb02 using compressed backupset section size 300m noopen; alter database open resetlogs; alter pluggable database all open; } 17
AGENDA Backup & Recovery 1. Multitenant und Backup 2. Flashback 3. Duplicate 4. Table Recovery from Backup 5. Cross Platform Migration 6. New Security Features 7. TVD-Backup 18
Backup & Recovery Table Recovery from Backup Recover von einzelnen Tabellen bzw. Partitionen mit einem RMAN Befehl Was wird ausgeführt: RMAN erzeugt PITR vom Tablespace RMAN verwendet eine Auxiliary Instanz RMAN führt einen DataPump Export durch RMAN führt optional einen DataPump Import durch RMAN führt optional einen rename durch Und wann geht s nicht: Wenn SYS Eigentümer Objekt im Tablespace SYSTEM oder SYSAUX Objekt in einer Standby Datenbank Tabellen mit bezeichneten NOT NULL Constraints und einer REMAP Option 19
Backup & Recovery Table Recovery from Backup Beispiel Table Recovery: recover table scott.emp until scn 441427 auxiliary destination '/u02/oradata/aux'; Beispiel Table Partition Recovery: recover table scott.emp_part:part201404 to restore point before_drop auxiliary destination '/u02/oradata/aux' remap table scott.emp_part:part201404_restore; 20
Backup & Recovery Table Recovery from Backup Fehler bei Ausführung in einer CBD RMAN beendet die Ausführung beim Auxiliary Restore / Recovery Offener SR bei Oracle Zusätzliche Table Recovery Command Optionen; DATAPUMP DESTINATION DUMP FILE NOTABLEIMPORT REMAP TABLE REMAP TABLESPACE Im Fehlerfall verbleibt der Dump File auf Platte 21
AGENDA Backup & Recovery 1. Multitenant und Backup 2. Flashback 3. Duplicate 4. Table Recovery from Backup 5. Cross Platform Migration 6. New Security Features 7. TVD-Backup 22
Backup & Recovery Cross-Platform Migration Cross-Platform Migration with Backup Sets Verwendung von Backup Sets für die Plattform übergreifende Migration Migration zum Bsp. Windows x86_64 zu Linux x86_64 Unterstützung unterschiedlicher Endian Formate (Little/Big Endian) Backup Sets von pre-12c Releases können verwendet werden RMAN Features verwendbar Komprimierung Incremental 1 Backup für abschliessende consistent Recovery Erweiterung der View v$transportable_platform Cross-Platform Backup Sets können nicht im Controlfile registriert werden 23
Backup & Recovery Cross-Platform Migration Cross-Platform Migration with Backup Sets PDB Datenbanken werden unterstützt alter database open read only; backup for transport format '/tmp/migration_%d_s%s_p%p' database; restore from platform 'Solaris[tm] OE (64-bit)' foreign database to new from backupset '/tmp/migration_cdb01_s31_p1'; 24
AGENDA Backup & Recovery 1. Multitenant und Backup 2. Flashback 3. Duplicate 4. Table Recovery from Backup 5. Cross Platform Migration 6. New Security Features 7. TVD-Backup 25
Backup & Recovery New Security Features Neue SYSBACKUP Privilege Nur Data-Dictionary Zugriff Password-File Erweiterung orapwd enthält neue Option orapwd file=orapwdbt01 password=manager sysbackup=y format=12 select * from v$pwfile_users; USERNAME SYSDBA SYSOPER SYSASM SYSBACKUP SYSDG SYSKM CON_ID ------------------ ------ ------- ------ --------- ----- ----- ------ SYS TRUE TRUE FALSE FALSE FALSE FALSE 0 SYSBACKUP FALSE FALSE FALSE TRUE FALSE FALSE 0 Unified Auditing für RMAN und Data Pump Befehle erweitert 26
AGENDA Backup & Recovery 1. Multitenant und Backup 2. Flashback 3. Duplicate 4. Table Recovery from Backup 5. Cross Platform Migration 6. New Security Features 7. TVD-Backup 27
Backup & Recovery TVD-Backup Eine Produktübersicht TVD-Backup Enterprise Edition TVD-Backup ist ein Produkt aus unserer Trivadis Toolbox TVD-BasEnv TM TVD-Standby TM TVD-Backup TM Einfache Umsetzung der Backup Strategie Tool für ein gesteuerten Restore und Recovery logging templates rman alerting parameters locking 28
Backup & Recovery TVD-Backup Einige technische Daten Backup-Methode Einige technische Daten OS-Systeme für Unix, Linux, Windows Oracle-Versionen ab 8.1.7 Reporting physische Backup-Methode logische Backup-Methode zusätzliche Backup-Methode RCV-Skripte Summe email, SMS, Pager, RMAN Export (8i 10g) Data Pump (ab 10g) User Managed Backups (Snapshots) zahlreiche Templates DAS ultimative Backup-Produkt für den DBA 29
Backup & Recovery TVD-Backup Funktionsübersicht (1) Recovery Use Cases Complete Lost of Database Lost of one/all control files Lost of redo log group / member Lost of spfile Lost of data file(s) Lost of tablespace(s) Database point in time recovery Clone / duplicate database from backup Clone / duplicate database from active Restore archive log s Recovery von retained backups (TAG) 30
Backup & Recovery TVD-Backup Funktionsübersicht (2)...and other stuff Create new SID Environment Create password file Re-create temp files Handling incarnations Handling backup TAG information (Customer) Batch mode, Logging, RMAN Validate and Preview functionality Rename datafiles, tablespaces, database Restart failed recovery UseCase Handling RAC and ASM 31
Backup & Recovery TVD-Backup Die Architektur Initalize / Validate Analyse recovery situation Load Configuration User Input Define an action plan PreProcess Execute generic pre-process actions spfile Special case spfile Restore SQL Pre/Post restore action Execute restore script s Execute sql scripts Recovery Post Process Pre/Post recovery action Execute recovery script s Finalize recovery and execute generic post process actions 32
Backup & Recovery TVD-Backup Demo: Tablespace Restore und Recovery 33
Backup & Recovery TVD-Backup Demo: Tablespace Restore und Recovery 34
Backup & Recovery TVD-Backup Demo: Tablespace Restore und Recovery 35
Backup & Recovery TVD-Backup Demo: Tablespace Restore und Recovery 36
Backup & Recovery TVD-Backup Demo: Tablespace Restore und Recovery 37
Backup & Recovery TVD-Backup Demo: Tablespace Restore und Recovery 38
Weitere Informationen... 39
Fragen und Antworten... Peter Jensch Principial Consultant Tel.: +49 711 90 36 32 30 peter.jensch@trivadis.com BASEL BERN BRUGG LAUSANNE ZÜRICH DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. HAMBURG MÜNCHEN STUTTGART WIEN