Data Guard New Features

4,934 views

Published on

11g Data Guard New Features

Published in: Technology
  • cool feature, hope it will replace shareplex
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Data Guard New Features

  1. 1. 11g Data Guard New Features -- Fan Xiangrong
  2. 2. Agenda  Common changes  Password file  Redo compress shipping  Physical standby changes  Active standby  Snapshot database  Corrupted block automatic replacement  RMAN duplicate standby from active database  Logical standby changes  Online modify logical standby parameters  Compressed table is supported by logical standby  SQL Apply will execute parallel DDLs in parallel
  3. 3. Agenda  Common changes  Password file  Redo compress shipping  Physical standby changes  Active standby  Snapshot database  Corrupted block automatic replacement  Use RMAN to build physical standby  Logical standby changes  Dynamic parameters change  Compressed table is supported by logical standby  SQL Apply will execute parallel DDLs in parallel
  4. 4. Password file  Create password file on standby doesn’t work. You need to copy password file from primary to standby.
  5. 5. Redo Compress Shipping  Add “compression=enable” to log_archive_dest_N parameter log_archive_dest_3 = 'service="(DESCRIPTION= (ADDRESS=(PROTOCOL=TCP)(HOST=qadb27.qa.eba y.com)(PORT=1799))(CONNECT_DATA=(SID=TEST2 )))" compression=enable reopen=5 lgwr async'  For 11g R1, it only uses compression when resolving gaps. If you set hidden parameter _REDO_TRANSPORT_COMPRESS_ALL=TRUE, it will use compression for all redo transport.
  6. 6. Redo Compress Test SQL to generate redo: create table test tablespace data01 as select * from dba_objects; begin for i in 1..8 loop insert into test select * from test; commit; end loop; end; / Check “bytes received via SQL*Net from client” statistics on standby. 1st test: Compression = enable 594M- 507M = 87M Compression = disable 959M- 595M = 364M 2st Test: Compression = enable 1046M-959M = 87M Compression = disable 1410M-1047M=363M Compression rate is 24%. Different data can have different compress rate.
  7. 7. It needs License  Redo transport compression is a feature of the Oracle Advanced Compression option. You must purchase a license for this option before using the redo transport compression feature.
  8. 8. Agenda  Common changes  Password file  Redo compress shipping  Physical standby changes  Active standby  Snapshot database  Corrupted block automatic replacement  RMAN duplicate standby from active database  Logical standby changes  Dynamic parameters change  Compressed table is supported by logical standby  SQL Apply will execute parallel DDLs in parallel
  9. 9. Active Standby
  10. 10. Simple Steps • SQL> RECOVER MANAGED STANDBY DATABASE CANCEL;􀁡􀁡􀁡 Stop redo apply • SQL> ALTER DATABASE OPEN READ ONLY; Open the database read only • SQL> RECOVER MANAGED STANDBY DATABASE DISCONNECT USING CURRENT LOGFILE; Restart redo apply
  11. 11. Disallow operations  Any DML (insert, update, delete)  Any DDL  Access of local sequences  DMLs on local temporary tables
  12. 12. Check Standby Apply Status  V$database.current_scn records the current apply SCN. SQL> select scn_to_timestamp(current_scn) from v$database; SCN_TO_TIMESTAMP(CURRENT_SCN) --------------------------------------------------------------------------- 21-NOV-09 08.42.43.000000000 AM  Session level parameter STANDBY_MAX_DATA_DELAY(11g R2) The new STANDBY_MAX_DATA_DELAY session parameter can be used to specify a session-specific apply lag tolerance, measured in seconds, for queries issued by non-administrative users to a physical standby database that is in real-time query mode. Alter session set STANDBY_MAX_DATA_DELAY = { integer | NONE }
  13. 13. Snapshot database  A snapshot standby database is a fully update-able standby database that is created by converting a physical standby database into a snapshot standby database.  Snapshot standby database receives and archives, but does not apply the redo data.  Redo data received from the primary database is applied automatically once it is converted back into a physical standby database.  All local updates will be discarded when snapshot database is converted back to physical standby database.  In 10g version, we can do it manually.
  14. 14. 10g Manual Steps  http://dbmonitor.vip.qa.ebay.com/dbblog/ main.php?name=Sub%20doc/2009.11.22% 2010g%20put%20standby%20in%20read- write%20using%20flashback.htm
  15. 15. Convert to Snapshot database Steps  If not already configured , configure flash recovery area as given below  Set the size for recovery area. Alter system set db_recovery_file_dest_size=<size>  Set Flash recovery area. (unset db_recovery_file_dest and set db_recovery_file_dest_1) Alter system set db_recovery_file_dest=<path>  Bring the physical standby database to mount stage.  Stop managed recovery if it is active.  Convert to snapshot standby database. ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;  Shutdown and startup
  16. 16. Convert back to Physical Standby Steps  Shutdown the snapshot standby database.  Bring the database to the mount stage.  Issue the command ALTER DATABASE CONVERT TO PHYSICAL STANDBY;  Shutdown the database and mount it .  Start the media recovery process.
  17. 17. Corrupted block replacement  A corrupted data block in a primary database can be automatically replaced with an uncorrupted copy of that block from a physical standby database that is operating in real-time query mode.  A corrupted block in a physical standby database can also be automatically replaced with an uncorrupted copy of the block from the primary database if LOG_ARCHIVE_CONFIG, LOG_ARCHIVE_DEST_n parameters are set on standby.
  18. 18. RMAN Duplicate Standby
  19. 19. RMAN Duplicate Standby  Prepare standby system  Setup listener  Create an init.ora file with only db_name in it  Create or copy a password file  Startup nomount database  Create spfile from pfile  Prepare primary system  Create spfile from pfile
  20. 20. RMAN build script rman target sys/sys@test_pri AUXILIARY sys/sys@test_target run { allocate channel prmy1 type disk; allocate auxiliary channel stby1 type disk; duplicate target database for standby from active database spfile parameter_value_convert 'GBPGW','DDS' set db_unique_name='TEST' set control_files='/oracle/DDS/archive/TEST/control.ctl' set log_archive_dest_1='location=/oracle/DDS/archive/TEST/archive' set db_file_name_convert='/oracle/GBPGW/data01/TEST','/oracle/DDS/archive/TEST' set log_file_name_convert='/oracle/GBPGW/data01/TEST/redo','/oracle/DDS/archive/TEST/re do‘ set log_archive_dest_3=‘’ nofilenamecheck; }
  21. 21. Agenda  Common changes  Password file  Redo compress shipping  Physical standby changes  Active standby  Snapshot database  Corrupted block automatic replacement  Use RMAN to build physical standby  Logical standby changes  Dynamic parameters change  Compressed table is supported by logical standby  SQL Apply will execute parallel DDLs in parallel
  22. 22. Dynamic parameters change select * from dba_logstdby_parameters SQL> / NAME VALUE UNIT SETTING DYNAMIC ------------------------------ -------------------- ---------- ---------- ---------- MAX_SGA 30 MEGABYTE SYSTEM YES MAX_SERVERS 9 SYSTEM YES PREPARE_SERVERS 1 SYSTEM YES APPLY_SERVERS 5 SYSTEM YES MAX_EVENTS_RECORDED 10000 SYSTEM YES RECORD_SKIP_ERRORS TRUE SYSTEM YES RECORD_SKIP_DDL TRUE SYSTEM YES RECORD_APPLIED_DDL FALSE SYSTEM YES RECORD_UNSUPPORTED_OPERATIONS FALSE SYSTEM YES EVENT_LOG_DEST DEST_EVENTS_TABLE SYSTEM YES LOG_AUTO_DELETE TRUE SYSTEM YES LOG_AUTO_DEL_RETENTION_TARGET 1440 MINUTE SYSTEM YES PRESERVE_COMMIT_ORDER TRUE SYSTEM NO _EAGER_SIZE 1000 USER YES
  23. 23. Compressed table is supported (11.2)  DSS table compression  Create table … compress as select…  OLTP table compression  Alter table … compress for all operations
  24. 24. Parallel DDL is supported Primary: SQL> create index test1 on test(object_name) tablespace data01 parallel 4; Index created. Target: 583 oracle@qadb27 (P002) log buffer space 0/0/0 0 0 0/0 A 14 13 575 oracle@qadb27 (P003) log buffer space 0/0/0 0 0 0/0 A 14 13 595 oracle@qadb27 (P000) direct path read temp 103/1929/1 3 0 0/0 A 14 14 601 oracle@qadb27 (P001) direct path read temp 103/14729/1 -1 0 0/0 A 14 13 576 oracle@qadb27 (P004) PX Deq: Execution Msg 268566527/2/0 0 1 0/0 I 1 13 665 oracle@qadb27 (P006) PX Deq: Execution Msg 268566527/2/0 0 1 0/0 I 2 13 574 oracle@qadb27 (P005) PX Deq: Execution Msg 268566527/1/0 0 1 0/0 I 1 13 647 oracle@qadb27 (P007) PX Deq: Execution Msg 268566527/1/0 0 1 0/0 I 1 13
  25. 25. Others  Statspack on standby (454848.1)  Support different platforms (413484.1)  Big performance boost in Oracle 11G Up to 100% increase in redo apply performance
  26. 26. Review  Common changes  Password file  Redo compress shipping (_REDO_TRANSPORT_COMPRESS_ALL=TRUE for 11gR1)  Physical standby changes  Active standby  Snapshot database  Corrupted block automatic replacement  RMAN duplicate standby from active database  Logical standby changes  Online modify logical standby parameters  Compressed table is supported by logical standby (11g R2)  SQL Apply will execute parallel DDLs in parallel

×