You are on page 1of 36

The following is intended to outline our general product

direction. It is intended for information purposes only, and may


not be incorporated into any contract. It is not a commitment to
deliver any material, code, or functionality, and should not be
relied upon in making purchasing decisions. The development,
release, and timing of any features or functionality described
for Oracle's products remains at the sole discretion of Oracle.
Release timing for Oracle Database 12c is planned for
Calendar Year 2013.

1Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Oracle Data Guard ZeroDowntime Database


Maintenance
Sally Piao
Vice President
Database and Exadata System Test

2Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Agenda
A look at Rolling Upgrades today
A customers viewpoint
Simple Database Upgrades for the future
In Closing

3Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Database Rolling Upgrades

My Oracle Support Note 949322.1

Database A

Database B

Install new Oracle version in separate


homes on A & B, set guaranteed
restore point (GRP) on A

PROD

Temporarily convert B to use SQL


Apply, upgrade and sync

PROD

synchronize

Logical
STBY

Switchover, flashback A to GRP,


mount in new/upgraded home

Physical
STBY

SWITCHOVER

PROD

Upgrade A via redo stream


and synchronize
release n

Physical
STBY

synchronize

PROD

release n+1
4

Copyright 2011, Oracle and/or its affiliates. All rights reserved.

synchronize

Physical
STBY

Agenda
A look at Rolling Upgrades today
A customers viewpoint
Simple Database Upgrades for the future
In Closing

5Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Just How Many Steps Is That?


1.

Disable the Broker configuration

2.

Stop the Broker at the Primary

3.

Stop the Broker at the Standbys

8.

Create a guaranteed restore point on the


standby database

9.

Cancel Managed Recovery

Configure the Redo transport parameters 10. Execute DBMS_LOGSTDBY.BUILD at


primary
on the target standby
5. Configure the Redo transport parameters 11. Convert the standby to a Transient
Logical standby using KEEP IDENTITY
on bystander standbys
4.

6.
7.

Set the LOG_FILE_NAME_CONVERT


parameter to clear logfiles

12. Open the Transient Logical standby


13. Start SQL Apply

Create a guaranteed restore point on the 14. Turn off automatic archive log delete
primary database
15. Synchronize

6Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

But Wait! Theres More!


16. Stop SQL Apply

26. Stop redo transport

17. Create a 2nd guaranteed restore point

27. Flashback the original Primary

18. Stop Redo Transport

28. Mount original Primary in new home

19. Upgrade the Transient Logical standby

29. Convert it to a physical standby

20. Enable Redo Transport

30. Shutdown

21. Restart SQL Apply

31. Mount new Physical Standby

22. Synchronize

32. Start Redo Apply

23. Start Switchover at Primary

33. Enable redo transport

24. Complete Switchover at standby

34. Synchronize

25. Open new Primary

35. Start switchover on new primary

7Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

And finally
36. Complete switchover at standby
37. Open new Primary
38. Restart old Primary as a standby
39. Start Managed Recovery
40. Drop 3 guaranteed restore points
41. Enable the Broker Configuration

8Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Agenda
A look at Rolling Upgrades today
A customers viewpoint
Simple Database Upgrades for the future
In Closing

9Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

DBMS_ROLLING: Concepts
Rolling changes can be applied on the whole Data Guard configuration
Three stages (Specification Compilation Execution)
Execution has three stages: Start, Switchover, Finish

Two key groups


Leading Group
Changes are applied first (before Switchover)
Has a Master Database (the future primary database)
Trailing Group
Changes are applied last (after Switchover)
Has a Master Database (the original primary)
10Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

DBMS_ROLLING: Concepts
Leading Group
Need to identify the Master Database (LGM) during Specification
LGM starts as a Physical Standby, converted into a Logical Standby

(START), and then becomes the primary database (SWITCHOVER)


Other databases in the Leading Group protect the LGM
LGM responsibility transferrable on failure

