Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
G...
About Ludovico Caldara
Get the Most out of Oracle Data Guard!2 9/29/2017
■ 18 Years DBA (Not Only Oracle)
▪ I do it everyw...
Our company.
Adaptive Features or: How I learned to Stop Worrying3 29/09/2017
Trivadis is a market leader in IT consulting...
COPENHAGEN
MUNICH
LAUSANNE
BERN
ZURICH
BRUGG
GENEVA
HAMBURG
DÜSSELDORF
FRANKFURT
STUTTGART
FREIBURG
BASEL
VIENNA
With over...
3 Membership Tiers
• Oracle ACE Director
• Oracle ACE
• Oracle ACE Associate
bit.ly/OracleACEProgram
500+ Technical
Expert...
Get the Most out of Oracle Data Guard!6 9/29/2017
Oracle
Data Guard?
Why is Oracle Data Guard still relevant?
Get the Most out of Oracle Data Guard!7 9/29/2017
The best high availability solu...
Hey, it’s 12c Release 2!
Get the Most out of Oracle Data Guard!8 9/29/2017
Multiple Observers for Fast-Start Failover conf...
Hey, it’s 12c Release 2!
Get the Most out of Oracle Data Guard!9 9/29/2017
Multiple Observers for Fast-Start Failover conf...
What about Active Data Guard new features?
Get the Most out of Oracle Data Guard!10 9/29/2017
What about Active Data Guard new features?
Get the Most out of Oracle Data Guard!11 9/29/2017
Get the Most out of Oracle Data Guard!12 9/29/2017
Technology Enablers
The «MAIN» features included in Data Guard
Get the Most out of Oracle Data Guard!13 9/29/2017
Client Failover (TAF)
Redo A...
The «MAIN» features included in Data Guard
Get the Most out of Oracle Data Guard!14 9/29/2017
Client Failover (TAF)
Redo A...
Our three main topics for this presentation
Get the Most out of Oracle Data Guard!15 9/29/2017
Client Failover (TAF)
Snaps...
Our three main topics for this presentation
Get the Most out of Oracle Data Guard!16 9/29/2017
Client Failover (TAF)
Snaps...
Our three main topics for this presentation
Get the Most out of Oracle Data Guard!17 9/29/2017
Client Failover (TAF)
Snaps...
Our three topics focuses for this presentation
Get the Most out of Oracle Data Guard!18 9/29/2017
Client Failover (TAF)
Sn...
Get the Most out of Oracle Data Guard!19 9/29/2017
Client Failover
Client Failover is a critical topic!
Get the Most out of Oracle Data Guard!20 9/29/2017
https://www.slideshare.net/ludovic...
Database Services
Get the Most out of Oracle Data Guard!
Database services can be created with:
– srvctl (Grid Infrastruct...
Role-Based Services
Get the Most out of Oracle Data Guard!
Example role-based services with Grid Infrastructure.
Services ...
Transparent Application Failover – Server Side Example
Get the Most out of Oracle Data Guard!
Example server side TAF BASI...
Transparent Application Failover – Client Side Example
Get the Most out of Oracle Data Guard!
Example client side TAF BASI...
Transparent Application Failover – Client Side Example
Get the Most out of Oracle Data Guard!
Example client side TAF BASI...
Use Case: Classic Data Guard Failover / Switchover
Get the Most out of Oracle Data Guard!26 9/29/2017
sour_ludo sour_vico
...
Use Case: Classic Data Guard Failover / Switchover
Get the Most out of Oracle Data Guard!27 9/29/2017
sour_ludo sour_vico
...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!28 9/29/2017
sour
CLIENTS
(ADDRESS=(H...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!29 9/29/2017
sour
CLIENTS
(ADDRESS=(H...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!30 9/29/2017
sour
CLIENTS
(ADDRESS=(H...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!31 9/29/2017
sour
CLIENTS
(ADDRESS=(H...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!32 9/29/2017
sour
CLIENTS
(ADDRESS=(H...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!33 9/29/2017
sour
CLIENTS
(ADDRESS=(H...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!34 9/29/2017
CLIENTS
(ADDRESS=(HOST=v...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!35 9/29/2017
Problems
– Requires appl...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!36 9/29/2017
Problems
– Requires appl...
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!37 9/29/2017
Problems
– Requires appl...
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!38 9/29/2017
sour_ludo
CLIENTS
(ADDRESS=(HO...
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!39 9/29/2017
sour_ludo
CLIENTS
(ADDRESS=(HO...
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!40 9/29/2017
sour_ludo
CLIENTS
(ADDRESS=(HO...
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!41 9/29/2017
sour_ludo
CLIENTS
(ADDRESS=(HO...
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!42 9/29/2017
sour_ludo
CLIENTS
(ADDRESS=(HO...
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!43 9/29/2017
CLIENTS
(ADDRESS=(HOST=sour-s1...
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!44 9/29/2017
CLIENTS
(ADDRESS=(HOST=sour-s1...
Get the Most out of Oracle Data Guard!45 9/29/2017
Demo?
Get the Most out of Oracle Data Guard!46 9/29/2017
Snapshot Standby
Physical Standby (simplified)
Get the Most out of Oracle Data Guard!47 9/29/2017
stout_ludo stout_vicoLGWR RFS MRP0
ol stb...
Snapshot Standby (simplified)
Get the Most out of Oracle Data Guard!48 9/29/2017
stout_ludo stout_vicoLGWR RFS
ol stbl
arc...
Snapshot Standby
Get the Most out of Oracle Data Guard!49 9/29/2017
Requirements
– Correct Data Guard configuration with a...
Conversion
Get the Most out of Oracle Data Guard!50 9/29/2017
Stop Redo Apply
Create Guaranteed Restore Point
Flush Standb...
Two sources for Archive Logs?
Get the Most out of Oracle Data Guard!51 9/29/2017
SQL> select THREAD#, SEQUENCE#, RESETLOGS...
Use Case: SNAP STANDBY ONLY
Get the Most out of Oracle Data Guard!52 9/29/2017
stout_ludo stout_vico
stout_RW stout_SNAP
C...
Use Case: SNAP STANDBY ONLY
Get the Most out of Oracle Data Guard!53 9/29/2017
stout_ludo stout_vico
stout_RW stout_SNAP
C...
Use Case: SNAP STANDBY ONLY
Get the Most out of Oracle Data Guard!54 9/29/2017
srvctl add service -db stout_vico -service ...
Use Case: SNAP STANDBY or PRIMARY
Get the Most out of Oracle Data Guard!55 9/29/2017
stout_ludo stout_vico
stout_RW stout_...
Use Case: SNAP STANDBY or PRIMARY
Get the Most out of Oracle Data Guard!56 9/29/2017
stout_ludo stout_vico
stout_RW stout_...
Use Case: SNAP STANDBY or PRIMARY
Get the Most out of Oracle Data Guard!57 9/29/2017
srvctl add service -db stout_vico -se...
Get the Most out of Oracle Data Guard!58 9/29/2017
Demo?
Use Case: Double SNAP STANDBY
Get the Most out of Oracle Data Guard!59 9/29/2017
stout_ludo
stout_vico
stout_RW
stout_SNAP...
Use Case: Double SNAP STANDBY
Get the Most out of Oracle Data Guard!60 9/29/2017
stout_ludo
stout_vico
stout_RW
stout_SNAP...
Use Case: Double SNAP STANDBY
Get the Most out of Oracle Data Guard!61 9/29/2017
stout_ludo
stout_vico
stout_RW
CLIENTS
sr...
Two Standby Databases Use Case
Get the Most out of Oracle Data Guard!62 9/29/2017
srvctl add service -db stout_vico -servi...
Get the Most out of Oracle Data Guard!
Standby
Consistency
on
recovery cancel
9/29/201763
stout_vico
Redo Apply (roll-forward)
Get the Most out of Oracle Data Guard!64 9/29/2017
BUFFER CACHE
datafilesfuzzy
datafi...
Block status
Get the Most out of Oracle Data Guard!65 9/29/2017
SQL> select status, dirty, count(*) from v$bh
2> group by ...
Block status
Get the Most out of Oracle Data Guard!66 9/29/2017
SQL> select status, dirty, count(*) from v$bh
2> group by ...
Consistent datafiles == consistent database
Get the Most out of Oracle Data Guard!67 9/29/2017
No additional media recover...
Cloning solution based on Standby Database
Get the Most out of Oracle Data Guard!68 9/29/2017
ludo01
GRID INFRASTRUCTURE 1...
Cloning Steps
Get the Most out of Oracle Data Guard!69 9/29/2017
Snapshot creation
– edit database stout_vico set state=‘A...
Cloning Steps
Get the Most out of Oracle Data Guard!70 9/29/2017
Cloning the database from the snapshot
– Abort previous i...
Get the Most out of Oracle Data Guard!71 9/29/2017
Demo?
Get the Most out of Oracle Data Guard!72 9/29/2017
Let me do one more example
Database reorganization live
Get the Most out of Oracle Data Guard!73 9/29/2017
Setup physical standby
Convert to logical ...
Get the Most out of Oracle Data Guard!
Conclusions
9/29/201774
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
Q...
Prochain SlideShare
Chargement dans…5
×

Get the most out of Oracle Data Guard - OOW version

5 916 vues

Publié le

If you use Oracle Data Guard feature just for data protection, you are using less than half of its potential. You already pay for it, so why not getting the most out of it? In this session I will show how you can use Oracle Data Guard capabilities for common tasks such as database cloning, database migration and reporting, with the help of other features included in Oracle Database Enterprise Edition

Publié dans : Technologie
  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Get the most out of Oracle Data Guard - OOW version

  1. 1. BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH Get the Most out of Oracle Data Guard! Oracle Open World 2017 #OOW17 Ludovico Caldara Oracle ACE Director Senior Consultant
  2. 2. About Ludovico Caldara Get the Most out of Oracle Data Guard!2 9/29/2017 ■ 18 Years DBA (Not Only Oracle) ▪ I do it everywhere (even Windows) ■ RAC ATTACK Ninja & co-writer ■ President, SOUG & ITOUG Board ■ OCP (11g, 12c, MySQL) & OCE ■ Italian living in Switzerland ■ http://www.ludovicocaldara.net ■ @ludodba ludodba ■ ludovicocaldara
  3. 3. Our company. Adaptive Features or: How I learned to Stop Worrying3 29/09/2017 Trivadis is a market leader in IT consulting, system integration, solution engineering and the provision of IT services focusing on and technologies in Switzerland, Germany, Austria and Denmark. We offer our services in the following strategic business fields: Trivadis Services takes over the interactive operation of your IT systems. O P E R A T I O N
  4. 4. COPENHAGEN MUNICH LAUSANNE BERN ZURICH BRUGG GENEVA HAMBURG DÜSSELDORF FRANKFURT STUTTGART FREIBURG BASEL VIENNA With over 600 specialists and IT experts in your region. Adaptive Features or: How I learned to Stop Worrying4 29/09/2017 14 Trivadis branches and more than 600 employees 200 Service Level Agreements Over 4,000 training participants Research and development budget: CHF 5.0 / EUR 4 million Financially self-supporting and sustainably profitable Experience from more than 1,900 projects per year at over 800 customers
  5. 5. 3 Membership Tiers • Oracle ACE Director • Oracle ACE • Oracle ACE Associate bit.ly/OracleACEProgram 500+ Technical Experts Helping Peers Globally Connect: Nominate yourself or someone you know: acenomination.oracle.com @oracleace Facebook.com/oracleaces oracle-ace_ww@oracle.com
  6. 6. Get the Most out of Oracle Data Guard!6 9/29/2017 Oracle Data Guard?
  7. 7. Why is Oracle Data Guard still relevant? Get the Most out of Oracle Data Guard!7 9/29/2017 The best high availability solution in the Oracle ecosystem – Synchronous (or not) – One-to-one copy (or one-to-many) – No single points of failure – Failover is (almost) transparent to the applications (if well configured) Rock solid! Included in Oracle Database Enterprise Edition
  8. 8. Hey, it’s 12c Release 2! Get the Most out of Oracle Data Guard!8 9/29/2017 Multiple Observers for Fast-Start Failover configurations Observer in Background mode (needs wallet) Recover of Nologging Operations (recover database nonlogged block;) Multiple fast_start failover targets Automated passwordfile copy Enhanced Broker and dgmgrl FastSync redo transport
  9. 9. Hey, it’s 12c Release 2! Get the Most out of Oracle Data Guard!9 9/29/2017 Multiple Observers for Fast-Start Failover configurations Observer in Background mode (needs wallet) Recover of Nologging Operations (recover database nonlogged block;) Multiple fast_start failover targets Automated passwordfile copy Enhanced Broker and dgmgrl FastSync redo transport That was 12cR1!
  10. 10. What about Active Data Guard new features? Get the Most out of Oracle Data Guard!10 9/29/2017
  11. 11. What about Active Data Guard new features? Get the Most out of Oracle Data Guard!11 9/29/2017
  12. 12. Get the Most out of Oracle Data Guard!12 9/29/2017 Technology Enablers
  13. 13. The «MAIN» features included in Data Guard Get the Most out of Oracle Data Guard!13 9/29/2017 Client Failover (TAF) Redo Apply SQL Apply Snapshot Standby Rolling Upgrades (possible, but without RDBMS_ROLLING) Transaction Guard (necessary for Application Continuity but not licensed as option)
  14. 14. The «MAIN» features included in Data Guard Get the Most out of Oracle Data Guard!14 9/29/2017 Client Failover (TAF) Redo Apply SQL Apply Snapshot Standby Rolling Upgrades (possible, but without RDBMS_ROLLING) Transaction Guard (necessary for Application Continuity but not licensed as option)
  15. 15. Our three main topics for this presentation Get the Most out of Oracle Data Guard!15 9/29/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel
  16. 16. Our three main topics for this presentation Get the Most out of Oracle Data Guard!16 9/29/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel Database Migration
  17. 17. Our three main topics for this presentation Get the Most out of Oracle Data Guard!17 9/29/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel Reporting
  18. 18. Our three topics focuses for this presentation Get the Most out of Oracle Data Guard!18 9/29/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel Database Cloning
  19. 19. Get the Most out of Oracle Data Guard!19 9/29/2017 Client Failover
  20. 20. Client Failover is a critical topic! Get the Most out of Oracle Data Guard!20 9/29/2017 https://www.slideshare.net/ludovicocaldara/oracle-client-failover-under-the-hood – OS Connect Timeouts/ARP Cache – OS Re-Connect Timeouts – Virtual IP Addresses – TCP Keepalive – Database Services – DB Connect Timeouts – DB Re-Connect Timeouts – Transparent Application Failover – Fast Application Notification / Fast Connection Failover – Application Continuity
  21. 21. Database Services Get the Most out of Oracle Data Guard! Database services can be created with: – srvctl (Grid Infrastructure), gdsctl (Global Data Services). – dbms_service.create_service() PL/SQL procedure (TRIGGER AFTER STARTUP!) Different high availability and workload management attributes can be defined Service srvctl add service -db <db_unique_name> -service <service> -preferred "<preferred_list>" -available "<available_list>" -serverpool <pool_name> -cardinality [UNIFORM | SINGLETON] -tafpolicy [NONE | BASIC | PRECONNECT] -role [PRIMARY, PHYSICAL_STANDBY, LOGICAL_STANDBY, SNAPSHOT_STANDBY] -clbgoal [SHORT | LONG] -rlbgoal [SERVICE_TIME | THROUGHPUT | NONE] ... Not available with Oracle Restart 9/29/201721
  22. 22. Role-Based Services Get the Most out of Oracle Data Guard! Example role-based services with Grid Infrastructure. Services are started, only if database and service role match. srvctl add service -db sour_poug –service sour_rw.trivadis.com -role PRIMARY srvctl add service -db sour_poug -service sour_ro.trivadis.com -role PHYSICAL_STANDBY srvctl add service -db sour_poug -service sour_snap.trivadis.com -role SNAPSHOT_STANDBY SvcAgent::start 680 query_db_role SvcAgent::start 710 not starting service sour_rw Role mismatch - Service role:PRIMARY, current DB role:PHYSICAL_STANDBY 9/29/201722
  23. 23. Transparent Application Failover – Server Side Example Get the Most out of Oracle Data Guard! Example server side TAF BASIC method configuration. srvctl add service -db sour_SITE1 -service sour_RW -tafpolicy BASIC -failovertype SELECT -failoverdelay 1 -failoverretry 180 9/29/201723 BEGIN DBMS_SERVICE.CREATE_SERVICE ( service_name => 'sour.TRIVADIS.COM', network_name => 'sour.TRIVADIS.COM', failover_method => 'BASIC', failover_type => 'SELECT', failover_retries => 180, failover_delay => 3); END; /
  24. 24. Transparent Application Failover – Client Side Example Get the Most out of Oracle Data Guard! Example client side TAF BASIC method configuration. 189/29/201724 sour.trivadis.com = (DESCRIPTION = (FAILOVER=ON) (LOAD_BALANCE=OFF) (CONNECT_TIMEOUT=5)(RETRY_COUNT=3)(RETRY_DELAY=1)(TRANSPORT_CONNECT_TIMEOUT=3) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=ludo01.trivadis.com)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=vico01.trivadis.com)(PORT=1521))) (CONNECT_DATA = (SERVICE_NAME = sour.trivadis.com) (FAILOVER_MODE = (TYPE = SESSION) (METHOD = BASIC) (RETRIES = 180) (DELAY = 1) ) ) )
  25. 25. Transparent Application Failover – Client Side Example Get the Most out of Oracle Data Guard! Example client side TAF BASIC method configuration. 189/29/201725 sour.trivadis.com = (DESCRIPTION = (FAILOVER=ON) (LOAD_BALANCE=OFF) (CONNECT_TIMEOUT=5)(RETRY_COUNT=3)(RETRY_DELAY=1)(TRANSPORT_CONNECT_TIMEOUT=3) (ADDRESS_LIST= (ADDRESS=(PROTOCOL=TCP)(HOST=ludo01.trivadis.com)(PORT=1521)) (ADDRESS=(PROTOCOL=TCP)(HOST=vico01.trivadis.com)(PORT=1521))) (CONNECT_DATA = (SERVICE_NAME = sour.trivadis.com) (FAILOVER_MODE = (TYPE = SESSION) (METHOD = BASIC) (RETRIES = 180) (DELAY = 1) ) ) ) ! TAF is for OCI Drivers only Thin Driver: do not use TAF
  26. 26. Use Case: Classic Data Guard Failover / Switchover Get the Most out of Oracle Data Guard!26 9/29/2017 sour_ludo sour_vico sour_RW CLIENTS srvctl add service -db sour_vico -service sour_RW -role PRIMARY (ADDRESS=(HOST=ludo01)(PORT=1521)) (ADDRESS=(HOST=vico01)(PORT=1521)) MRP0
  27. 27. Use Case: Classic Data Guard Failover / Switchover Get the Most out of Oracle Data Guard!27 9/29/2017 sour_ludo sour_vico sour_RW CLIENTS srvctl add service -db sour_vico -service sour_RW -role PRIMARY (ADDRESS=(HOST=ludo01)(PORT=1521)) (ADDRESS=(HOST=vico01)(PORT=1521)) MRP0
  28. 28. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!28 9/29/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521))
  29. 29. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!29 9/29/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521)) sour_newMRP0 – Set up Standby instance
  30. 30. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!30 9/29/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521)) sour_newMRP0 – Set up Standby instance – Stop application
  31. 31. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!31 9/29/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521)) sour_new MRP0 – Set up Standby instance – Stop application – Switchover
  32. 32. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!32 9/29/2017 sour CLIENTS (ADDRESS=(HOST=ludo01vico01)(PORT=1521)) sour_new MRP0 – Change TNS definition– Set up Standby instance – Stop application – Switchover
  33. 33. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!33 9/29/2017 sour CLIENTS (ADDRESS=(HOST=ludo01vico01)(PORT=1521)) sour_new MRP0 – Change TNS definition – Start application – Set up Standby instance – Stop application – Switchover
  34. 34. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!34 9/29/2017 CLIENTS (ADDRESS=(HOST=vico01)(PORT=1521)) sour_new – Set up Standby instance – Stop application – Switchover – Change TNS definition – Start application – Cleanup
  35. 35. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!35 9/29/2017 Problems – Requires application downtime (even if short) – Messy DB_UNIQUE_NAME naming convention
  36. 36. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!36 9/29/2017 Problems – Requires application downtime (even if short) – Messy DB_UNIQUE_NAME naming convention ?Better solutions?
  37. 37. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!37 9/29/2017 Problems – Requires application downtime (even if short) – Messy DB_UNIQUE_NAME naming convention (ADDRESS=(HOST=ludo01)(PORT=1521)) (ADDRESS=(HOST=ludo01)(PORT=1521)) ?Better solutions? Hint: this is valid
  38. 38. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!38 9/29/2017 sour_ludo CLIENTS (ADDRESS=(HOST=sour-s1)(PORT=1521)) (ADDRESS=(HOST=sour-s2)(PORT=1521)) sour_RW sour-s1 IN CNAME ludo01 sour-s2 IN CNAME ludo01
  39. 39. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!39 9/29/2017 sour_ludo CLIENTS (ADDRESS=(HOST=sour-s1)(PORT=1521)) (ADDRESS=(HOST=sour-s2)(PORT=1521)) sour_RW sour-s1 IN CNAME ludo01 sour-s2 IN CNAME ludo01 sour_vicoMRP0
  40. 40. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!40 9/29/2017 sour_ludo CLIENTS (ADDRESS=(HOST=sour-s1)(PORT=1521)) (ADDRESS=(HOST=sour-s2)(PORT=1521)) sour_RW sour-s1 IN CNAME ludo01 sour-s2 IN CNAME vico01 sour_vicoMRP0
  41. 41. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!41 9/29/2017 sour_ludo CLIENTS (ADDRESS=(HOST=sour-s1)(PORT=1521)) (ADDRESS=(HOST=sour-s2)(PORT=1521)) sour_RW sour-s1 IN CNAME ludo01 sour-s2 IN CNAME vico01 sour_vicoMRP0 TAF!
  42. 42. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!42 9/29/2017 sour_ludo CLIENTS (ADDRESS=(HOST=sour-s1)(PORT=1521)) (ADDRESS=(HOST=sour-s2)(PORT=1521)) sour_RW sour-s1 IN CNAME vico01 sour-s2 IN CNAME vico01 sour_vicoMRP0 TAF!
  43. 43. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!43 9/29/2017 CLIENTS (ADDRESS=(HOST=sour-s1)(PORT=1521)) (ADDRESS=(HOST=sour-s2)(PORT=1521)) sour_RW sour-s1 IN CNAME vico01 sour-s2 IN CNAME vico01 sour_vico TAF!
  44. 44. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!44 9/29/2017 CLIENTS (ADDRESS=(HOST=sour-s1)(PORT=1521)) (ADDRESS=(HOST=sour-s2)(PORT=1521)) sour_RW sour-s1 IN CNAME vico01 sour-s2 IN CNAME vico01 sour_vico TAF!
  45. 45. Get the Most out of Oracle Data Guard!45 9/29/2017 Demo?
  46. 46. Get the Most out of Oracle Data Guard!46 9/29/2017 Snapshot Standby
  47. 47. Physical Standby (simplified) Get the Most out of Oracle Data Guard!47 9/29/2017 stout_ludo stout_vicoLGWR RFS MRP0 ol stbl arcarc
  48. 48. Snapshot Standby (simplified) Get the Most out of Oracle Data Guard!48 9/29/2017 stout_ludo stout_vicoLGWR RFS ol stbl arcarc LGWR ol arc
  49. 49. Snapshot Standby Get the Most out of Oracle Data Guard!49 9/29/2017 Requirements – Correct Data Guard configuration with a physical standby – Physical standby has Fast Recovery Area Configured – FORCE LOGGING is not mandatory but simplifies everything Conversion to Snapshot Standby without broker – ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; – ALTER DATABASE CONVERT TO SNAPSHOT STANDBY; – ALTER DATABASE OPEN READ WRITE; Conversion to Snapshot standby with broker – CONVERT DATABASE <name> TO SNAPSHOT STANDBY;
  50. 50. Conversion Get the Most out of Oracle Data Guard!50 9/29/2017 Stop Redo Apply Create Guaranteed Restore Point Flush Standby Logs Clear Online Logfiles Convert to Primary Open resetlogs Start RFS process to get redo stream from the primary
  51. 51. Two sources for Archive Logs? Get the Most out of Oracle Data Guard!51 9/29/2017 SQL> select THREAD#, SEQUENCE#, RESETLOGS_ID, FIRST_CHANGE#, NEXT_CHANGE#, REGISTRAR, ACTIVATION# from v$archived_log WHERE next_time>(sysdate-1/24); THREAD# SEQUENCE# RESETLOGS_ID FIRST_CHANGE# NEXT_CHANGE# REGISTR ACTIVATION# ---------- ---------- ------------ ------------- ------------ ------- ----------- 1 22 952446304 648113 652296 RFS 3044612576 1 23 952446304 652296 652300 RFS 3044612576 1 24 952446304 652300 652361 RFS 3044612576 1 25 952446304 652361 652404 RFS 3044612576 1 26 952446304 652404 652410 RFS 3044612576 1 27 952446304 652410 653523 RFS 3044612576 1 28 952446304 653523 653529 RFS 3044612576 1 29 952446304 653529 657362 RFS 3044612576 1 30 952446304 657362 657399 RFS 3044612576 1 31 952446304 657399 657461 RFS 3044612576 1 32 952446304 657461 661863 RFS 3044612576 1 33 952446304 661863 661869 RFS 3044612576 1 34 952446304 661869 662080 RFS 3044612576 1 1 952543943 661845 662731 ARCH 3044656145
  52. 52. Use Case: SNAP STANDBY ONLY Get the Most out of Oracle Data Guard!52 9/29/2017 stout_ludo stout_vico stout_RW stout_SNAP CLIENTS srvctl add service -db stout_vico -service stout_SNAP -role SNAPSHOT_STANDBY (ADDRESS=(HOST=vico01)(PORT=1521)) (ADDRESS=(HOST=ludo01)(PORT=1521))
  53. 53. Use Case: SNAP STANDBY ONLY Get the Most out of Oracle Data Guard!53 9/29/2017 stout_ludo stout_vico stout_RW stout_SNAP CLIENTS srvctl add service -db stout_vico -service stout_SNAP -role SNAPSHOT_STANDBY (ADDRESS=(HOST=vico01)(PORT=1521)) (ADDRESS=(HOST=ludo01)(PORT=1521)) MRP0
  54. 54. Use Case: SNAP STANDBY ONLY Get the Most out of Oracle Data Guard!54 9/29/2017 srvctl add service -db stout_vico -service stout_snap.trivadistraining.com -role “SNAPSHOT_STANDBY” -failovertype SELECT -failovermethod BASIC stout_SNAP.trivadistraining.com = (DESCRIPTION = (CONNECT_TIMEOUT = 5 )(TRANSPORT_CONNECT_TIMEOUT = 3 ) (ADDRESS_LIST = (LOAD_BALANCE = OFF ) (ADDRESS = (PROTOCOL = TCP )(HOST = vico01.trivadistraining.com )(PORT = 1521 )) (ADDRESS = (PROTOCOL = TCP )(HOST = ludo01.trivadistraining.com )(PORT = 1521 )) ) (CONNECT_DATA = (SERVICE_NAME = stout_SNAP.trivadistraining.com ) ) )
  55. 55. Use Case: SNAP STANDBY or PRIMARY Get the Most out of Oracle Data Guard!55 9/29/2017 stout_ludo stout_vico stout_RW stout_SNAP CLIENTS srvctl add service -db stout_vico -service stout_SNAP -role “SNAPSHOT_STANDBY,PRIMARY” (ADDRESS=(HOST=vico01)(PORT=1521)) (ADDRESS=(HOST=ludo01)(PORT=1521)) stout_SNAP
  56. 56. Use Case: SNAP STANDBY or PRIMARY Get the Most out of Oracle Data Guard!56 9/29/2017 stout_ludo stout_vico stout_RW stout_SNAP CLIENTS srvctl add service -db stout_vico -service stout_SNAP -role “SNAPSHOT_STANDBY,PRIMARY” (ADDRESS=(HOST=vico01)(PORT=1521)) (ADDRESS=(HOST=ludo01)(PORT=1521)) stout_SNAP MRP0
  57. 57. Use Case: SNAP STANDBY or PRIMARY Get the Most out of Oracle Data Guard!57 9/29/2017 srvctl add service -db stout_vico -service stout_snap.trivadistraining.com -role “PRIMARY,SNAPSHOT_STANDBY” -failovertype SELECT -failovermethod BASIC stout_SNAP.trivadistraining.com = (DESCRIPTION = (CONNECT_TIMEOUT = 5 )(TRANSPORT_CONNECT_TIMEOUT = 3 ) (ADDRESS_LIST = (LOAD_BALANCE = OFF ) (ADDRESS = (PROTOCOL = TCP )(HOST = vico01.trivadistraining.com )(PORT = 1521 )) (ADDRESS = (PROTOCOL = TCP )(HOST = ludo01.trivadistraining.com )(PORT = 1521 )) ) (CONNECT_DATA = (SERVICE_NAME = stout_SNAP.trivadistraining.com ) ) )
  58. 58. Get the Most out of Oracle Data Guard!58 9/29/2017 Demo?
  59. 59. Use Case: Double SNAP STANDBY Get the Most out of Oracle Data Guard!59 9/29/2017 stout_ludo stout_vico stout_RW stout_SNAP CLIENTS srvctl add service -db stout_vico -service stout_SNAP -role “SNAPSHOT_STANDBY” (ADDRESS=(HOST=vico01)(PORT=1521)) (ADDRESS=(HOST=piwo01)(PORT=1521)) stout_piwoMRP0
  60. 60. Use Case: Double SNAP STANDBY Get the Most out of Oracle Data Guard!60 9/29/2017 stout_ludo stout_vico stout_RW stout_SNAP CLIENTS srvctl add service -db stout_vico -service stout_SNAP -role “SNAPSHOT_STANDBY” (ADDRESS=(HOST=vico01)(PORT=1521)) (ADDRESS=(HOST=piwo01)(PORT=1521)) stout_piwo stout_SNAP
  61. 61. Use Case: Double SNAP STANDBY Get the Most out of Oracle Data Guard!61 9/29/2017 stout_ludo stout_vico stout_RW CLIENTS srvctl add service -db stout_vico -service stout_SNAP -role “SNAPSHOT_STANDBY” (ADDRESS=(HOST=vico01)(PORT=1521)) (ADDRESS=(HOST=piwo01)(PORT=1521)) stout_piwo MRP0 stout_SNAP
  62. 62. Two Standby Databases Use Case Get the Most out of Oracle Data Guard!62 9/29/2017 srvctl add service -db stout_vico -service stout_snap.trivadistraining.com -role “SNAPSHOT_STANDBY” -failovertype SELECT -failovermethod BASIC stout_SNAP.trivadistraining.com = (DESCRIPTION = (CONNECT_TIMEOUT = 5 )(TRANSPORT_CONNECT_TIMEOUT = 3 ) (ADDRESS_LIST = (LOAD_BALANCE = OFF ) (ADDRESS = (PROTOCOL = TCP )(HOST = vico01.trivadistraining.com )(PORT = 1521 )) (ADDRESS = (PROTOCOL = TCP )(HOST = piwo01.trivadistraining.com )(PORT = 1521 )) ) (CONNECT_DATA = (SERVICE_NAME = stout_SNAP.trivadistraining.com ) ) )
  63. 63. Get the Most out of Oracle Data Guard! Standby Consistency on recovery cancel 9/29/201763
  64. 64. stout_vico Redo Apply (roll-forward) Get the Most out of Oracle Data Guard!64 9/29/2017 BUFFER CACHE datafilesfuzzy datafiles dbw0 stout_ludo LGWR RFS MRP0 ol stbl arcarc ckpt
  65. 65. Block status Get the Most out of Oracle Data Guard!65 9/29/2017 SQL> select status, dirty, count(*) from v$bh 2> group by status, dirty order by status, dirty; STATUS D COUNT(*) ---------- - ---------- free N 11 mrec N 3013 mrec Y 82 DGMGRL> edit database stout_vico set state='APPLY-OFF'; SQL> select status, dirty, count(*) from v$bh 2> group by status, dirty order by status, dirty; STATUS D COUNT(*) ---------- - ---------- free N 7012
  66. 66. Block status Get the Most out of Oracle Data Guard!66 9/29/2017 SQL> select status, dirty, count(*) from v$bh 2> group by status, dirty order by status, dirty; STATUS D COUNT(*) ---------- - ---------- free N 11 mrec N 3013 mrec Y 82 DGMGRL> edit database stout_vico set state='APPLY-OFF'; SQL> select status, dirty, count(*) from v$bh 2> group by status, dirty order by status, dirty; STATUS D COUNT(*) ---------- - ---------- free N 7012 ORA-16037: user requested cancel of managed recovery operation Managed Standby Recovery not using Real Time Apply Recovery interrupted! Recovered data files to a consistent state at change 292504638291
  67. 67. Consistent datafiles == consistent database Get the Most out of Oracle Data Guard!67 9/29/2017 No additional media recovery required before OPEN RESETLOGS – Cold backups via filesystem commands – Cloning possible without bother with Online or Archive Logs! Consistent Standby + ACFS Snapshots (or other) = Cheap Database Cloning
  68. 68. Cloning solution based on Standby Database Get the Most out of Oracle Data Guard!68 9/29/2017 ludo01 GRID INFRASTRUCTURE 12cR2 DG +DATA ACFS /u02/fra ACFS /u02/data stout_ludo SNAPSHOT stout vico01 GRID INFRASTRUCTURE 12cR2 DG +DATA ACFS /u02/data ACFS /u02/fra stout_vico SNAPSHOT stout MRP0 SNAPSHOT clone1 clone1 SNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT COPYSNAPSHOT Sunday
  69. 69. Cloning Steps Get the Most out of Oracle Data Guard!69 9/29/2017 Snapshot creation – edit database stout_vico set state=‘APPLY-OFF’; – acfsutil snap create -w -p stout stout.`date +%A` /u02/data – alter database backup controlfile to trace as ‘/u02/data/.ACFS/snaps/…’ ; – create pfile=‘/u02/data/.ACFS/snaps/…’ from spfile; – edit database stout_vico set state=‘APPLY-ON’;
  70. 70. Cloning Steps Get the Most out of Oracle Data Guard!70 9/29/2017 Cloning the database from the snapshot – Abort previous instance / delete previous snapshot – acfsutil snap create -w -p stout.`date +%A` clone1 /u02/data – sed -i -e ‘s/stout_vico/clones/g’ init.ora control_trace.trc – startup open resetlogs
  71. 71. Get the Most out of Oracle Data Guard!71 9/29/2017 Demo?
  72. 72. Get the Most out of Oracle Data Guard!72 9/29/2017 Let me do one more example
  73. 73. Database reorganization live Get the Most out of Oracle Data Guard!73 9/29/2017 Setup physical standby Convert to logical standby << Here the standby is OPEN Stop SQL Apply Reorganize your database Start SQL Apply and catch the primary Switchover to Logical Standby
  74. 74. Get the Most out of Oracle Data Guard! Conclusions 9/29/201774
  75. 75. BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH Questions? Oracle Open World 2017 #OOW17 Ludovico Caldara Oracle ACE Director Senior Consultant

×