SlideShare a Scribd company logo
1 of 76
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!
High Five POUG
#POUG2017
Ludovico Caldara
Oracle ACE Director
Senior Consultant
About Ludovico Caldara
Get the Most out of Oracle Data Guard!2 9/1/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
About Ludovico Caldara
Get the Most out of Oracle Data Guard!3 9/1/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
Our company.
Adaptive Features or: How I learned to Stop Worrying4 01/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
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 Worrying5 01/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
Get the Most out of Oracle Data Guard!6 9/1/2017
Oracle
Data Guard?
Why is Oracle Data Guard still relevant?
Get the Most out of Oracle Data Guard!7 9/1/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
Hey, it’s 12c Release 2!
Get the Most out of Oracle Data Guard!8 9/1/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
Hey, it’s 12c Release 2!
Get the Most out of Oracle Data Guard!9 9/1/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!
What about Active Data Guard new features?
Get the Most out of Oracle Data Guard!10 9/1/2017
What about Active Data Guard new features?
Get the Most out of Oracle Data Guard!11 9/1/2017
What about Active Data Guard new features?
Get the Most out of Oracle Data Guard!12 9/1/2017
Get the Most out of Oracle Data Guard!13 9/1/2017
Technology Enablers
The «MAIN» features included in Data Guard
Get the Most out of Oracle Data Guard!14 9/1/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)
The «MAIN» features included in Data Guard
Get the Most out of Oracle Data Guard!15 9/1/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)
Our three main topics for this presentation
Get the Most out of Oracle Data Guard!16 9/1/2017
Client Failover (TAF)
Snapshot Standby
Standby consistency on recovery cancel
Our three main topics for this presentation
Get the Most out of Oracle Data Guard!17 9/1/2017
Client Failover (TAF)
Snapshot Standby
Standby consistency on recovery cancel
Database
Migration
Our three main topics for this presentation
Get the Most out of Oracle Data Guard!18 9/1/2017
Client Failover (TAF)
Snapshot Standby
Standby consistency on recovery cancel
Reporting
Our three topics focuses for this presentation
Get the Most out of Oracle Data Guard!19 9/1/2017
Client Failover (TAF)
Snapshot Standby
Standby consistency on recovery cancel Database
Cloning
Get the Most out of Oracle Data Guard!20 9/1/2017
Client Failover
Client Failover is a critical topic!
Get the Most out of Oracle Data Guard!21 9/1/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
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/1/201722
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/1/201723
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/1/201724
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;
/
Transparent Application Failover – Client Side Example
Get the Most out of Oracle Data Guard!
Example client side TAF BASIC method configuration.
189/1/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)
)
)
)
Transparent Application Failover – Client Side Example
Get the Most out of Oracle Data Guard!
Example client side TAF BASIC method configuration.
189/1/201726
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
Use Case: Classic Data Guard Failover / Switchover
Get the Most out of Oracle Data Guard!27 9/1/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
Use Case: Classic Data Guard Failover / Switchover
Get the Most out of Oracle Data Guard!28 9/1/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
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!29 9/1/2017
sour
CLIENTS
(ADDRESS=(HOST=ludo01)(PORT=1521))
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!30 9/1/2017
sour
CLIENTS
(ADDRESS=(HOST=ludo01)(PORT=1521))
sour_newMRP0
– Set up Standby instance
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!31 9/1/2017
sour
CLIENTS
(ADDRESS=(HOST=ludo01)(PORT=1521))
sour_newMRP0
– Set up Standby instance
– Stop application
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!32 9/1/2017
sour
CLIENTS
(ADDRESS=(HOST=ludo01)(PORT=1521))
sour_new
MRP0
– Set up Standby instance
– Stop application
– Switchover
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!33 9/1/2017
sour
CLIENTS
(ADDRESS=(HOST=ludo01vico01)(PORT=1521))
sour_new
MRP0
– Change TNS definition– Set up Standby instance
– Stop application
– Switchover
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!34 9/1/2017
sour
CLIENTS
(ADDRESS=(HOST=ludo01vico01)(PORT=1521))
sour_new
MRP0
– Change TNS definition
– Start application
– Set up Standby instance
– Stop application
– Switchover
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!35 9/1/2017
CLIENTS
(ADDRESS=(HOST=vico01)(PORT=1521))
sour_new
– Set up Standby instance
– Stop application
– Switchover
– Change TNS definition
– Start application
– Cleanup
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!36 9/1/2017
Problems
– Requires application downtime (even if short)
– Messy DB_UNIQUE_NAME naming convention
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!37 9/1/2017
Problems
– Requires application downtime (even if short)
– Messy DB_UNIQUE_NAME naming convention
?Better solutions?
Use Case: Migrate Standalone on another server
Get the Most out of Oracle Data Guard!38 9/1/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
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!39 9/1/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
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!40 9/1/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
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!41 9/1/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
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!42 9/1/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!
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!43 9/1/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!
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!44 9/1/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!
Use Case: Smart Standalone Configuration
Get the Most out of Oracle Data Guard!45 9/1/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!
Get the Most out of Oracle Data Guard!46 9/1/2017
Live
Demo?
Get the Most out of Oracle Data Guard!47 9/1/2017
Snapshot Standby
Physical Standby (simplified)
Get the Most out of Oracle Data Guard!48 9/1/2017
stout_ludo stout_vicoLGWR RFS MRP0
ol stbl
arcarc
Snapshot Standby (simplified)
Get the Most out of Oracle Data Guard!49 9/1/2017
stout_ludo stout_vicoLGWR RFS
ol stbl
arcarc
LGWR
ol
arc
Snapshot Standby
Get the Most out of Oracle Data Guard!50 9/1/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;
Conversion
Get the Most out of Oracle Data Guard!51 9/1/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
Two sources for Archive Logs?
Get the Most out of Oracle Data Guard!52 9/1/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
Use Case: SNAP STANDBY ONLY
Get the Most out of Oracle Data Guard!53 9/1/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))
Use Case: SNAP STANDBY ONLY
Get the Most out of Oracle Data Guard!54 9/1/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
Use Case: SNAP STANDBY ONLY
Get the Most out of Oracle Data Guard!55 9/1/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 )
)
)
Use Case: SNAP STANDBY or PRIMARY
Get the Most out of Oracle Data Guard!56 9/1/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
Use Case: SNAP STANDBY or PRIMARY
Get the Most out of Oracle Data Guard!57 9/1/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
Use Case: SNAP STANDBY or PRIMARY
Get the Most out of Oracle Data Guard!58 9/1/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 )
)
)
Get the Most out of Oracle Data Guard!59 9/1/2017
Live
Demo?
Use Case: Double SNAP STANDBY
Get the Most out of Oracle Data Guard!60 9/1/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
Use Case: Double SNAP STANDBY
Get the Most out of Oracle Data Guard!61 9/1/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
Use Case: Double SNAP STANDBY
Get the Most out of Oracle Data Guard!62 9/1/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
Two Standby Databases Use Case
Get the Most out of Oracle Data Guard!63 9/1/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 )
)
)
Get the Most out of Oracle Data Guard!
Standby
Consistency
on
recovery cancel
9/1/201764
stout_vico
Redo Apply (roll-forward)
Get the Most out of Oracle Data Guard!65 9/1/2017
BUFFER CACHE
datafilesfuzzy
datafiles
dbw0
stout_ludo LGWR RFS MRP0
ol stbl
arcarc
ckpt
Block status
Get the Most out of Oracle Data Guard!66 9/1/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
Block status
Get the Most out of Oracle Data Guard!67 9/1/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
Consistent datafiles == consistent database
Get the Most out of Oracle Data Guard!68 9/1/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
Cloning solution based on Standby Database
Get the Most out of Oracle Data Guard!69 9/1/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
Cloning Steps
Get the Most out of Oracle Data Guard!70 9/1/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’;
Cloning Steps
Get the Most out of Oracle Data Guard!71 9/1/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
Get the Most out of Oracle Data Guard!72 9/1/2017
Live
Demo?
Get the Most out of Oracle Data Guard!73 9/1/2017
Let me do one more example
Database reorganization live
Get the Most out of Oracle Data Guard!74 9/1/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
Get the Most out of Oracle Data Guard!
Conclusions
9/1/201775
BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
Questions in front of a beer!
High Five POUG
#POUG2017
Ludovico Caldara
Oracle ACE Director
Senior Consultant