Trailing Group
Contains the original primary database (Trailing Group Master)
Other databases in the Trailing Group protect the TGM
TGM responsibility transferrable on failure
11Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Data Guard Simple Rolling Upgrades

Simple, Reliable, Repeatable Database Rolling Upgrades

Start
12Copyright 2012, Oracle and/or its affiliates. All rights reserved

Switchover
Confidential Oracle Restricted.

Finish

Goal

Simple, Reliable, Repeatable


Early problem detection
Dedicated interface: DBMS_ROLLING PL/SQL package
Centralized, simplified, and uniform execution
Fault tolerance
Configuration rollback
Centralized monitoring: DBA_ROLLING views

13Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Upgrading The Database Software


The Data Guard Simple Rolling Upgrades procedure will

be usable for database version upgrades starting with


the first patchset of Oracle Database12c.
To upgrade from previous Oracle Database11g releases to

Oracle Database12c and to move from the first release of


Oracle Database 12c to the first patchset you will need to use
the classic Transient Logical Standby upgrade procedure.

The procedure can be used for other database

maintenance tasks with the first release


14Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

What Kind Of Changes Can Be Made?


First Release Examples

Add Partitioning to Non-Partitioned Tables


Change Basicfile LOBs to Securefile LOBs
Change XML-CLOB to Binary XML
Alter table to be OLTP-compressed

15Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

New Data Type Support

Eliminating Barriers to Utilizing Database Rolling Upgrade


Advanced Data Type Support
XML OR
Binary XML
Securefile Deduplication
Objects/Collections (includes SDO_GEOMETRY, DICOM)
New Support for Oracle-Supplied Features
DBFS
AQ
Oracle Text
XDB
16Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Process Planning & Setup Phase


Generate an upgrade plan
Call DBMS_ROLLING.INIT_PLAN
Generates an upgrade plan with a configuration specific set of instructions to

guide the administrator through the upgrade process


Call DBMS_ROLLING.SET_PARAMETER
Modify parameters of the rolling upgrade

Prepare your changes to the database

17Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Process - Execution Phase


Call DBMS_ROLLING.START_PLAN
Configures primary and standby databases participating in the upgrade

Make changes to the standby database


Call DBMS_ROLLING.SWITCHOVER
Swaps roles between current primary and new primary with the changes, switchover is only

downtime required

Call DBMS_ROLLING.FINISH_PLAN
Completes upgrade of the old primary and bystanders and resynchronizes with the new primary

18Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

A Sample Walkthrough - Planning Phase


Current Configuration

Primary database in Boston


Physical standby database in

Cambridge (SYNC)
2nd Physical standby database in
Chicago (ASYNC)
Broker Controlled

DGMGRL> SHOW CONFIGURATION


Configuration OOW2012
Protection Mode: MaxAvailability
Databases:
bos - Primary database
cam - Physical standby database
chi - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL>

19Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

A Sample Walkthrough - Planning Phase


Start the Planning Process
Connect to the Primary
Execute the INIT_PLAN

procedure
Sets up default parameters
2 for each database
25 general parameters

SQL> exec dbms_rolling.init_plan(cam);


PL/SQL procedure successfully completed.
SQL> select name, curval from
2 dba_rolling_parameters where scope is null;
NAME
-----------------------ACTIVE_SESSIONS_TIMEOUT
ACTIVE_SESSIONS_WAIT
BACKUP_CTLFILE
DICTIONARY_LOAD_TIMEOUT
DICTIONARY_LOAD_WAIT
EVENT_RECORDS
FAILOVER
GRP_PREFIX

UPDATED_TGS_WAIT
25 rows selected.

20Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

CURVAL
-----------------------3600
0
rolling_change_backup.f
3600
0
10000
0
DBMSRU_
1

A Sample Walkthrough - Planning Phase


Reconfigure Redo Transport
Create Redo Transport

parameters at target database


In our example, on CAM to point

to BOS and CHI


Required to complete the process

