You are on page 1of 52

Upcoming: Advisor Webcast: DataGuard 12c 新特性

Upcoming Advisor Webcast Schedule

• Check out Note ID : 740966.1

• Select your Product Area

• Scan through the list of Current Topics

• Register for the session of your interest

Upcoming: Advisor Webcast: DataGuard 12c 新特性


Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 2
ATTENTION – AUDIO Options
Option 1: Voice Streaming Audio Broadcast Option 2: Teleconference (Dial In)
• No need to dial in on a telephone • Requires telephone to dial in
• Questions can be asked in the WebEx Q&A panel • Questions can be asked over the phone or in the
WebEx Chat
• Details
– Conference ID: “6755827”
– International dial in: +44 (0) 1452 562 665
– China Free call: 108007441329
– China Free call: 108004411182
– Taiwan Free call: 00801044259
– Hong Hong Free call: 800966155
– View anytime during the conference using
Communicate > Teleconference > Join
Teleconference from your WebEx menu

Upcoming: Advisor Webcast: DataGuard 12c 新特性


Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 3
Oracle Advisor Webcast
DataGuard 12c 新特性
James Zhang
Senior Technical Support Engineer

May 21, 2015

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 4


Safe Harbor Statement
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.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 5


Oracle Advisor Webcast

DataGuard 12c 新特性


James Zhang
Senior Technical Support Engineer

May 21, 2015

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Agenda
1 Far Sync Instance
2 Fast Sync Instance
3 Real-Time Cascading
4 Active Data guard
-Global Temporary Tables
- Sequences
5 Database Rolling Upgrade
6
Switchover and Failover
7 Dataguard Broker

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 7


Far Sync Instance Definition

• Consists of
• Far sync control file.
• Password file and pfile.
• Standby Redo log files and
• Archive logs.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Far Sync Instance

Primary Far SYNC Standby


Instance
Online REDO logs

Commit ACK
C
o
m
m SGA
i
t LGWR
SGA
Redo
Buffer
NSS RFS MRP

Standby REDO ASYNC


SYNC
logs

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Far Sync Instance – Creation Steps

• Create Control file.

SQL>alter database create far sync instance controlfile as '<location>';


RMAN>alter database create far sync instance controlfile as ‘<location>’;

• Copy pfile and control file and password-file from primary.


• Create Standby Redo Logs
• Validate the configuration

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Far Sync Standby – Creation Steps
• Example pfile changes for Dataguard

Primary Database – prim


DB_UNIQUE_NAME=prim
CONTROL_FILES='/arch1/prim/control01.ctl'
FAL_SERVER=standby
LOG_ARCHIVE_CONFIG='DG_CONFIG=(prim,farprim,stdby)'
LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=chicago'
LOG_ARCHIVE_DEST_2='SERVICE=farprim SYNC AFFIRM
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=farprim'

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Far Sync Standby – Creation Steps(cont..)

Far Sync Instance – farprim

'
DB_UNIQUE_NAME=farprim
CONTROL_FILES='/arch2/farprim/control01.ctl'
FAL_SERVER=prim
LOG_FILE_NAME_CONVERT='prim','farprim'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(prim,farprim,stdby)
LOG_ARCHIVE_DEST_1='LOCATION= USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=farprim'
LOG_ARCHIVE_DEST_2='SERVICE=stdby ASYNC
VALID_FOR=(STANDBY_LOGFILES,STANDBY_ROLE) DB_UNIQUE_NAME=stdby'

Copyright © 2015 Oracle


© 2012 and/or
OracleitsCorporation
affiliates. All rights reserved.
– Proprietary |
and Confidential
Far Sync Standby – Creation Steps(cont..)

Standby - stdby

DB_UNIQUE_NAME=stdby
CONTROL_FILES='/home/oracle/stdby/controlfile/control01.ctl
FAL_SERVER='farprim'
LOG_ARCHIVE_CONFIG='DG_CONFIG=(prim,farprim,stdby)'
LOG_FILE_NAME_CONVERT='prim','stdby'
DB_FILE_NAME_CONVERT='prim','stdby'
LOG_ARCHIVE_DEST_1='LOCATION= USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=stdby'
LOG_ARCHIVE_DEST_2='SERVICE=prim ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=prim'