More Related Content

What's hot

Effective Oracle Home Management in the new Release Model era
Effective Oracle Home Management in the new Release Model eraEffective Oracle Home Management in the new Release Model era
Effective Oracle Home Management in the new Release Model eraLudovico Caldara
 
Oracle Database on ACFS: a perfect marriage?
Oracle Database on ACFS: a perfect marriage?Oracle Database on ACFS: a perfect marriage?
Oracle Database on ACFS: a perfect marriage?Ludovico Caldara
 
Oracle Active Data Guard 12cR2. Is it the best option?
Oracle Active Data Guard 12cR2. Is it the best option?Oracle Active Data Guard 12cR2. Is it the best option?
Oracle Active Data Guard 12cR2. Is it the best option?Ludovico Caldara
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityLudovico Caldara
 
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...Ludovico Caldara
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Ludovico Caldara
 
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Leighton Nelson
 
Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...
Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...
Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...Ludovico Caldara
 
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...Ludovico Caldara
 
Oracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam BashaOracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam Bashapasalapudi123
 
Crating a Robust Performance Strategy
Crating a Robust Performance StrategyCrating a Robust Performance Strategy
Crating a Robust Performance StrategyGuatemala User Group
 
GoldenGate and ODI - A Perfect Match for Real-Time Data Warehousing
GoldenGate and ODI - A Perfect Match for Real-Time Data WarehousingGoldenGate and ODI - A Perfect Match for Real-Time Data Warehousing
GoldenGate and ODI - A Perfect Match for Real-Time Data WarehousingMichael Rainey
 
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...Alex Zaballa
 
PDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service ApplicationPDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service ApplicationLeighton Nelson
 
Oracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New FeaturesOracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New FeaturesDeiby Gómez
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionGuatemala User Group
 

What's hot (20)

Effective Oracle Home Management in the new Release Model era
Effective Oracle Home Management in the new Release Model eraEffective Oracle Home Management in the new Release Model era
Effective Oracle Home Management in the new Release Model era
 
Oracle Database on ACFS: a perfect marriage?
Oracle Database on ACFS: a perfect marriage?Oracle Database on ACFS: a perfect marriage?
Oracle Database on ACFS: a perfect marriage?
 
Oracle Active Data Guard 12cR2. Is it the best option?
Oracle Active Data Guard 12cR2. Is it the best option?Oracle Active Data Guard 12cR2. Is it the best option?
Oracle Active Data Guard 12cR2. Is it the best option?
 
Oracle Drivers configuration for High Availability
Oracle Drivers configuration for High AvailabilityOracle Drivers configuration for High Availability
Oracle Drivers configuration for High Availability
 
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
Oracle RAC, Data Guard, and Pluggable Databases: When MAA Meets Multitenant (...
 
Rapid Home Provisioning
Rapid Home ProvisioningRapid Home Provisioning
Rapid Home Provisioning
 
Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?Oracle Drivers configuration for High Availability, is it a developer's job?
Oracle Drivers configuration for High Availability, is it a developer's job?
 
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
Oracle Enteprise Manager Cloud Control 12c - Setting Up Metrics and Monitorin...
 
Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...
Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...
Oracle RAC, Oracle Data Guard, and Pluggable Databases: When MAA Meets Oracle...
 
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
Oracle Active Data Guard 12c: Far Sync Instance, Real-Time Cascade and Other ...
 
Oracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam BashaOracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam Basha
 
Oracle 12 Upgrade
Oracle 12 UpgradeOracle 12 Upgrade
Oracle 12 Upgrade
 
Crating a Robust Performance Strategy
Crating a Robust Performance StrategyCrating a Robust Performance Strategy
Crating a Robust Performance Strategy
 
GoldenGate and ODI - A Perfect Match for Real-Time Data Warehousing
GoldenGate and ODI - A Perfect Match for Real-Time Data WarehousingGoldenGate and ODI - A Perfect Match for Real-Time Data Warehousing
GoldenGate and ODI - A Perfect Match for Real-Time Data Warehousing
 
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
OTN TOUR 2016 - Oracle Database 12c - The Best Oracle Database 12c New Featur...
 
PDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service ApplicationPDB Provisioning with Oracle Multitenant Self Service Application
PDB Provisioning with Oracle Multitenant Self Service Application
 
Oracle GoldenGate for Oracle DBAs
Oracle GoldenGate for Oracle DBAsOracle GoldenGate for Oracle DBAs
Oracle GoldenGate for Oracle DBAs
 
Oracle acfs in oracle 11
Oracle acfs in oracle 11Oracle acfs in oracle 11
Oracle acfs in oracle 11
 
Oracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New FeaturesOracle Database 12.1.0.2: New Features
Oracle Database 12.1.0.2: New Features
 
Oracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL OptionOracle Database Performance Tuning: The Not SQL Option
Oracle Database Performance Tuning: The Not SQL Option
 

Similar to Get the most out of Oracle Data Guard - POUG version

Golden Gate - How to start such a project?
Golden Gate  - How to start such a project?Golden Gate  - How to start such a project?
Golden Gate - How to start such a project?Trivadis
 
Oracle data guard for beginners
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginnersPini Dibask
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2Mario Redón Luz
 
GoldenGate CDR from UKOUG 2017
GoldenGate CDR from UKOUG 2017GoldenGate CDR from UKOUG 2017
GoldenGate CDR from UKOUG 2017Bobby Curtis
 
What's new in Oracle Trace File Analyzer 12.2.1.3.0
What's new in Oracle Trace File Analyzer 12.2.1.3.0What's new in Oracle Trace File Analyzer 12.2.1.3.0
What's new in Oracle Trace File Analyzer 12.2.1.3.0Gareth Chapman
 
Oracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12cOracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12cTrivadis
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Nelson Calero
 
Oracle Data Guard for Beginners
Oracle Data Guard for BeginnersOracle Data Guard for Beginners
Oracle Data Guard for BeginnersPini Dibask
 
IOUG Collaborate 18 - Data Guard for Beginners
IOUG Collaborate 18 - Data Guard for BeginnersIOUG Collaborate 18 - Data Guard for Beginners
IOUG Collaborate 18 - Data Guard for BeginnersPini Dibask
 
Oracle Trace File Analyzer - What's New in 12.2.1.1.0
Oracle Trace File Analyzer - What's New in 12.2.1.1.0Oracle Trace File Analyzer - What's New in 12.2.1.1.0
Oracle Trace File Analyzer - What's New in 12.2.1.1.0Gareth Chapman
 
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RACAUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RACSandesh Rao
 
MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL Brasil
 
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]Markus Michalewicz
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Bobby Curtis
 
