Upload
insync2011
View
1.038
Download
0
Embed Size (px)
DESCRIPTION
Citation preview
The most comprehensive Oracle applications & technology content under one roof The most comprehensive Oracle applications & technology content under one roof
Why Use Oracle Data Guard?
Milina Ris7c TelstraClear, New Zealand
The most comprehensive Oracle applications & technology content under one roof
Data Guard Func,ons
• High availability • Data protec,on • Disaster recovery • Repor,ng • Backup and recovery
The most comprehensive Oracle applications & technology content under one roof
Data Guard Configura,ons
• Physical Standby – block for block iden,cal copy of primary database
• Logical Standby – same logical informa,on as primary database
The most comprehensive Oracle applications & technology content under one roof
Data Guard 11g
Snapshot Standby • fully updateable standby database • tes,ng on produc,on like data • easily resynchronised with produc,on
The most comprehensive Oracle applications & technology content under one roof
Data Guard 11g
Ac,ve Data Guard • Real-‐,me repor,ng • Fast incremental backups • Automa,c correc,on of corrupted blocks
NB: Requires separate license
The most comprehensive Oracle applications & technology content under one roof
Ac,ve Data Guard
Read-‐only applica,on can perform: • Selects • Alter session • Call stored procedures • Call remote procedures via DB links • DB links to write to remote databases
The most comprehensive Oracle applications & technology content under one roof
Apply Lag Management 11g
ALTER SESSION SET STANDBY_MAX_DATA_DELAY=600;
ORA-‐03172: STANDBY_MAX_DATA_DELAY of 600 seconds exceeded
The most comprehensive Oracle applications & technology content under one roof
Physical Standby
Primarydatabase
Standbydatabase
Database Database copy
Redotransport
The most comprehensive Oracle applications & technology content under one roof
Benefits of Physical Standby
• Switchover • Failover • Repor,ng • Backup
The most comprehensive Oracle applications & technology content under one roof
Running Backup on Physical Standby
Primary • 4-‐node RAC • NetApp Filers • No ASM • RMAN • TSM with TDPO
Standby • 4-‐node RAC • SAN • ASM • RMAN • TSM with TDPO
The most comprehensive Oracle applications & technology content under one roof
Filesystem to ASM and Back
How to duplicate a controlfile when ASM is involved [ID 345180.1]
How to move a datafile from a file system to ASM [ID 390274.1]
How to move a datafile from ASM to the file system [ID 390416.1]
The most comprehensive Oracle applications & technology content under one roof
Primary RAC database
Standby RAC database Primary Recovery Catalog
Secondary Recovery Catalog
backup
resy
nc
The most comprehensive Oracle applications & technology content under one roof
Alterna,ves for DR
Complex systems e.g. Sybase database Oracle Transparent Gateway for Sybase Third party applica,ons
may require alterna,ve technologies: • SAN replica,on • snapshot technology
The most comprehensive Oracle applications & technology content under one roof
Logical Standby Primary
databaseStandbydatabase
Log Transport Services
Log Apply Services
Oracle N
et
Archived Redo Log Files
Archived Redo Log Files
The most comprehensive Oracle applications & technology content under one roof
SQL Apply – Log Mining
• READER – reads archived redo logs • PREPARER – generates logical change records • BUILDER – groups LCRs into transac,ons
The most comprehensive Oracle applications & technology content under one roof
SQL Apply – Apply Processing
• ANALYZER – iden,fies dependencies • COORDINATOR – assigns transac,ons • APPLIER – applies transac,ons
The most comprehensive Oracle applications & technology content under one roof
Benefits of Logical Standby
• Switchover • Failover • Repor,ng • Addi,onal objects
The most comprehensive Oracle applications & technology content under one roof
Importance of NOT NULL
TABLE1 ID NUMBER(5) NAME VARCHAR2(20) TABLE2 ID NOT NULL NUMBER(5) NAME VARCHAR2(20)
The most comprehensive Oracle applications & technology content under one roof
Importance of NOT NULL
UPDATE SQL on standby database UPDATE table1 SET name = 'Smith' WHERE (id = :b1 OR id IS NULL) AND (name = :b2 OR name IS NULL)
The most comprehensive Oracle applications & technology content under one roof
Tracing APPLIER
SELECT PID, TYPE, STATUS, HIGH_SCN FROM V$LOGSTDBY oradebug setospid <APPLIER pid> oradebug unlimit oradebug event 10046 trace name context forever, level 12
The most comprehensive Oracle applications & technology content under one roof
Tracing APPLIER
oradebug setospid <APPLIER pid> oradebug event 10046 trace name context off Trace file will be generated in bdump tkprof <fn> tkprof.out explain= \"/ as sysdba\"
The most comprehensive Oracle applications & technology content under one roof
Data Guard Modes
ALTER DATABASE GUARD {ALL|STANDBY|NONE} ALL – read only STANDBY – read only for maintained objects NONE – fully updateable
The most comprehensive Oracle applications & technology content under one roof
Bulk Updates
Primary Single update of million rows Standby Million updates on standby
The most comprehensive Oracle applications & technology content under one roof
Reinstan,a,ng Tables
DBMS_LOGSTDBY.INSTANTIATE_TABLE ('HR', 'EMPLOYEES', 'primary_dblink');
• Log apply needs to be stopped • Table is dropped and recreated • Addi,onal grants and indexes are lost
The most comprehensive Oracle applications & technology content under one roof
To Skip or Not to Skip
• Temporary and audit tables • User crea,on • Schemas • Index rebuilds • Par,,on maintenance
The most comprehensive Oracle applications & technology content under one roof
Par,,on Maintenance
Produc7on • Keep 12 months • Archive older data • Drop older par,,ons
Repor7ng • Keep 24 months • Drop older par,,ons
The most comprehensive Oracle applications & technology content under one roof
Skipping Transac,ons
execute dbms_logstdby.skip ('SCHEMA_DDL', 'HR', 'DEPT'); ('DML', 'HR', '%TEMP'); ('ALTER INDEX', '%', '%');
The most comprehensive Oracle applications & technology content under one roof
Skipping Drop Par,,on
execute dbms_logstdby.skip ('ALTER TABLE', '<schema name>', '<object name>', '<procedure name>');
The most comprehensive Oracle applications & technology content under one roof
Skipping Drop Par,,on
IF upper(statement) like '%DROP%PARTITION%' THEN skip_ac,on := sys.dbms_logstdby.SKIP_ACTION_SKIP; ELSE skip_ac,on := sys.dbms_logstdby.SKIP_ACTION_APPLY;
END IF;
The most comprehensive Oracle applications & technology content under one roof
Hints – What to Watch Out For
• Explicitly using inappropriate indexes • Hin,ng full table scan • Using too high parallel degree
The most comprehensive Oracle applications & technology content under one roof
Unsupported Opera,ons
Table compression up to 11gR2 workaround – triggers
Segment shrinking workaround – move
The most comprehensive Oracle applications & technology content under one roof
Logical Standby Tips
• Sound primary database data model • Beware bulk updates • Know the limits • Op,mise long running processes
The most comprehensive Oracle applications & technology content under one roof
Q&A