after the switchover as the Broker


is disabled.

21Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

SQL> alter system set log_archive_dest_5='service="BOS",


SYNC reopen=30 db_unique_name="BOS"
valid_for=(PRIMARY_ROLE, ONLINE_LOGFILE)';
System altered.
SQL> alter system set log_archive_dest_6='service="CHI",
ASYNC reopen=30 db_unique_name="CHI"
valid_for=(PRIMARY_ROLE, ONLINE_LOGFILE)';
System altered.
SQL>

A Sample Walkthrough - Planning Phase


Examining Parameters of the Plan
Example INVOLVEMENT
Each database protects the

Primary when in the Standby role


BOS Primary
CAM and CHI protect BOS
CAM Primary

SCO
--bos
bos
cam
cam
chi
chi

NAME
--------------INVOLVEMENT
PROTECTS
INVOLVEMENT
PROTECTS
INVOLVEMENT
PROTECTS

6 rows selected.

BOS and CHI protect CAM


CHI Primary
BOS and CAM protect CHI
22Copyright 2012, Oracle and/or its affiliates. All rights reserved

SQL> select scope, name, curval


2 from dba_rolling_parameters
3 where scope is not null order by scope;

Confidential Oracle Restricted.

SQL>

CURVAL
--------------FULL
NONE
FULL
PRIMARY
FULL
PRIMARY

A Sample Walkthrough - Planning Phase


Build the Plan when ready

Validates plan parameters


Creates an upgrade plan
Successful build required in order

to perform a rolling upgrade


Parameter changes require that

the procedure is called again


Complete plan can be reviewed in
DBA_ROLLING_PLAN

23Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

SQL> select revision, status, phase


2 from dba_rolling_status;
REVISION STATUS
PHASE
---------- ------------ -------------0 READY
BUILD PENDING
SQL> exec dbms_rolling.build_plan();
PL/SQL procedure successfully completed.
SQL> select revision, status, phase
2 from dba_rolling_status;
REVISION STATUS
PHASE
---------- ------------ -------------1 READY
START PENDING

A Sample Walkthrough - Start Phase


Start the Process

Must be executed on the primary

database

PL/SQL procedure successfully completed.

Formally starts the rolling upgrade

operation.
When complete, the configuration

possesses a fully configured


transient logical standby
database.
Still no outage

24Copyright 2012, Oracle and/or its affiliates. All rights reserved

SQL> exec dbms_rolling.start_plan();

Confidential Oracle Restricted.

SQL> select dbun, role, engine_status,


2 update_progress from dba_rolling_databases;
DBUN
---------bos
cam
chi

ROLE
--------PRIMARY
LOGICAL
PHYSICAL

ENGINE_STATUS
-------------NOT APPLICABLE
RUNNING
RUNNING

UPDATE_PROG
----------NOT STARTED
NOT STARTED
NOT STARTED

SQL> select revision, status, phase


2 from dba_rolling_status;
REVISION STATUS
PHASE
---------- ------------ -------------1 READY
SWITCH PENDING

A Sample Walkthrough - Start Phase


Perform the changes

Make your changes to the database


For example, move a table from LOBs to Securefile LOBs
Stop SQL Apply
Make the changes to the Transient Logical Standby
Restart SQL Apply

25Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

A Sample Walkthrough - Switchover Phase


Switchover!

Prior to the switchover you can

SQL> exec dbms_rolling.switchover();

move read clients to the transient


logical standby to avoid an outage
Update users will be stalled and
eventually must reconnect to the
new primary using standard client
failover best practices.
Outage should be no more than
90-120 seconds for the database

PL/SQL procedure successfully completed.

26Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

SQL> select dbun, role, engine_status,


2 update_progress from dba_rolling_databases;
DBUN
---------bos
cam
chi

ROLE
--------LOGICAL
PRIMARY
PHYSICAL

ENGINE_STATUS
-------------STOPPED
NOT APPLICABLE
STOPPED