Replicate data between environments
Replicate data between environmentsReplicate data between environments
Replicate data between environmentsDLT Solutions
 
Muhammad Hameed Chaudhry
Muhammad Hameed ChaudhryMuhammad Hameed Chaudhry
Muhammad Hameed ChaudhryAamir Chaudhry
 
Cloud Native Applications on OpenShift
Cloud Native Applications on OpenShiftCloud Native Applications on OpenShift
Cloud Native Applications on OpenShiftSerhat Dirik
 
MAA for Oracle Database, Exadata and the Cloud
MAA for Oracle Database, Exadata and the CloudMAA for Oracle Database, Exadata and the Cloud
MAA for Oracle Database, Exadata and the CloudMarkus Michalewicz
 

Similar to Get the most out of Oracle Data Guard - POUG version (20)

Golden Gate - How to start such a project?
Golden Gate  - How to start such a project?Golden Gate  - How to start such a project?
Golden Gate - How to start such a project?
 
Oracle data guard for beginners
Oracle data guard for beginnersOracle data guard for beginners
Oracle data guard for beginners
 
High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2High Availability And Oracle Data Guard 11g R2
High Availability And Oracle Data Guard 11g R2
 
GoldenGate CDR from UKOUG 2017
GoldenGate CDR from UKOUG 2017GoldenGate CDR from UKOUG 2017
GoldenGate CDR from UKOUG 2017
 