Copyright © 2015 Oracle


© 2012 and/or
OracleitsCorporation
affiliates. All rights reserved.
– Proprietary |
and Confidential
Far Sync Standby – Creation Steps

• Validate the configuration,


SQL>select database_role from v$database;
DATABASE_ROLE
----------------
FAR SYNC STANDBY

prim> select db_unique_name,parent_dbun,dest_role,current_scn from


v$dataguard_config;
DB_UNIQUE_NAME PARENT_DBUN DEST_ROLE CURRENT_SCN
-------------- ------------ ------------------ --------------
prim NONE PRIMARY DATABASE 2158447
farprim prim FAR SYNC INSTANCE 2157650
stdby farprim PHYSICAL STANDBY 2157650

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Conti….
• No Data files.
• RMAN deletion policies are applicable.
• REDO compression is supported.
• Redo Transport commands are same.
• Requires ADG License.
• It can operate in either maximum performance or maximum availability
Protection modes.
• Switchover commands are same

Copyright © 2015 Oracle


© 2012 and/or
OracleitsCorporation
affiliates. All rights reserved.
– Proprietary |
and Confidential
Demonstration

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 16


Fast Sync Instance
Fast Sync with REDO transport mode SYNC NOAFFIRM with MAX_AVAILABILITY

Primary Fast SYNC Standby


Instance
Online REDO logs

Commit ACK
C
o
m
m SGA
i
t LGWR
SGA
Redo
Buffer
NSS RFS MRP

Standby REDO ASYNC


SYNC
logs

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


REDO Apply Enhancements

• Default Standby recovery in REAL time apply.


.
SQL>alter database recover managed standby database disconnect;

• To Start MRP in non real time apply mode use,

SQL>alter database recover managed standby database using archived logfile disconnect;

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Cascading Standby

• 11G
• Redo Apply upon primary log switch.
• Cascading standby always lag behind first standby.

SYNC/ASYNC ARCH

Primary Standby1 Standby2

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Real Time Cascading Standby

• 12c
• First Standby can ship REDO in real time mode.
• No need to wait for primary database log switch.

SYNC/ASYNC ASYNC

Primary Standby1 Standby2

Copyright © 2015 Oracle


© 2012 and/or
OracleitsCorporation
affiliates. All rights reserved.
– Proprietary |
and Confidential
Real Time Cascading Standby(Cont..)

• Only Physical Standby databases can cascade REDO.


• Requires ADG license.
• Non-real time cascading supported only in log_archive_dest 1 to 10, Real-time
cascading is supported on all destinations.
• DG broker supports Real time cascading.

Copyright © 2015 Oracle


© 2012 and/or
OracleitsCorporation
affiliates. All rights reserved.
– Proprietary |
and Confidential
Active Dataguard – Global TEMP tables

• Allows DML on Global TEMP tables.


• Temp UNDO stored in TEMP tablespace itself.
• Not applicable for temp CLOB and temp BLOB.
• Read mostly applications uses Global Temp tables for sorting can be offloaded on
ADG.
• For a standby database, TEMP_UNDO_ENABLED is ignored because temporary undo
is enabled by default on the standby database.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Active Dataguard – Sequences

• Sequence with CACHE,NOORDER can be access from ADG.


• Primary maintains UNIQUE stream of sequences across all standby.
• Session level –sequence
SQL>create sequence…session;

• To improve the speed of READ only applications.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Rolling Upgrade

• DBMS_ROLLING - Integrated PL/SQL Package for rolling upgrade.