UPDATE_PROG
----------NOT STARTED
NOT STARTED
NOT STARTED

SQL> select revision, status, phase


2 from dba_rolling_status;
REVISION STATUS
PHASE
---------- ------------ -------------1 READY
FINISH PENDING

A Sample Walkthrough - Finish Phase


Finish the change

Manually restart and mount the all

SQL> exec dbms_rolling.finish_plan();

other databses
Execute the FINISH Procedure to
finalize the rolling upgrade
operation.

PL/SQL procedure successfully completed.

Configures the former primary as

a physical standby, and configures


remaining physical standbys to
recover the change redo from the
new primary.
27Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

SQL> select dbun, role, engine_status,


2 update_progress from dba_rolling_databases;
DBUN
---------bos
cam
chi

ROLE
--------PHYSICAL
PRIMARY
PHYSICAL

ENGINE_STATUS
-------------RUNNING
NOT APPLICABLE
RUNNING

UPDATE_PROG
----------FINISHED
FINISHED
FINISHED

SQL> select revision, status, phase


2 from dba_rolling_status;
REVISION STATUS
PHASE
---------- ------------ -------------1 READY
DONE

A Sample Walkthrough - Finish Phase


Re-enable the Broker and switchover
Enable the Broker
It reconfigures itself to the new

Primary database CAM.


Execute a Broker switchover
If required to return to the original

configuration.

DGMGRL> enable configuration;


Enabled.
DGMGRL> show configuration
Configuration OOW2012
Protection Mode: MaxAvailability
Databases:
cam - Primary database
bos - Physical standby database
chi - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
DGMGRL> switchover to bos;
Performing switchover NOW, please wait...

Switchover succeeded, new primary is "bos"

28Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Agenda
A look at Rolling Upgrades today
A customers viewpoint
Simple Database Upgrades for the future
In Closing

29Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

DBMS_ROLLING: Key Features


Specify Compile Execute Protocol
Catch configuration errors at Compilation step
Run-time errors are detected during Execution

State is kept in the database


Provides robustness

Run-time steps are constant


Regardless of how many databases are involved

Handles failure at the original primary database


Allows Data Protection for the upgraded primary right from the start
30Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Current Structure
New Structure

Behind the Scenes


Database A

Database B

Sets guaranteed restore point


(GRP) on A and B

PROD

Synchronize redo apply

Converts B to transient logical

PROD

Synchronize sql apply

Switchover

Physical
STBY

Flashback A to GRP, upgrade


via redo stream

Physical
STBY

31Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Physical
STBY
Logical
STBY

SWITCHOVER

PROD

Synchronize redo apply

PROD

Now How Many Steps?


Prepare for maintenance
Disable the Broker, INIT_PLAN, BUILD_PLAN, Configure Redo transport

START_PLAN
Perform Maintenance
SWITCHOVER
Mount original Primary
FINISH_PLAN
Enable the Broker, Switchover

32Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

Resources
OTN HA Portal:
http://www.oracle.com/goto/availability
Maximum Availability Architecture (MAA):
http://www.oracle.com/goto/maa
MAA Blogs:
http://blogs.oracle.com/maa
Exadata on OTN:
http://www.oracle.com/technetwork/database/exadata/index.html
Oracle HA Customer Success Stories on OTN:
http://www.oracle.com/technetwork/database/features/ha-casestudies098033.html

Graphic Section Divider

34Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

35Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

The preceding is intended to outline our general product


direction. It is intended for information purposes only, and may
not be incorporated into any contract. It is not a commitment to
deliver any material, code, or functionality, and should not be
relied upon in making purchasing decisions. The development,
release, and timing of any features or functionality described for
Oracle's products remains at the sole discretion of Oracle.
Release timing for Oracle Database 12c is planned for Calendar
Year 2013.

36Copyright 2012, Oracle and/or its affiliates. All rights reserved

Confidential Oracle Restricted.

You might also like