What's new in Oracle Trace File Analyzer 12.2.1.3.0
What's new in Oracle Trace File Analyzer 12.2.1.3.0What's new in Oracle Trace File Analyzer 12.2.1.3.0
What's new in Oracle Trace File Analyzer 12.2.1.3.0
 
Oracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12cOracle Failover Database Cluster with Grid Infrastructure 12c
Oracle Failover Database Cluster with Grid Infrastructure 12c
 
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
Automate Oracle database patches and upgrades using Fleet Provisioning and Pa...
 
Oracle Data Guard for Beginners
Oracle Data Guard for BeginnersOracle Data Guard for Beginners
Oracle Data Guard for Beginners
 
IOUG Collaborate 18 - Data Guard for Beginners
IOUG Collaborate 18 - Data Guard for BeginnersIOUG Collaborate 18 - Data Guard for Beginners
IOUG Collaborate 18 - Data Guard for Beginners
 
Oracle Trace File Analyzer - What's New in 12.2.1.1.0
Oracle Trace File Analyzer - What's New in 12.2.1.1.0Oracle Trace File Analyzer - What's New in 12.2.1.1.0
Oracle Trace File Analyzer - What's New in 12.2.1.1.0
 
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RACAUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
AUSOUG - NZOUG-GroundBreakers-Jun 2019 - 19c RAC
 
MySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e UberMySQL no Paypal Tesla e Uber
MySQL no Paypal Tesla e Uber
 
LALIT-TCS
LALIT-TCSLALIT-TCS
LALIT-TCS
 
JSN NRG Resume
JSN NRG ResumeJSN NRG Resume
JSN NRG Resume
 
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
Oracle RAC 12c Practical Performance Management and Tuning OOW13 [CON8825]
 
Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)Database As A Service: OEM + ODA (OOW 15 Presentation)
Database As A Service: OEM + ODA (OOW 15 Presentation)
 
Replicate data between environments
Replicate data between environmentsReplicate data between environments
Replicate data between environments
 
Muhammad Hameed Chaudhry
Muhammad Hameed ChaudhryMuhammad Hameed Chaudhry
Muhammad Hameed Chaudhry
 
Cloud Native Applications on OpenShift
Cloud Native Applications on OpenShiftCloud Native Applications on OpenShift
Cloud Native Applications on OpenShift
 
MAA for Oracle Database, Exadata and the Cloud
MAA for Oracle Database, Exadata and the CloudMAA for Oracle Database, Exadata and the Cloud
MAA for Oracle Database, Exadata and the Cloud
 

More from Ludovico Caldara

Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast SlidesOracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast SlidesLudovico Caldara
 
Let your DBAs get some REST(api)
Let your DBAs get some REST(api)Let your DBAs get some REST(api)
Let your DBAs get some REST(api)Ludovico Caldara
 
ADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMB
ADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMBADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMB
ADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMBLudovico Caldara
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESLudovico Caldara
 
