Presentation - Oracle
Presentation - Oracle
Presentation - Oracle
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>Oracle</strong> Active Data Guard<br />
Database Rolling Maintenance<br />
Larry M. Carpenter<br />
Distinguished Product Manager - <strong>Oracle</strong><br />
Kalyan Kumar Kallepally<br />
Senior Database Administrator - Wellcome Trust Sanger Institute<br />
Joydip Kundu<br />
Director, Software Development - <strong>Oracle</strong><br />
1<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Agenda<br />
• A look at Rolling Upgrades today<br />
• A customer’s viewpoint<br />
• Simple Database Upgrades for the future<br />
• In Closing<br />
2<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Database Rolling Upgrades<br />
Database A<br />
Install new <strong>Oracle</strong> version in separate<br />
homes on A & B, set guaranteed PROD<br />
restore point (GRP) on A<br />
Temporarily convert B to use SQL<br />
Apply, upgrade and sync<br />
PROD<br />
synchronize<br />
synchronize<br />
My <strong>Oracle</strong> Support Note 949322.1<br />
Database B<br />
Physical<br />
STBY<br />
Logical<br />
STBY<br />
Switchover, flashback A to GRP,<br />
mount in new/upgraded home<br />
Physical<br />
STBY<br />
SWITCHOVER<br />
PROD<br />
release n<br />
release n+1<br />
Upgrade A via redo stream<br />
and synchronize<br />
Physical<br />
STBY<br />
synchronize<br />
PROD<br />
3 Copyright © 2011, <strong>Oracle</strong> and/or its affiliates. All rights reserved.
Agenda<br />
• A look at Rolling Upgrades today<br />
• A customer’s viewpoint<br />
• Simple Database Upgrades for the future<br />
• In Closing<br />
4<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Introducing<br />
Kalyan Kallepally<br />
Senior Database Administrator<br />
5<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Upgrade Databases With Minimal<br />
downtime<br />
<strong>Oracle</strong> Open World - 2012<br />
by<br />
Kalyan Kallepally<br />
Senior Database Administrator<br />
Wellcome Trust Sanger Institute<br />
Cambridge, UK<br />
kalyan.kallepally@sanger.ac.uk
Who am I<br />
• Working as Senior Database Administrator at<br />
– Wellcome Trust Sanger Institute<br />
• 10+ years of experience in <strong>Oracle</strong> (8-11gr2)<br />
• 5+ years of experience in MySQL, SQL Server<br />
• Recently started blogging<br />
– www.dbakalyan.wordpress.com<br />
– You can reach me on dba_kkk@yahoo.co.uk
Wellcome Trust Sanger Institute<br />
• One of the leading genomics centres in the world<br />
• Located in Hinxton, south of Cambridge, UK<br />
• Founded in 1993 by the Wellcome Trust and the UK Medical Research Council<br />
(MRC)<br />
• Primarily funded by the Wellcome Trust<br />
• The institute is named after Dr Fred Sanger – The double Nobel prize-winning<br />
biochemist<br />
• Responsible for the completion of 1/3 of the human genome
• Current computational<br />
capacity of 16k cores:<br />
– 12k cores on blade format<br />
– 4k cores in racked servers<br />
• Current usable storage<br />
capacity 16 Petabytes:<br />
– Estimated growth 3<br />
Petabytes/year<br />
• Data shared globally across<br />
the world with many<br />
scientific research institutes
• Primary database (300G)<br />
– ASM<br />
Database Layout<br />
– 2 Physical standbys (local and remote)<br />
• Local standby is within same site as of the primary<br />
but placed in a different quadrant of the datacentre<br />
• DR standby is 10 miles away from the Primary with<br />
dedicated private 10Gb/s WAN to DR datacentre
Upgrade Process<br />
• Upgraded database from 11.1.0.6 to 11.2.0.3<br />
using Transient Logical standby<br />
– Down time reduced by 98%<br />
• Upgrade process is split into 2 phases:<br />
– Phase 1 (Upgrade Primary Database)<br />
– Phase 2 (Upgrade Standbys & Switchback)
Phase - 1<br />
Upgrade Primary Database
Read Write Clients<br />
11.1.0.6<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Production<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.1.0.6<br />
Redo<br />
apply<br />
DR Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Redo Logs<br />
<strong>Oracle</strong> Home (11.1.0.6)
Upgrade Pre-requisites<br />
• Disable Data Guard Broker<br />
• Protection level must be either Maximum<br />
availability or Maximum performance<br />
• Ensure Flashback is enabled on all databases in<br />
the Data Guard configuration<br />
• Create guaranteed restore points<br />
• Parameter “compatible” must be set to same on<br />
all the databases
Read Write Clients<br />
11.1.0.6<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Primary<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
• Disable Broker<br />
• Enable Flashback<br />
• Create Guaranteed Restore points<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
DR Site<br />
Physical Standby<br />
Database<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)
Read Write Clients<br />
11.1.0.6<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Primary<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
• Convert the DR physical standby to<br />
Transient Logical Standby<br />
• Check if Logical standby is in sync<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
SQL<br />
apply<br />
Transform Redo to SQL<br />
DR Site<br />
Physical Logical Standby<br />
Database<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)
Read Write Clients<br />
11.1.0.6<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Primary<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
• Install new version of <strong>Oracle</strong><br />
database Software<br />
• Upgrade the LSTBY using DBUA from<br />
the new ORACLE HOME<br />
• After successful upgrade check if<br />
LSTBY is in sync again<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.1.0.6 11.2.0.3<br />
Redo Logs<br />
SQL<br />
apply<br />
Transform Redo to SQL<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
DR Site<br />
Logical Standby<br />
Database<br />
ASM
Read Write Clients<br />
11.1.0.6<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Primary<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
SQL<br />
apply<br />
Transform<br />
Redo to SQL<br />
• Plan for switch over to LSTBY<br />
• Stop the redo transmission to PSTBY<br />
• Up to this point absolutely there is no<br />
impact on the availability of the<br />
primary database.<br />
• Switch over<br />
• Re-point the clients, services<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.2.0.3<br />
Redo Logs<br />
Online<br />
Redo Logs<br />
SQL<br />
apply<br />
Transform Redo to SQL<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
DR Site<br />
Logical Standby<br />
Database<br />
ASM
Phase - 2<br />
Upgrade Standbys & Switch Back
Read Write Clients<br />
11.1.0.6<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Logical Standby<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
SQL<br />
apply<br />
Transform<br />
Redo to SQL<br />
• LSTBY (previous Primary) is in a<br />
Transient state<br />
• It is Running lower version than primary<br />
• Cannot understand/apply changes<br />
received from the higher version of<br />
primary database<br />
• Cannot provide disaster recovery<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.2.0.3<br />
Online<br />
Redo Logs<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
DR Site<br />
Primary<br />
Database<br />
ASM
Read Write Clients<br />
11.1.0.6<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Physical Logical Standby<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
Redo<br />
SQL<br />
apply<br />
apply<br />
Transform<br />
Redo to SQL<br />
• Flashback LSTBY to guaranteed restore<br />
point and shut down<br />
• Install new oracle version<br />
• Mount database from new home and<br />
convert LSTBY to PSTBY<br />
• When Redo Apply starts, it registers a new<br />
incarnation from the primary database<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.2.0.3<br />
Online<br />
Redo Logs<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
DR Site<br />
Primary<br />
Database<br />
ASM
Read Write Clients<br />
11.1.0.6 11.2.0.3<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Physical Standby<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6) (11.2.0.3)<br />
Redo<br />
apply<br />
Online Redo Logs<br />
Redo Logs<br />
• Wait for physical standby to be upgraded<br />
via the redo stream<br />
• At this point you have a second<br />
interruption to the database availability<br />
• Switch Back Primary to its Original<br />
location<br />
• Re-point the clients accordingly<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
11.2.0.3<br />
Redo Online Logs<br />
Redo Logs<br />
Redo<br />
apply<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
DR Site<br />
Primary<br />
Database<br />
ASM
Read Write Clients<br />
11.2.0.3<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Primary<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6) (11.2.0.3)<br />
Online<br />
Redo Logs<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
11.2.0.3<br />
• Install new database home on other<br />
Redo<br />
apply<br />
standbys<br />
Redo Logs<br />
• Mount PSTBY from new home<br />
• Flashback database to guaranteed<br />
restore point <strong>Oracle</strong> Home (11.2.0.3)<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
DR Site<br />
Physical Standby<br />
Database<br />
ASM
Read Write Clients<br />
11.2.0.3<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.1.0.6 11.2.0.3<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Primary<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6) (11.2.0.3)<br />
Online<br />
Redo Logs<br />
• Enable the redo transmission to<br />
local PSTBY to catch up to new<br />
incarnation<br />
• PSTBY will be upgraded via redo<br />
stream<br />
• Enable Broker<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
11.2.0.3<br />
Redo Logs<br />
Redo<br />
apply<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
DR Site<br />
Physical Standby<br />
Database<br />
ASM
Read Write Clients<br />
11.2.0.3<br />
Read Only Clients<br />
Sync or Async<br />
Redo shipping<br />
11.2.0.3<br />
Redo Logs<br />
Redo<br />
apply<br />
Local Site<br />
Physical Standby<br />
Database<br />
ASM<br />
Primary<br />
Database<br />
Backup<br />
ASM<br />
<strong>Oracle</strong> Home (11.1.0.6) (11.2.0.3)<br />
Online<br />
Redo Logs<br />
Broker<br />
Sync or Async<br />
Redo shipping<br />
<strong>Oracle</strong> Home (11.2.0.3) (11.1.0.6)<br />
11.2.0.3<br />
• Drop guaranteed restore points<br />
Redo<br />
apply<br />
• Rolling upgrade has Finished and<br />
Redo Logs<br />
databases are back in the original<br />
positions<br />
• With very minimal interruptions <strong>Oracle</strong> Home (11.2.0.3)<br />
<strong>Oracle</strong> Home (11.1.0.6)<br />
DR Site<br />
Physical Standby<br />
Database<br />
ASM
Pros & Cons<br />
Regular /Conventional Upgrade<br />
• Upgrade using DBUA/CLI<br />
(50mins)<br />
• Upgrade using datapump -<br />
Complete Down time required<br />
for exports, scp & imports<br />
(approx 3 hrs)<br />
– Manually recreate standbys<br />
after the upgrade<br />
• Errors at any stage can<br />
increase down time<br />
Rolling Upgrade using Transient LSTBY<br />
• Down time is required for only<br />
switchover (reduced by 98% -<br />
5mins)<br />
• Standbys are automatically<br />
upgraded<br />
• Fail safe options at each step<br />
• Down time is independent of<br />
database size
Caveats<br />
• Need to upgrade grid/ASM before the database upgrade<br />
• Need to manually update the OCR (srvctl) registries<br />
• If Upgrading from 11gR1 to 11gR2 then move the database<br />
spfile from $OH/dbs to ASM - if not, DBUA will fail<br />
• If the “compatible” parameter is changed after LSTBY upgrade<br />
- database cannot be rolled back<br />
• To change the “compatible” parameter after the upgrade<br />
- another downtime is needed
References<br />
• http://www.oracle.com/technetwork/database/features/availability/maawp-11g-transientlogicalrollingu-1-131927.pdf<br />
• http://www.oracle.com/technetwork/database/features/availability/maawp-11g-upgrades-made-easy-131972.pdf
Over to Larry<br />
Thank you
Just How Many Steps Is That?<br />
1. Disable the Broker configuration<br />
2. Stop the Broker at the Primary<br />
3. Stop the Broker at the Standbys<br />
4. Configure the Redo transport parameters<br />
on the target standby<br />
5. Configure the Redo transport parameters<br />
on bystander standbys<br />
6. Set the LOG_FILE_NAME_CONVERT<br />
parameter to clear logfiles<br />
7. Create a guaranteed restore point on the<br />
primary database<br />
8. Create a guaranteed restore point on the<br />
standby database<br />
9. Cancel Managed Recovery<br />
10. Execute DBMS_LOGSTDBY.BUILD at<br />
primary<br />
11. Convert the standby to a Transient<br />
Logical standby using KEEP IDENTITY<br />
12. Open the Transient Logical standby<br />
13. Start SQL Apply<br />
14. Turn off automatic archive log delete<br />
15. Synchronize<br />
30<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
But Wait! There’s More!<br />
16. Stop SQL Apply<br />
17. Create a 2 nd guaranteed restore point<br />
18. Stop Redo Transport<br />
19. Upgrade the Transient Logical standby<br />
20. Enable Redo Transport<br />
21. Restart SQL Apply<br />
22. Synchronize<br />
23. Start Switchover at Primary<br />
24. Complete Switchover at standby<br />
25. Open new Primary<br />
26. Stop redo transport<br />
27. Flashback the original Primary<br />
28. Mount original Primary in new home<br />
29. Convert it to a physical standby<br />
30. Shutdown<br />
31. Mount new Physical Standby<br />
32. Start Redo Apply<br />
33. Enable redo transport<br />
34. Synchronize<br />
35. Start switchover on new primary<br />
31<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
And finally<br />
36. Complete switchover at standby<br />
37. Open new Primary<br />
38. Restart old Primary as a standby<br />
39. Start Managed Recovery<br />
40. Drop 3 guaranteed restore points<br />
41. Enable the Broker Configuration<br />
32<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Agenda<br />
• A look at Rolling Upgrades today<br />
• A customer’s viewpoint<br />
• Simple Database Upgrades for the future<br />
• In Closing<br />
33<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
DBMS_ROLLING: Concepts<br />
• Rolling changes can be applied on the whole Data Guard configuration<br />
– Three stages (Specification – Compilation – Execution)<br />
– Execution has three stages: Start, Switchover, Finish<br />
• Two key groups<br />
– Leading Group<br />
• Changes are applied first (before Switchover)<br />
• Has a Master Database (the future primary database)<br />
– Trailing Group<br />
• Changes are applied last (after Switchover)<br />
• Has a Master Database (the original primary)<br />
34<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
DBMS_ROLLING: Concepts<br />
• Leading Group<br />
– Need to identify the Master Database (LGM) during Specification<br />
– LGM starts as a Physical Standby, converted into a Logical Standby<br />
(START), and then becomes the primary database (SWITCHOVER)<br />
– Other databases in the Leading Group protect the LGM<br />
– LGM responsibility transferrable on failure<br />
• Trailing Group<br />
– Contains the original primary database (Trailing Group Master)<br />
– Other databases in the Trailing Group protect the TGM<br />
– TGM responsibility transferrable on failure<br />
35<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Data Guard Simple Rolling Upgrades<br />
Simple, Reliable, Repeatable Database Rolling Upgrades<br />
Start Switchover Finish<br />
36<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Goal<br />
Simple, Reliable, Repeatable<br />
• Early problem detection<br />
• Dedicated interface: DBMS_ROLLING PL/SQL package<br />
• Centralized, simplified, and uniform execution<br />
• Fault tolerance<br />
• Configuration rollback<br />
• Centralized monitoring: DBA_ROLLING views<br />
37<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Upgrading The Database Software<br />
• The Data Guard Simple Rolling Upgrades procedure will<br />
be usable for database version upgrades starting with<br />
the first patchset of <strong>Oracle</strong> Database12c.<br />
– To upgrade from previous <strong>Oracle</strong> Database11g releases to<br />
<strong>Oracle</strong> Database12c and to move from the first release of <strong>Oracle</strong><br />
Database 12c to the first patchset you will need to use the<br />
classic Transient Logical Standby upgrade procedure.<br />
• The procedure can be used for other database<br />
maintenance tasks with the first release<br />
38<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
What Kind Of Changes Can Be Made?<br />
First Release Examples<br />
• Add Partitioning to Non-Partitioned Tables<br />
• Change Basicfile LOBs to Securefile LOBs<br />
• Change XML-CLOB to Binary XML<br />
• Alter table to be OLTP-compressed<br />
39<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
New Data Type Support<br />
Eliminating Barriers to Utilizing Database Rolling Upgrade<br />
• Advanced Data Type Support<br />
– XML OR<br />
– Binary XML<br />
– Securefile Deduplication<br />
– Objects/Collections (includes SDO_GEOMETRY, DICOM)<br />
– New Support for <strong>Oracle</strong>-Supplied Features<br />
• DBFS<br />
• AQ<br />
• <strong>Oracle</strong> Text<br />
• XDB<br />
40<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Process – Planning & Setup Phase<br />
• Generate an upgrade plan<br />
– Call DBMS_ROLLING.INIT_PLAN<br />
• Generates an upgrade plan with a configuration specific set of instructions to<br />
guide the administrator through the upgrade process<br />
– Call DBMS_ROLLING.SET_PARAMETER<br />
• Modify parameters of the rolling upgrade<br />
• Prepare your changes to the database<br />
41<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Process - Execution Phase<br />
• Call DBMS_ROLLING.START_PLAN<br />
– Configures primary and standby databases participating in the upgrade<br />
• Make changes to the standby database<br />
• Call DBMS_ROLLING.SWITCHOVER<br />
– Swaps roles between current primary and new primary with the changes, switchover is only<br />
downtime required<br />
• Call DBMS_ROLLING.FINISH_PLAN<br />
– Completes upgrade of the old primary and bystanders and resynchronizes with the new primary<br />
42<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Planning Phase<br />
Current Configuration<br />
• Primary database in Boston<br />
• Physical standby database in<br />
Cambridge (SYNC)<br />
• 2 nd Physical standby database in<br />
Chicago (ASYNC)<br />
• Broker Controlled<br />
DGMGRL> SHOW CONFIGURATION<br />
Configuration – OOW2012<br />
Protection Mode: MaxAvailability<br />
Databases:<br />
bos - Primary database<br />
cam - Physical standby database<br />
chi - Physical standby database<br />
Fast-Start Failover: DISABLED<br />
Configuration Status:<br />
SUCCESS<br />
DGMGRL><br />
43<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Planning Phase<br />
Start the Planning Process<br />
• Connect to the Primary<br />
• Execute the INIT_PLAN<br />
procedure<br />
• Sets up default parameters<br />
– 2 for each database<br />
– 25 general parameters<br />
SQL> exec dbms_rolling.init_plan(‘cam’);<br />
PL/SQL procedure successfully completed.<br />
SQL> select name, curval from<br />
2 dba_rolling_parameters where scope is null;<br />
NAME<br />
CURVAL<br />
------------------------ ------------------------<br />
ACTIVE_SESSIONS_TIMEOUT 3600<br />
ACTIVE_SESSIONS_WAIT 0<br />
BACKUP_CTLFILE<br />
rolling_change_backup.f<br />
DICTIONARY_LOAD_TIMEOUT 3600<br />
DICTIONARY_LOAD_WAIT 0<br />
EVENT_RECORDS 10000<br />
FAILOVER 0<br />
GRP_PREFIX<br />
DBMSRU_<br />
…<br />
UPDATED_TGS_WAIT 1<br />
25 rows selected.<br />
44<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Planning Phase<br />
Reconfigure Redo Transport<br />
• Create Redo Transport<br />
parameters at target database<br />
– In our example, on CAM to point<br />
to BOS and CHI<br />
• Required to complete the process<br />
after the switchover as the Broker<br />
is disabled.<br />
SQL> alter system set log_archive_dest_5='service="BOS",<br />
SYNC reopen=30 db_unique_name="BOS"<br />
valid_for=(PRIMARY_ROLE, ONLINE_LOGFILE)';<br />
System altered.<br />
SQL> alter system set log_archive_dest_6='service="CHI",<br />
ASYNC reopen=30 db_unique_name="CHI"<br />
valid_for=(PRIMARY_ROLE, ONLINE_LOGFILE)';<br />
System altered.<br />
SQL><br />
45<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Planning Phase<br />
Examining Parameters of the Plan<br />
• Example “INVOLVEMENT”<br />
• Each database protects the<br />
Primary when in the Standby role<br />
– BOS Primary<br />
• CAM and CHI protect BOS<br />
– CAM Primary<br />
• BOS and CHI protect CAM<br />
– CHI Primary<br />
• BOS and CAM protect CHI<br />
SQL> select scope, name, curval<br />
2 from dba_rolling_parameters<br />
3 where scope is not null order by scope;<br />
SCO NAME<br />
CURVAL<br />
--- --------------- ---------------<br />
bos INVOLVEMENT FULL<br />
bos PROTECTS NONE<br />
cam INVOLVEMENT FULL<br />
cam PROTECTS PRIMARY<br />
chi INVOLVEMENT FULL<br />
chi PROTECTS PRIMARY<br />
6 rows selected.<br />
SQL><br />
46<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Planning Phase<br />
Build the Plan when ready<br />
• Validates plan parameters<br />
• Creates an upgrade plan<br />
– Successful build required in order<br />
to perform a rolling upgrade<br />
• Parameter changes require that<br />
the procedure is called again<br />
• Complete plan can be reviewed in<br />
DBA_ROLLING_PLAN<br />
SQL> select revision, status, phase<br />
2 from dba_rolling_status;<br />
REVISION STATUS PHASE<br />
---------- ------------ --------------<br />
0 READY BUILD PENDING<br />
SQL> exec dbms_rolling.build_plan();<br />
PL/SQL procedure successfully completed.<br />
SQL> select revision, status, phase<br />
2 from dba_rolling_status;<br />
REVISION STATUS PHASE<br />
---------- ------------ --------------<br />
1 READY START PENDING<br />
47<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Start Phase<br />
Start the Process<br />
• Must be executed on the primary<br />
database<br />
– Formally starts the rolling upgrade<br />
operation.<br />
– When complete, the configuration<br />
possesses a fully configured<br />
transient logical standby<br />
database.<br />
• Still no outage<br />
SQL> exec dbms_rolling.start_plan();<br />
PL/SQL procedure successfully completed.<br />
SQL> select dbun, role, engine_status,<br />
2 update_progress from dba_rolling_databases;<br />
DBUN ROLE ENGINE_STATUS UPDATE_PROG<br />
---------- --------- -------------- -----------<br />
bos PRIMARY NOT APPLICABLE NOT STARTED<br />
cam LOGICAL RUNNING NOT STARTED<br />
chi PHYSICAL RUNNING NOT STARTED<br />
SQL> select revision, status, phase<br />
2 from dba_rolling_status;<br />
REVISION STATUS PHASE<br />
---------- ------------ --------------<br />
1 READY SWITCH PENDING<br />
48<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Start Phase<br />
Perform the changes<br />
• Make your changes to the database<br />
– For example, move a table from LOBs to Securefile LOBs<br />
• Stop SQL Apply<br />
• Make the changes to the Transient Logical Standby<br />
• Restart SQL Apply<br />
49<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Switchover Phase<br />
Switchover!<br />
• Prior to the switchover you can<br />
move read clients to the transient<br />
logical standby to avoid an outage<br />
• Update users will be stalled and<br />
eventually must reconnect to the<br />
new primary using standard client<br />
failover best practices.<br />
• Outage should be no more than<br />
90-120 seconds for the database<br />
SQL> exec dbms_rolling.switchover();<br />
PL/SQL procedure successfully completed.<br />
SQL> select dbun, role, engine_status,<br />
2 update_progress from dba_rolling_databases;<br />
DBUN ROLE ENGINE_STATUS UPDATE_PROG<br />
---------- --------- -------------- -----------<br />
bos LOGICAL STOPPED NOT STARTED<br />
cam PRIMARY NOT APPLICABLE NOT STARTED<br />
chi PHYSICAL STOPPED NOT STARTED<br />
SQL> select revision, status, phase<br />
2 from dba_rolling_status;<br />
REVISION STATUS PHASE<br />
---------- ------------ --------------<br />
1 READY FINISH PENDING<br />
50<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Finish Phase<br />
Finish the change<br />
• Manually restart and mount the all<br />
other databses<br />
• Execute the FINISH Procedure to<br />
finalize the rolling upgrade<br />
operation.<br />
– Configures the former primary as<br />
a physical standby, and configures<br />
remaining physical standbys to<br />
recover the change redo from the<br />
new primary.<br />
SQL> exec dbms_rolling.finish_plan();<br />
PL/SQL procedure successfully completed.<br />
SQL> select dbun, role, engine_status,<br />
2 update_progress from dba_rolling_databases;<br />
DBUN ROLE ENGINE_STATUS UPDATE_PROG<br />
---------- --------- -------------- -----------<br />
bos PHYSICAL RUNNING FINISHED<br />
cam PRIMARY NOT APPLICABLE FINISHED<br />
chi PHYSICAL RUNNING FINISHED<br />
SQL> select revision, status, phase<br />
2 from dba_rolling_status;<br />
REVISION STATUS PHASE<br />
---------- ------------ --------------<br />
1 READY DONE<br />
51<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
A Sample Walkthrough - Finish Phase<br />
Re-enable the Broker and switchover<br />
• Enable the Broker<br />
– It reconfigures itself to the new<br />
Primary database ‘CAM’.<br />
• Execute a Broker switchover<br />
– If required to return to the original<br />
configuration.<br />
DGMGRL> enable configuration;<br />
Enabled.<br />
DGMGRL> show configuration<br />
Configuration – OOW2012<br />
Protection Mode: MaxAvailability<br />
Databases:<br />
cam - Primary database<br />
bos - Physical standby database<br />
chi - Physical standby database<br />
Fast-Start Failover: DISABLED<br />
Configuration Status:<br />
SUCCESS<br />
DGMGRL> switchover to bos;<br />
Performing switchover NOW, please wait...<br />
…<br />
Switchover succeeded, new primary is "bos"<br />
52<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Agenda<br />
• A look at Rolling Upgrades today<br />
• A customer’s viewpoint<br />
• Simple Database Upgrades for the future<br />
• In Closing<br />
53<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
DBMS_ROLLING: Key Features<br />
• Specify – Compile – Execute Protocol<br />
– Catch configuration errors at Compilation step<br />
– Run-time errors are detected during Execution<br />
• State is kept in the database<br />
– Provides robustness<br />
• Run-time steps are constant<br />
– Regardless of how many databases are involved<br />
• Handles failure at the original primary database<br />
• Allows Data Protection for the upgraded primary right from the start<br />
54<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Behind the Scenes<br />
Current Structure<br />
New Structure<br />
Sets guaranteed restore point<br />
(GRP) on A and B<br />
Database A<br />
PROD<br />
Synchronize – redo apply<br />
Database B<br />
Physical<br />
STBY<br />
Converts B to transient logical<br />
PROD<br />
Synchronize – sql apply<br />
Logical<br />
STBY<br />
Switchover<br />
Physical<br />
STBY<br />
SWITCHOVER<br />
PROD<br />
Flashback A to GRP, upgrade<br />
via redo stream<br />
Physical<br />
STBY<br />
Synchronize – redo apply<br />
PROD<br />
55<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Now How Many Steps?<br />
• Prepare for maintenance<br />
– Disable the Broker, INIT_PLAN, BUILD_PLAN, Configure Redo transport<br />
• START_PLAN<br />
• Perform Maintenance<br />
• SWITCHOVER<br />
• Mount original Primary<br />
• FINISH_PLAN<br />
– Enable the Broker, Switchover<br />
56<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.
Resources<br />
• OTN HA Portal:<br />
http://www.oracle.com/goto/availability<br />
• Maximum Availability Architecture (MAA):<br />
http://www.oracle.com/goto/maa<br />
• MAA Blogs:<br />
http://blogs.oracle.com/maa<br />
• Exadata on OTN:<br />
http://www.oracle.com/technetwork/database/exadata/index.html<br />
• <strong>Oracle</strong> HA Customer Success Stories on OTN:<br />
http://www.oracle.com/technetwork/database/features/ha-casestudies-<br />
098033.html
Graphic Section Divider<br />
58<br />
Copyright © 2012, <strong>Oracle</strong> and/or its affiliates. All rights reserved<br />
Confidential – <strong>Oracle</strong> Restricted.