Documente Academic
Documente Profesional
Documente Cultură
2
<Insert Picture Here>
4
These fall into 3 areas
• Ease of Management
• Protecting Data
• Using your Standby Databases
5
Data Guard Tips & Tricks
Ease of Management
• Use ASM with your databases
• Incorporate a Flash Recovery Area
• Using RMAN to create and backup your standbys
• Use jobs on a Logical standby
6
Getting to ASM
7
But converting to ASM means
Production downtime!
• True, if you are converting your Production database.
• Why not convert your Physical Standby first?
• If you already have a Physical Standby
• Migrate it to ASM
• If you do not, shame on you.
• Create a Physical standby with RMAN and use ASM.
• Run in this mixed environment until you are satisfied
• Execute a switchover and move Production.
• Migrate the Physical standby (original Production) to ASM.
• Switchover again to return to your original setup
• Still some downtime for the switchovers
• Tuned to less than 1 minute and is a planned event.
8
So how hard is it?
9
Start using the Flash Recovery Area
10
Why use it in my Data Guard setup?
11
Where do I use it in my
Data Guard Configuration?
• Primary
• Physical Standby
• Logical Standby
• In Oracle Database 10g you may only use the Flash Recovery Area
to hold the archive logs generated by your Logical standby.
• The Redo coming from the Primary must be stored in a separate
directory and will be maintained by SQL Apply.
• No longer necessary in Oracle Database 11g.
• Migrate slowly if you wish.
• Put it on your Physical standby first.
• Then add it to your Primary
• Does not require downtime.
12
Tuning the Flash Recovery Area
13
So, how do I turn it on?
14
What about my old archiving?
15
Running jobs on your Logical Standby
16
Enter the new and improved
DBMS_SCHEDULER support
• New attribute of a scheduler job called database_role
• Contents match the database_role attribute of V$DATABASE.
• When a scheduler job is created, it defaults to the local role
• A job created on the standby defaults to a database_role
of LOGICAL STANDBY.
• Job scheduler executes only jobs specific to the current role.
• On switchover or failover, the scheduler automatically
switches to running jobs specific to the new role.
• Scheduler jobs are not replicated to the standby.
• Activate existing jobs with DBMS_SCHEDULER.Set_Attribute
• Clone jobs that should run in both roles
• DBA_SCHEDULER_JOB_ROLES view shows which jobs are
specific to which role.
• Set the database guard to STANDBY.
17
Getting more out of RMAN
with Data Guard
• Create Standbys without temporary extra storage
• Move the backups to the standby
• Use the Flash Recovery area and RMAN to manage
your archive logs automatically
18
Standby Creation 11g
19
Standby Creation 11g
Across the network!
rman
connect target sys/oracle@chicago;
connect auxiliary sys/oracle;
run {
allocate channel prmy1 type disk;
allocate channel prmy2 type disk;
allocate channel prmy3 type disk;
allocate channel prmy4 type disk;
allocate auxiliary channel stby type disk;
duplicate target database for standby from active database
spfile
parameter_value_convert 'Chicago','Boston'
set db_unique_name='Boston'
set db_file_name_convert='/Chicago/','/Boston/'
set log_file_name_convert='/Chicago/','/Boston/'
set control_files='/Oracle/oradata/Boston/control.ctl'
}
20
RMAN and Physical standby
21
Move ALL backups to your
Physical Standby database
• With the Active Data Guard option ‘Block Change
Tracking’ is now possible on your Physical standbys
• Now your incremental RMAN backups can go as fast on your
standby as on your Primary.
• No need from a performance point of view to run any backups
on your Primary database.
22
Automate Archive Log Management
23
Data Guard Tips & Tricks
Protecting your data - always
• Implementing Flashback Database
• On your Standby
• On your Primary
• Logging all transactions on the Primary
24
Easing into Flashback Database
25
Why use Flashback Database?
26
What about performance impact?
27
What about my Nologging jobs?
28
How Does Nologging affect
Data Guard? Physical/Logical
Oracle Net
Transactions Standby Database
MRP - physical
LGWR LNS RFS LSP - logical
Sync
Standby
Async Redo
Transform Redo
Online Logs
Primary Arch to SQL for
Redo Logs
& Logical Standby
Database
Gaps
ARCH Queries,
Reports,
ARCH Testing,
Backups
Archived
Archived Redo Logs
Redo Logs
29
To Log or Not to Log?
That is the Question!
• Results from a very skeptical 10g Release 2 customer
• Generate up to 1TB of REDO a day.
• Difference between non-logging and logging must be < 60 minutes.
• Their test results?
• 10,000,000 row data load
• With no-logging
• 5:17 elapsed time
• With logging and no tuning
• 8:22 elapsed time
• With logging and tuning
• 5:44 elapsed time
• They are believers today and are implementing Data Guard
30
So what did they do?
31
If you are still not convinced…
32
Data Guard Tips & Tricks
Using your standby database
• Getting friendly with Failover
• Allowing Data Guard to manage failover
• Perform a Rolling Upgrade
• Even if you don’t have a Logical standby
• Move your testing to your Physical standby
33
Executing a Failover
34
Flashback Database & Failover
35
Reinstatement to a Physical Standby
36
Reinstatement to a Physical Standby
Continued
• Start up the old Primary in mount state.
• Flash back the old primary to the SCN retrieved from
the new Primary
SQL> FLASHBACK DATABASE TO SCN
<standby_became_primary_scn>;
37
Reinstatement to a Physical Standby
Continued
• Shutdown and restart the new standby.
• Ensure REDO is being transferred from the new
Primary to the new Standby
• Start the Apply on the new Standby database
• Ensure that REDO is being applied correctly on the
new Standby database
38
Reinstatement to a Physical Standby
39
40
Best Practices – Failover
41
How about doing it automatically?
42
Data Guard Fast-Start Failover
At Amazon.com
43
Goals for Fast-Start Failover
44
Implementation
• Observer
• Multiple hosts
• Wallet for SYS password
• Wrapper to start/restart automatically
• Easily relocated
• Monitor
• Incorporated into existing monitoring infrastructure
• Alerts if FSFO readiness is compromised
• Warns if flashback database history is insufficient to reinstate
• DB_ROLE_CHANGE trigger
• Directory service update
• Configuration verifier
• Autostop Script
45
Failover
46
Experience
47
Experience
48
Experience
49
Results
Failover Time
60
50
Failover Time
40
(min)
30 Resolve
20 Respond
10 Identify
0
Pre-DG DG w/o FSFO
FSFO
50
Other Possible Uses
51
Enhanced Fast-Start Failover
FastStartFailoverLagLimit
52
Configurable Fast-Start Failover
• Condition examples:
• Datafile Offline
• Corrupted Controlfile
• Corrupted Dictionary
• Inaccessible Logfile
• Stuck Archiver
• Any explicit ORA-xyz error
• Apps can request fast-start failover using API
DBMS_DG.INITIATE_FS_FAILOVER
53
Oracle Rolling Upgrades
for Physical People
• Advantages of using SQL Apply rolling upgrade
• Production database will incur very little downtime.
• The overall downtime can be as little as the time it takes to
perform a switchover.
• Eliminate application downtime due to PL/SQL recompilation.
• Validate the upgraded database release without affecting the
production database.
• Now, not just for Logical Standby customers
10.1.0.4 11.1.0.6
54
Rolling Upgrades
and Physical Standby
55
On Original Primary
56
Convert the Original
Physical standby database
• Convert it into a logical standby database
alter database recover managed standby database cancel;
alter database recover to logical standby keep identity;
alter database open;
execute dbms_ logstdby.apply_set(‘LOG_AUTO_DELETE’,’false’);
alter database start logical standby apply immediate;
57
On the Original Primary
58
On the Original Primary
Continued
• Upgrade Oracle software
• Switch to upgraded home
• Bring up physical standby
startup mount;
alter database recover managed standby database
using current logfile disconnect;
59
What is Snapshot Standby?
Updates Queries
Updates
• Preserves zero data loss – continuous redo transport while open read-write
• Truly leverages standby database and DR hardware for multiple purposes
• Similar to storage snapshots, but provides DR at the same time and uses
single copy of storage
60
But What about Oracle Database 10g?
61
Maintaining Protection (RPO) in 10.2
while in Snapshot mode
• Create an Archive Log Repository (ALR)
• Note 434164.1 Data Guard Redo Log Repository Example
• This will ensure that the redo is being shipped and
stored at the standby site while the standby is open
read write and not able to receive the redo.
• Put the Archive Log Repository in place before you
begin the Snapshot process.
• When the Physical standby has been returned
• Use these logs to catch it up with the Primary
• Or use an incremental backup of the Primary
• This is not required in Oracle Database 11g
62
Basic Steps for an ALR
63
So, Are You Still Reluctant to?
64
Come on in, the water’s fine!
65
Database HA Sessions From Oracle Development
Monday, Nov 12
•S291483 - The Fastest and the Most Cost-Effective Backup for Oracle Database: What’s
New in Oracle Secure Backup 10.2, 11:00 am - 12:00 pm, Moscone South 304
•S291492 - Oracle Database 11g: Next-Generation High Availability, 12:30 - 1:30 pm,
Moscone South 103
•S291923 - Implementing Oracle Maximum Availability Architecture (MAA) at Allstate
Insurance Using Oracle 10g RAC, ASM, Oracle Data Guard and Oracle Grid Control, 3:15
- 4:15 pm, Moscone South 304
•S291484 - Oracle Database 11g Data Repair Technologies: Comprehensive, Intelligent
Recovery, 4:45 - 5:45 pm, Moscone South 304
Tuesday, Nov 13
•S290710 - Maximum Availability Architecture Best Practices: Oracle E-Business Suite 12,
12:15 - 1:15 pm, Marriott Salon 10 & 11
Wednesday, Nov 14
•S291915 - What’s New in Oracle Data Guard 11g: Revolutionizing Data Protection and
Availability, 9:45 - 10:45 am, Moscone South 304
66
Database HA Sessions From Oracle Development
Wednesday, Nov 14
•S291487 - Backup and Recovery Best Practices for Very Large Databases (VLDB), 11:15
am - 12:15 pm, Moscone South 304
•S291920 - Oracle Active Data Guard: How to Utilize Your Standby Databases for
Production Workload - What They Didn’t Print in the Manuals, 3:00 - 4:00 pm,
Moscone South 304
•S291917 - Oracle Data Guard Tips and Tricks: Direct From Oracle Development,
4:30 - 5:30 pm, Moscone South 102
Thursday, Nov 15
•S291495 - Oracle Streams Replication and Advanced Queuing (AQ): What's New in
Oracle Database 11g, 8:30 - 9:30 am, Moscone South 304
•S291499 - Best Practices for Implementing Replication with Oracle Streams in Oracle
Database 10g and 11g, 10:00 - 11:00 am, Moscone South 304
•S291525 - Maximum Availability Architecture (MAA) Best Practices: Online Patching,
Rolling Upgrades and Planned Maintenance with Minimal Downtime with Oracle Database,
11:30 am - 12:30 pm, Moscone South 104
•S290542 - Maximum Availability Architecture (MAA) Best Practices for Siebel 8.0,
2:30 pm - 3:30 pm, Marriott Salon 10 & 11
67
Database HA Demos From Oracle Development
68
For More Information
search.oracle.com
or
oracle.com
69
70
71