Oracle RAC 12c and Policy-Managed Databases, a Technical Overview
Oracle RAC 12c and Policy-Managed Databases, a Technical OverviewOracle RAC 12c and Policy-Managed Databases, a Technical Overview
Oracle RAC 12c and Policy-Managed Databases, a Technical OverviewLudovico Caldara
 
Boost your Oracle RAC manageability with Policy-Managed Databases
Boost your Oracle RAC manageability with Policy-Managed DatabasesBoost your Oracle RAC manageability with Policy-Managed Databases
Boost your Oracle RAC manageability with Policy-Managed DatabasesLudovico Caldara
 
RACAttack 12c Advanced Lab: Server Pools and Policy-managed databases
RACAttack 12c Advanced Lab: Server Pools and Policy-managed databasesRACAttack 12c Advanced Lab: Server Pools and Policy-managed databases
RACAttack 12c Advanced Lab: Server Pools and Policy-managed databasesLudovico Caldara
 
Galera Cluster: Synchronous Multi-Master Replication for MySQL HA
Galera Cluster: Synchronous Multi-Master Replication for MySQL HAGalera Cluster: Synchronous Multi-Master Replication for MySQL HA
Galera Cluster: Synchronous Multi-Master Replication for MySQL HALudovico Caldara
 

More from Ludovico Caldara (9)

Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast SlidesOracle Fleet Patching and Provisioning Deep Dive Webcast Slides
Oracle Fleet Patching and Provisioning Deep Dive Webcast Slides
 
Long live to CMAN!
Long live to CMAN!Long live to CMAN!
Long live to CMAN!
 
Let your DBAs get some REST(api)
Let your DBAs get some REST(api)Let your DBAs get some REST(api)
Let your DBAs get some REST(api)
 
ADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMB
ADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMBADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMB
ADAPTIVE FEATURES OR: HOW I LEARNED TO STOP WORRYING AND TROUBLESHOOT THE BOMB
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
 
Oracle RAC 12c and Policy-Managed Databases, a Technical Overview
Oracle RAC 12c and Policy-Managed Databases, a Technical OverviewOracle RAC 12c and Policy-Managed Databases, a Technical Overview
Oracle RAC 12c and Policy-Managed Databases, a Technical Overview
 
Boost your Oracle RAC manageability with Policy-Managed Databases
Boost your Oracle RAC manageability with Policy-Managed DatabasesBoost your Oracle RAC manageability with Policy-Managed Databases
Boost your Oracle RAC manageability with Policy-Managed Databases
 
RACAttack 12c Advanced Lab: Server Pools and Policy-managed databases
RACAttack 12c Advanced Lab: Server Pools and Policy-managed databasesRACAttack 12c Advanced Lab: Server Pools and Policy-managed databases
RACAttack 12c Advanced Lab: Server Pools and Policy-managed databases
 
