data guard observer das unbekannte wesen

Click here to load reader

Post on 21-Jan-2018

396 views

Embed Size (px)

TRANSCRIPT

  1. 1. Data Guard Observer das unbekannte Wesen Autor: Ernst Leber 19.11.2015 DOAG Nrnberg
  2. 2. Facts & Figures Technologie-orientiert Branchen-unabhngig Hauptsitz Ratingen 240 Beschftigte Grndung 1994 Niederlassung Frankfurt am Main Ausbildungs- betrieb Inhabergefhrt Zertifizierter Partner von Oracle, Microsoft und SAP 24 Mio. Euro Umsatz 2
  3. 3. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Agenda 3 Data Guard bersicht Konfiguration Observer Konfiguration User Defined Conditions V$Views Live Demo Links Mit diesem Text werden Terminal Outputs dargestellt
  4. 4. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Data Guard Konfiguration 4 ORLCA Database 11.2.0.4 ORCLB Database 11.2.0.4 DGMGRL> show configuration; Configuration - orcl Protection Mode: MaxAvailability Databases: orcla - Primary database orclb - Physical standby database Fast-Start Failover: DISABLED Configuration Status: SUCCESS
  5. 5. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Data Guard Configuration 5 DGMGRL> show database verbose oracle Database - orclb Role: PHYSICAL STANDBY Intended State: APPLY-ON Transport Lag: 0 seconds (computed 0 seconds ago) Apply Lag: 0 seconds (computed 0 seconds ago) Apply Rate: 0 Byte/s Real Time Query: OFF Instance(s): orcl Database Status: SUCCESS
  6. 6. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Data Guard Configuration 6 Properties: DGConnectIdentifier = 'stby' ObserverConnectIdentifier = '' LogXptMode = 'SYNC' DelayMins = '0' Binding = 'optional' MaxFailure = '0' MaxConnections = '1' ReopenSecs = '300' NetTimeout = '30' RedoCompression = 'DISABLE' LogShipping = 'ON' PreferredApplyInstance = '' ApplyInstanceTimeout = '0' ApplyParallel = 'AUTO' StandbyFileManagement = 'AUTO' ArchiveLagTarget = '1800' LogArchiveMaxProcesses = '4' LogArchiveMinSucceedDest = '1' DbFileNameConvert = '' LogFileNameConvert = '' FastStartFailoverTarget = 'orcla'
  7. 7. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Data Guard Configuration 7 InconsistentProperties = '(monitor)' InconsistentLogXptProps = '(monitor)' SendQEntries = '(monitor)' LogXptStatus = '(monitor)' RecvQEntries = '(monitor)' ApplyLagThreshold = '0' TransportLagThreshold = '0' TransportDisconnectedThreshold = '30' SidName = 'orcl' StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oel6-prim)(PORT=1521)) (CONNECT_DATA=(SERVICE_NAME=ORCLA)(INSTANCE_NAME=orcl) (SERVER=DEDICATED)))' StandbyArchiveLocation = 'USE_DB_RECOVERY_FILE_DEST' AlternateLocation = '' LogArchiveTrace = '0' LogArchiveFormat = '%t_%s_%r.dbf' TopWaitEvents = '(monitor)'
  8. 8. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Data Guard 8 LSP: Logical Standby Process SQL Apply for logical DataguardMRP: Managed Recover Process DataGuardRFS: Remote Fileserver Kriegt REDO Daten und schreibt die in die Standby
  9. 9. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Data Guard at Work 9 select process,pid,status,client_process, thread#,sequence#,block# from v$managed_standby;
  10. 10. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer Konfiguration 10 ORCLA Database 11.2.0.4 ORCLB Database 11.2.0.4 Observer 12.1.0.2 tnsnames.ora
  11. 11. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer 11 Eigener Server DB Version >= Datenbankversion Laufender Data Guard Broker Switch Over / Failover Standby und Observer keine Verbindung zu Primary User defined Condition erfllt Shutdown abort der Primary Kein automatischer Switch Back Automatisches Reinstate Nicht nach User Defined Conditions Empfehlung: sys Username und Password im Wallet
  12. 12. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen tnsnames.ora 12
  13. 13. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer Konfiguration Data Guard 13 DGMGRL > connect sys@prim DGMGRL > edit database orcla set property 'LogXptMode'='SYNC'; DGMGRL > edit database orclb set property 'LogXptMode'='SYNC'; DGMGRL > edit database orcla set property 'FastStartFailoverTarget'='stby'; DGMGRL > edit database orclb set property 'FastStartFailoverTarget'='prim'; DGMGRL > edit database orcla set property 'StandbyFileManagement'='AUTO'; DGMGRL > edit database orclb set property 'StandbyFileManagement'='AUTO';
  14. 14. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Datenbank Konfiguration Data Guard 14 Primary: SQL > alter database flashback on; SQL > alter system set undo_retention=3600 scope=spfile; Standby: DGMGRL > edit database orclb set state='APPLY-OFF'; SQL > alter database flashback on; SQL > alter system set undo_retention=3600 scope=spfile; DGMGRL > edit database orclb set state='APPLY-ON';
  15. 15. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer Mode aktivieren 15 DGMGRL > ENABLE FAST_START FAILOVER; DGMGRL> show configuration; Configuration - orcl Protection Mode: MaxAvailability Databases: orcla - Primary database Warning: ORA-16819: fast-start failover observer not started orclb - (*) Physical standby database Warning: ORA-16819: fast-start failover observer not started Fast-Start Failover: ENABLED Configuration Status: WARNING DGMGRL>
  16. 16. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer auf dem eigenen Server Starten 16 DGMGRL> connect sys@prim Password: Connected as SYSDBA. DGMGRL> start observer Observer started das war's!! Obser ver
  17. 17. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer Status I 17 DGMGRL> show configuration verbose; Configuration - orcl Protection Mode: MaxAvailability Databases: orcla - Primary database orclb - (*) Physical standby database (*) Fast-Start Failover target orcla
  18. 18. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer Status II 18 Properties: FastStartFailoverThreshold = '30' OperationTimeout = '30' FastStartFailoverLagLimit = '30' CommunicationTimeout = '180' ObserverReconnect = '0' FastStartFailoverAutoReinstate = 'TRUE' FastStartFailoverPmyShutdown = 'TRUE' BystandersFollowRoleChange = 'ALL' ObserverOverride = 'FALSE' ExternalDestination1 = '' ExternalDestination2 = '' PrimaryLostWriteAction = 'CONTINUE' Mehr Details dazu: http://docs.oracle.com/cd/E11882_01/server.112/e40771/dbpropref.htm#DGBKR3637 orcla
  19. 19. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Observer Status III 19 Fast-Start Failover: ENABLED Threshold: 30 seconds Target: orclb Observer: ele-oel7 Lag Limit: 30 seconds (not in use) Shutdown Primary: TRUE Auto-reinstate: TRUE Observer Reconnect: (none) Observer Override: FALSE Configuration Status: SUCCESS DGMGRL> orcla
  20. 20. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen User defined Conditions 20 DGMGRL> ENABLE FAST_START FAILOVER CONDITION ; DGMGRL> DISABLE FAST_START FAILOVER CONDITION ; DGMGRL> ENABLE FAST_START FAILOVER CONDITION 27102; DGMGRL> DISABLE FAST_START FAILOVER CONDITION "Datafile Offline"; Condition Default Datafile Offline enabled Corrupted Controlfile enabled Corrupted Dictionary enabled Inaccessible Logfile disabled Stuck Archiver disabled Error Code disabled orcla
  21. 21. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen User defined Conditions anzeigen 21 DGMGRL> show fast_start failover; Fast-Start Failover: ENABLED Threshold: 30 seconds Target: orclb Observer: ele-oel7 Lag Limit: 30 seconds (not in use) Shutdown Primary: TRUE Auto-reinstate: TRUE Observer Reconnect: (none) Observer Override: FALSE Configurable Failover Conditions Health Conditions: Corrupted Controlfile YES Corrupted Dictionary YES Inaccessible Logfile NO Stuck Archiver NO Datafile Offline YES Oracle Error Conditions: ORA-01422: exact fetch returns more than requested number of rows orcla
  22. 22. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen Data Guard Set Delay 22 DGMGRL> edit database orclb set property DelayMins=15; Im Logfile der Standby DB: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT USING CURRENT LOGFILE ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL MRP0: Background Media Recovery cancelled with status 16037 MRP0: Background Media Recovery process shutdown (orcl) Managed Standby Recovery Canceled (orcl) Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT Attempt to start background Managed Standby Recovery process (orcl) Mon Aug 31 12:48:22 2015 MRP0 started with pid=30, OS id=5937 MRP0: Background Managed Standby Recovery process started (orcl) All non-current ORLs have been archived. Media Recovery Waiting for thread 1 sequence 24 (in transit) Completed: ALTER DATABASE RECOVER MANAGED STANDBY DATABASE THROUGH ALL SWITCHOVER DISCONNECT orcla
  23. 23. | Data Guard Observer das unbekannte Wesen Data Guard Observer das unbekannte Wesen DOKU: Protection Mode 23 Maximum Availability This protection mode provides the highest level of data protection that is possible without compromising the availability of a primary database. REDO is written sync. Maximum Performance This protection mode provides the highest level of data protection that is possible without affecting the performanc

View more