• DBMS_ROLLING.INIT_PLAN - To initialize upgrade
• DBMS_ROLLING.SET_PARAMETER – To adjust parameter
• DBMS_ROLLING.BUILD_PLAN - To build upgrade plan
• DBMS_ROLLING.START_PLAN - To execute the build plan
• DBMS_ROLLING.SWITCHOVER - To do switchover after the
upgrade on standby.
• DBMS_ROLLING.FINISH_PLAN – final step.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Useful views

DBA_ROLLING_STATUS
DBA_ROLLING_DATABASES
DBA_ROLLING_STATISTICS
DBA_ROLLING_PARAMETER
DBA_ROLLING_EVENTS

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Switchover

• Prerequisites
• Check whether standby in SYNC with primary or not.

primary
SQL>select max(sequence#),thread# from v$archived_log group by thread#;
Standby,
SQL>select process,sequence#,thread#,status from v$managed_standby;

• Check for Online Redo Logs on standby.


• Tempfile on standby.
• Check Standby Redo Logs on primary.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Switchover

• Verify switchover

SQL>alter database switchover to stdby verify;

• Issue switchover from primary,

SQL>alter database switchover to stdby;

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Switchover

Post Switchover checks

primary
SQL>select max(sequence#),thread# from v$archived_log group by thread#;
Standby,
SQL>select process,sequence#,thread#,status from v$managed_standby;

Create Far sync instance if need.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Demonstration

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 29


Failover
• Failover,

SQL>alter database failover to <target_db_name>;

• Use Force option,

SQL>alter database failover to <target_db_name> force;

• ACTIVATE if nothing works.

SQL>alter database activate physical standby database;

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Dataguard Broker – 12c New Features

• Validate Database.
• Apply lag monitoring.
• Support for new Features
• Far SYNC instance.
• Fast SYNC instance.
• Real time cascading.
• Database rolling upgrade.
• Configurable tracing.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Dataguard Broker - Validate
DGMGRL>validate database [verbose] database_name;
Example,
DGMGRL> validate database stdby
Command performs same operation like verify configuration from GRID.
Database Role: Physical standby database
Primary Database: prim
Ready for Switchover: Yes
Ready for Failover: Yes (Primary Running)
Flashback Database Status:
prim: On
stdby: On
Future Log File Groups Configuration:
Thread # Online Redo Log Groups Standby Redo Log Groups
(prim) (stdby)
1 4 4

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Dataguard Broker – Validate Verbose

• Temporary Tablespace.
• Flashback database.
• Apply Related Metrics
• Apply Lag
• Apply Delay
• Apply Rate
• Transport Metrics
• Transport on
• Gap Status
• Transport Lag
• Transport Status
• Automatic Diagnostic Repository Errors
Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |
Apply Lag

DGMGRL>edit database <name> set property applylagthreshold=15;

NOTE:
Applylagthreshold in seconds.
Not Applicable for Snapshot database and Far/Fast SYNC Instances.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Apply Lag
1. Set 'applylagthreshold
DGMGRL> edit database 'stdby' set property 'applylagthreshold'=15;

2. Check apply lag info


DGMGRL> SHOW DATABASE 'stdby';
…..
Apply Lag: 2 minutes 42 seconds (computed 1 second ago)
Average Apply Rate: 2.00 KByte/s
Real Time Query: OFF
Instance(s):
stdby

Database Error(s):
ORA-16766: Redo Apply is stopped

Database Warning(s):
ORA-16853: apply lag has exceeded specified threshold

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


DG Broker- Far SYNC Standby
• Dataguard Broker Supports Far/Fast SYNC Standby.

DGMGRL>add far_sync <db_unique_name> as connect identifier is <connect


string>;
DGMGRL>enable far_sync <db_unique_name>;

• FSFO supports Far sync standby.


• To Edit the far sync instance property,

DGMGRL>EDIT FAR_SYNC far_sync_instance_name SET/RESET PROPERTY property-name;

Copyright © 2015 Oracle


© 2012 and/or
OracleitsCorporation
affiliates. All rights reserved.
– Proprietary |
and Confidential
DG Broker- Far SYNC Standby(cont..)

DGMGRL> SHOW CONFIGURATION;


Configuration – dgconfig
Protection Mode: MaxPerformance
Databases:
Prim - Primary database
Farprim - Far Sync
stdby - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Fast SYNC Standby

DGMGRL>edit database <name> set property Logxptmode = ‘FastSync’;

Configures REDO transport with SYNC NOAFFIRM

This mode is only available in maximum availability protection mode.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


RedoRoutes

• Route REDO to Primary -> Far SYNC -> standby


or
• Primary -> standby1 -> standby2
• It contains Redo source and redo destination like,
(redo source : redo destination)
• ASYNC/SYNC/FAST SYNC Redo transport.
• Logical standby and snapshot standby are not supported.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


RedoRoutes

• RedoRoutes example
• Real time cascading

• DGMGRL> EDIT DATABASE '<primary>' SET PROPERTY 'RedoRoutes' = '(LOCAL : <Standby1>)';


• DGMGRL> EDIT DATABASE '<standby1>' SET PROPERTY 'RedoRoutes' = '(<primary> : <standby2> ASYNC)';

• Far sync instance ,

DGMGRL> EDIT DATABASE '<primary>' SET PROPERTY 'RedoRoutes' = '(LOCAL : <Far SYNC>)';
DGMGRL>EDIT FAR_SYNC '<far sync name>' SET PROPERTY 'RedoRoutes' = '(<primary> : <remote standby>)';

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


DG Broker - Tracing

DGMGRL>edit configuration set property TraceLevel =[user/support];

• User : Basic level tracing.


• Support : Full Diagnostic output.
• Feature available from 11.2.0.3 onwards.

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Top Articles and Community Links
Doc ID 1570958.1
Doc ID 1578787.1
Doc ID 1582837.1
Doc ID 1591518.1
Doc ID 1591492.1
Doc ID 1583588.1

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 42


Summary
What we covered today
• FAR SYNC/FAST SYNC instances
• Real time Cascading
• Upgrade using DBMS_ROLLING
• Simplified switchover/Failover
• Dg Broker
• Validate configuration
• Apply lag monitoring

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 43


Q&A
• To ask a question on the phone
line, select *1 on your phone.
• To ask a question online, use the
Q&A area at the top.
• Your question will be read aloud in
the order received.
• Question can also be asked on the
My Oracle Support Communities

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 44


Question and Answer Instructions

Q&A panel

3
Send your question
2
Ask: ALL PANELLIST leave default!

1
type your question here

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. |


Oracle Advisor Webcast Program
Locating Current Schedule & Archived Recordings

• From Note ID : 740966.1 drill


down to your area of interest

• Select your Product Area

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 46


Oracle Advisor Webcast Program
Locating Current Schedule & Archived Recordings

Note:
• Click column headings to sort
• Hover on Webcast Title for more
information
• Recordings available within 48 hours
• Advisor Webcast Questions on a
webcast or ask questions via the
Questions? link

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 47


Learn More
Available References and Resources to Get Proactive

• My Oracle Support Essentials Webcast Series


https://support. oracle.com | Doc ID: 553747.1

• My Oracle Support Blog


https://blogs.oracle.com/supportportal/

• Get Proactive in My Oracle Support


https://support. oracle.com | Doc ID: 432.1

• Ask the Get Proactive Team


get-proactive_ww@oracle.com

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 48


Accessing My Oracle Support Community
1. Via My Oracle Support -> Community Tab 2. Directly – https://communities.oracle.com

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 49


Where Can I Get Slides and Recording From This Session?
1. PDF link and recording link from Doc ID 740966.1 (within 48 hours)
2. 中文社区 (MOSC) > 数据库 (MOSC)
> Content Tab > Documents (within 24 hours)

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 50


Session Related Community Links

• “The following thread will have a copy


of the presentation and can be used
for additional questions or discussions
on this topic.”

• https://community.oracle.com/thread/
3719584

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 51


THANK YOU

Copyright © 2015 Oracle and/or its affiliates. All rights reserved. | 52

You might also like