Galera Cluster: Synchronous Multi-Master Replication for MySQL HA
Galera Cluster: Synchronous Multi-Master Replication for MySQL HAGalera Cluster: Synchronous Multi-Master Replication for MySQL HA
Galera Cluster: Synchronous Multi-Master Replication for MySQL HA
 

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Get the most out of Oracle Data Guard - POUG version

  • 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! High Five POUG #POUG2017 Ludovico Caldara Oracle ACE Director Senior Consultant
  • 2. About Ludovico Caldara Get the Most out of Oracle Data Guard!2 9/1/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. About Ludovico Caldara Get the Most out of Oracle Data Guard!3 9/1/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
  • 4. Our company. Adaptive Features or: How I learned to Stop Worrying4 01/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
  • 5. 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 Worrying5 01/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
  • 6. Get the Most out of Oracle Data Guard!6 9/1/2017 Oracle Data Guard?
  • 7. Why is Oracle Data Guard still relevant? Get the Most out of Oracle Data Guard!7 9/1/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. Hey, it’s 12c Release 2! Get the Most out of Oracle Data Guard!8 9/1/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. Hey, it’s 12c Release 2! Get the Most out of Oracle Data Guard!9 9/1/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. What about Active Data Guard new features? Get the Most out of Oracle Data Guard!10 9/1/2017
  • 11. What about Active Data Guard new features? Get the Most out of Oracle Data Guard!11 9/1/2017
  • 12. What about Active Data Guard new features? Get the Most out of Oracle Data Guard!12 9/1/2017
  • 13. Get the Most out of Oracle Data Guard!13 9/1/2017 Technology Enablers
  • 14. The «MAIN» features included in Data Guard Get the Most out of Oracle Data Guard!14 9/1/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. The «MAIN» features included in Data Guard Get the Most out of Oracle Data Guard!15 9/1/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)
  • 16. Our three main topics for this presentation Get the Most out of Oracle Data Guard!16 9/1/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel
  • 17. Our three main topics for this presentation Get the Most out of Oracle Data Guard!17 9/1/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel Database Migration
  • 18. Our three main topics for this presentation Get the Most out of Oracle Data Guard!18 9/1/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel Reporting
  • 19. Our three topics focuses for this presentation Get the Most out of Oracle Data Guard!19 9/1/2017 Client Failover (TAF) Snapshot Standby Standby consistency on recovery cancel Database Cloning
  • 20. Get the Most out of Oracle Data Guard!20 9/1/2017 Client Failover
  • 21. Client Failover is a critical topic! Get the Most out of Oracle Data Guard!21 9/1/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
  • 22. 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/1/201722
  • 23. 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/1/201723
  • 24. 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/1/201724 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; /
  • 25. Transparent Application Failover – Client Side Example Get the Most out of Oracle Data Guard! Example client side TAF BASIC method configuration. 189/1/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) ) ) )
  • 26. Transparent Application Failover – Client Side Example Get the Most out of Oracle Data Guard! Example client side TAF BASIC method configuration. 189/1/201726 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
  • 27. Use Case: Classic Data Guard Failover / Switchover Get the Most out of Oracle Data Guard!27 9/1/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. Use Case: Classic Data Guard Failover / Switchover Get the Most out of Oracle Data Guard!28 9/1/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
  • 29. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!29 9/1/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521))
  • 30. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!30 9/1/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521)) sour_newMRP0 – Set up Standby instance
  • 31. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!31 9/1/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521)) sour_newMRP0 – Set up Standby instance – Stop application
  • 32. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!32 9/1/2017 sour CLIENTS (ADDRESS=(HOST=ludo01)(PORT=1521)) sour_new MRP0 – Set up Standby instance – Stop application – Switchover
  • 33. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!33 9/1/2017 sour CLIENTS (ADDRESS=(HOST=ludo01vico01)(PORT=1521)) sour_new MRP0 – Change TNS definition– Set up Standby instance – Stop application – Switchover
  • 34. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!34 9/1/2017 sour CLIENTS (ADDRESS=(HOST=ludo01vico01)(PORT=1521)) sour_new MRP0 – Change TNS definition – Start application – Set up Standby instance – Stop application – Switchover
  • 35. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!35 9/1/2017 CLIENTS (ADDRESS=(HOST=vico01)(PORT=1521)) sour_new – Set up Standby instance – Stop application – Switchover – Change TNS definition – Start application – Cleanup
  • 36. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!36 9/1/2017 Problems – Requires application downtime (even if short) – Messy DB_UNIQUE_NAME naming convention
  • 37. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!37 9/1/2017 Problems – Requires application downtime (even if short) – Messy DB_UNIQUE_NAME naming convention ?Better solutions?
  • 38. Use Case: Migrate Standalone on another server Get the Most out of Oracle Data Guard!38 9/1/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
  • 39. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!39 9/1/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
  • 40. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!40 9/1/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
  • 41. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!41 9/1/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
  • 42. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!42 9/1/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!
  • 43. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!43 9/1/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!
  • 44. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!44 9/1/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. Use Case: Smart Standalone Configuration Get the Most out of Oracle Data Guard!45 9/1/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!
  • 46. Get the Most out of Oracle Data Guard!46 9/1/2017 Live Demo?
  • 47. Get the Most out of Oracle Data Guard!47 9/1/2017 Snapshot Standby
  • 48. Physical Standby (simplified) Get the Most out of Oracle Data Guard!48 9/1/2017 stout_ludo stout_vicoLGWR RFS MRP0 ol stbl arcarc
  • 49. Snapshot Standby (simplified) Get the Most out of Oracle Data Guard!49 9/1/2017 stout_ludo stout_vicoLGWR RFS ol stbl arcarc LGWR ol arc
  • 50. Snapshot Standby Get the Most out of Oracle Data Guard!50 9/1/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;
  • 51. Conversion Get the Most out of Oracle Data Guard!51 9/1/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
  • 52. Two sources for Archive Logs? Get the Most out of Oracle Data Guard!52 9/1/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
  • 53. Use Case: SNAP STANDBY ONLY Get the Most out of Oracle Data Guard!53 9/1/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))
  • 54. Use Case: SNAP STANDBY ONLY Get the Most out of Oracle Data Guard!54 9/1/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
  • 55. Use Case: SNAP STANDBY ONLY Get the Most out of Oracle Data Guard!55 9/1/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 ) ) )
  • 56. Use Case: SNAP STANDBY or PRIMARY Get the Most out of Oracle Data Guard!56 9/1/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
  • 57. Use Case: SNAP STANDBY or PRIMARY Get the Most out of Oracle Data Guard!57 9/1/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
  • 58. Use Case: SNAP STANDBY or PRIMARY Get the Most out of Oracle Data Guard!58 9/1/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 ) ) )
  • 59. Get the Most out of Oracle Data Guard!59 9/1/2017 Live Demo?
  • 60. Use Case: Double SNAP STANDBY Get the Most out of Oracle Data Guard!60 9/1/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
  • 61. Use Case: Double SNAP STANDBY Get the Most out of Oracle Data Guard!61 9/1/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
  • 62. Use Case: Double SNAP STANDBY Get the Most out of Oracle Data Guard!62 9/1/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
  • 63. Two Standby Databases Use Case Get the Most out of Oracle Data Guard!63 9/1/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 ) ) )
  • 64. Get the Most out of Oracle Data Guard! Standby Consistency on recovery cancel 9/1/201764
  • 65. stout_vico Redo Apply (roll-forward) Get the Most out of Oracle Data Guard!65 9/1/2017 BUFFER CACHE datafilesfuzzy datafiles dbw0 stout_ludo LGWR RFS MRP0 ol stbl arcarc ckpt
  • 66. Block status Get the Most out of Oracle Data Guard!66 9/1/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
  • 67. Block status Get the Most out of Oracle Data Guard!67 9/1/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
  • 68. Consistent datafiles == consistent database Get the Most out of Oracle Data Guard!68 9/1/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
  • 69. Cloning solution based on Standby Database Get the Most out of Oracle Data Guard!69 9/1/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
  • 70. Cloning Steps Get the Most out of Oracle Data Guard!70 9/1/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’;
  • 71. Cloning Steps Get the Most out of Oracle Data Guard!71 9/1/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
  • 72. Get the Most out of Oracle Data Guard!72 9/1/2017 Live Demo?
  • 73. Get the Most out of Oracle Data Guard!73 9/1/2017 Let me do one more example
  • 74. Database reorganization live Get the Most out of Oracle Data Guard!74 9/1/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
  • 75. Get the Most out of Oracle Data Guard! Conclusions 9/1/201775
  • 76. BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH Questions in front of a beer! High Five POUG #POUG2017 Ludovico Caldara Oracle ACE Director Senior Consultant