Data Guard trifft Multitenant Sebastian Solbach BU Datenbank, ORACLE Deutschland B.V. Co. KG Month 05, 2016
[email protected] @s2solbach
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |
Agenda 1
Oracle Multitenant Architektur
2
Oracle Data Guard
3
Applikationen Multitenant & Data Guard
4
Multitenant & Data Guard Besonderheiten
5
Zusammenfassung
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted
2
Agenda 1
Oracle Multitenant Architektur
2
Oracle Data Guard
3
Applikationen Multitenant & Data Guard
4
Multitenant & Data Guard Besonderheiten
5
Zusammenfassung
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted
3
Multitenant Architektur Komponenten einer Multitenant Container Database (CDB)
PDBs Root Pluggable Databases (PDBs)
CDB
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Multitenant Architektur • Die Multitenant Architektur unterstützt derzeit bis zu 252 PDBs Database Link
• Eine PDB verhält sich identisch zu einer non-CDB • Ein DB-Client kann nicht erkennen, ob er an einer PDB oder einer nonCDB angemeldet ist.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Multitenant Architekture – Dynamische Anteile • PDBs “teilen sich” SGA und Hintergrundprozesse • Vordergrundprozesse (DB Sessions) “sehen” nur die PDB an der sie angemeldet sind
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Dateien in der CDB Namespaces
• Jede PDB hat einen eigenen Satz Tablespaces, inkl. SYSTEM und SYSAUX • PDBs teilen sich UNDO, REDO und control files, (s)pfile
• Als Default hat die CDB einen einzelnen TEMP Tablespace, PDBs können aber ihren eigenen anlegen
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Unplug / Plug Einfach aus der alten CDB “ausklinken”…
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Unplug / Plug …und in die neue CDB “einklinken”…
• Verschieben zwischen CDBs erfordert lediglich das Verschieben der Metadaten der PDB • Upgrades und Patching werden dadurch einfacher • Eine “ausgeklinkte” PDB beinhaltet Infos zu lineage, opatch, encryption keys etc.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Multitenant für schnelles Ausrollen von DBs Schnelles Cloning von PDBs
PDBs können innerhalb der gleichen CDB geklont werden PDBs können aus “remote CDBs” geklont werden
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
“Manage Many as One” mit Multitenant Eine Standby Datenbank deckt alle Pluggable Databases ab
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda 1
Oracle Multitenant Architektur
2
Oracle Data Guard
3
Applikationen Multitenant & Data Guard
4
Multitenant & Data Guard Besonderheiten
5
Zusammenfassung
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted
12
Oracle Data Guard Standby Datenbank
Sync / Async
Data Guard Broker / Oracle Enterprise Manager Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Data Guard Funktionen der Oracle Database Enterprise Edition (EE)
Data Protection
High Availability
Performance and ROI
Zero or sub-second data loss protection
Automatic database failover
Extreme throughput supports all workloads
Strong isolation using continuous Oracle validation
Automatic client failover
Dual-purpose standby for development and test
Lost-write detection
Standby-first patch apply
Integrated management
Universal support – all data types and applications
Database rolling maintenance
Comprehensive monitoring with Enterprise Manager
Select platform migrations
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Offload Readers with Lag Control and DML Redirect
Oracle Active Data Guard
Sync / Async
Automatic Block Repair Offload Fast Incremental Backups Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Active Data Guard 12c Data Protection
High Availability
Performance and ROI
Zero data loss at any distance
Automatic block repair
Offload read-only
Real-time cascade
Automated rolling database maintenance
Offload incremental backups
Transparent failover for inflight transactions
Offload read mostly
Service management for replicated databases
Offload transport compression Intelligent load balancing for replicated databases
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Agenda 1
Oracle Multitenant Architektur
2
Oracle Data Guard
3
Applikationen Multitenant & Data Guard
4
Multitenant & Data Guard Besonderheiten
5
Zusammenfassung
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted
17
Data Guard & Oracle Restart: Fast Application Notification Applikationen verlieren Zeit
FAN & FCF
•Warten auf TCP/IP Timeouts
Down – Service/Knoten down select CON_ID, DBID, GUID, NAME from v$containers CON_ID ---------1 2 3
DBID ---------1427472112 3723424392 2753064680
GUID -------------------------------169C2AD8F3D44879E05370F4A50AB460 169C2AD8F3D34879E05370F4A50AB460 16A0C7F3EA950D21E05370F4A50A9346
NAME -----------------------CDB$ROOT PDB$SEED SPDB
• Bei OMF oder ASM wird die GUID verwendet: ///DATAFILE/
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
24
PlugIn / Clone & Data Guard • Findet Data Guard die Dateien bei PlugIn Operation nicht auf Standby Seite bricht Data Guard den automatischen Recovery Process ab
• Recovery kann nur weiterlaufen, wenn Datendateien im gleichen Zustand zur Verfügung gestellt werden Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
25
Data Guard & Multitenant Datenbanken 12.1.0.2
• Neues Keywort beim Create PDB: STANDBY = NONE / ALL – NONE: PDB wird auf der Standby nicht ins Recovery mit einbezogen – ALL (Default): PDB wird auf alles Standby recovered
• Disable / Enable Recovery einzelner PDBs: SQL> alter pluggable database enable/disable recovery;
• MOS Note 1916648.1: Making Use of the STANDBYS=NONE Feature with Oracle Multitenant Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Erzeugen einer neuen PDB (1) From Seed
• Funktioniert in allen Data Guard Umgebungen problemlos SQL> CREATE PLUGGABLE DATABASE pdb2 ADMIN USER pdb2admin IDENTIFIED BY password;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
27
Erzeugen einer neuen PDB (2) Duplizieren einer PDB in der gleichen CDB
• Funktioniert nur bei Active Data Guard Umgebungen problemlos SQL> CREATE PLUGGABLE DATABASE pdb2 FROM PDB1;
• Bei Standard DG Umgebungen: DB Anlegen mit Standby = NONE und Datenfile „from Service“ wiederherstellen.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
28
Schnelle Standby Synchronization Einfacher Standby Sync-Up Mechanismus Initiate Incremental Restore Request
Incremental Backup + Apply Primary Database
Standby Database
• RECOVER DATABASE FROM SERVICE – Ausführen des Befehls von der Standby (TARGET) mit der Primär als AUXILIARY – Generiert automatisch ein inkrementelles Backup ab dem aktuellen Zeitpunkt der Standby (as of the current SCN) – Inkremetelles Backup wird auf der Standby angewendet – Oracle Database B&R User's Guide “Restoring and Recovering Files Over the Network”: http://docs.oracle.com/cd/E16655_01/backup.121/e17630/rcmadvre.htm#BRADV680 Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Erzeugen einer neuen PDB (3) Plugin einer PDB
• Funktioniert wenn Datendateien auf beiden Seiten vorhanden, da keine neue GUID erzeugt wird SQL> create pluggable database My_PDB using '/u01/app/oracle/oradata/…/hcm.xml'
• Möchte man die Daten später kopieren, so kann auch einfach mit „Standby = NONE“ gearbeitet werden. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
30
Erzeugen einer neuen PDB (4) PDB Erzeugung von Remote PDB
• Da eine neue GUID beim Remote Clone erzeugt wird, ist das vorherige Kopieren der DB Dateien nicht möglich SQL> create pluggable database spdbclone from spdb@ssdb
• PDB Erzeugen mit „Standby = None“. Daten müssen nachträglich kopiert werden. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
31
Vorgehen bei STANDBY=NONE (1) • Automatisches Löschen von Archivelogs ausschalten RMAN> configure archivelog deletion policy to none;
• Recovern der Tablespaces „from service“ RMAN> connect target sys@stbycdb RMAN> run { set newename for pluggable database spdb1 to new; restore pluggable database spdb1 from service spdb; switch datafile all; }
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
32
Vorgehen bei STANDBY=NONE (2) • Automatisches Recovery der PDB aktivieren DGMGRL> edit database stbycdb set state='apply-off'; SQL> shutdown immediate; SQL> startup mount;
• Recovery der PDB aktivieren SQL> alter session set container = spdb1; SQL> alter pluggable database enable recovery; DGMGRL> edit database stbycdb set state='apply-on';
• Archivelog Deletion Policy wieder einschalten ! Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
33
Agenda 1
Oracle Multitenant Architektur
2
Oracle Data Guard
3
Applikationen Multitenant & Data Guard
4
Multitenant & Data Guard Besonderheiten
5
Zusammenfassung
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted
34
Data Guard trifft Multitenant • Oracle GI (Restart oder Cluster) verwenden (FAN) • Verwendung eigener Services • Verwendung von Data Guard Broker
• Data Guard funktioniert auf CDB Ebene • Feature: STANDBY=NONE für PlugIn & Clone
• Recovery fein granular einstellbar
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
35
Links • Community Tipp: Data Guard & Multitenant • MOS Note 2049127.1 Data Guard Impact on Oracle Multitenant Environments
• MOS Note 1916648.1: Making Use Deferred PDB Recovery and the STANDBYS=NONE Feature with Oracle Multitenant
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Confidential – Oracle Internal/Restricted/Highly Restricted
36
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle Confidential – Internal/Restricted/Highly Restricted
37