Escolar Documentos
Profissional Documentos
Cultura Documentos
Introduction
Mark Bole Independent Consultant Oracle, Unix, Perl since 1991 http://www.bincomputing.com
(teaser)
Logical Standby Databases for Reporting - Mark Bole, BIN Computing Not quite ready for a data warehouse, but still want a high performance reporting environment that doesn't impact your online transaction (OLTP) users? New in Oracle 9i, the Data Guard logical standby database is one answer. One or more core schemas are automatically synchronized with your live database, as frequently as you wish, without creating any load on the source database. Once updated, the core data is protected from any alteration, yet any other tables and schemas can be created in the same database to extend your data model and provide reporting performance. Materialized views, query rewrite, and other typical data warehouse techniques are all available.
Todays Session
DataGuard Logical Standby going outside the DG box What is Logical Standby? How to set it up Reporting/Batch: refresh cycle, materialized views, maintenance
While Streams and Data Guard do share some common underlying [] technology, they are both independent features that are built to solve different business needs. [see references] Oracle Data Guard is designed for protecting from data failure and disasters. Streams is designed for information sharing and distribution but can also provide a very efficient high availability solution.
8i 9i 10g
Oracle Streams
8i 9i 10g
Oracle Streams
Too Many Ways for the Logical Standby to deviate from the primary intentional or otherwise!
Unsupported Datatypes (partial list) LONG LONG RAW BFILE ROWID user-defined types varrays nested tables
RAC
SQL Apply
ASM
Todays Session
DataGuard Logical Standby going outside the DG box What is Logical Standby? How to set it up Reporting/Batch: refresh cycle, materialized views, maintenance
Physical standby is an image copy of the primary every datafile block is the updated to match as of point in time. Other existing options for logical: Export / Import Traditional Advanced Replication Transportable tablespace (maybe)
Previous Solution
Primary Redo apply (once every 24 hours) Daily Cycle:
1. 2. 3. 4. 5. 6. Close Physical Standby Mount Physical Standby Recover day's worth of redo Open Physical Standby read-only for rest of day Run batch and reporting processes using dblink Loop to step 1
Physical Standby
DB Link
Reporting Database
DB Link
Reporting Database
SQL Apply
SQL Apply technology [] first transforms the redo data into SQL statements and then executes the generated SQL statements on the logical standby database.
Physical
SQL
redo
SQL
Todays Session
DataGuard Logical Standby going outside the DG box What is Logical Standby? How to set it up Reporting/Batch: refresh cycle, materialized views, maintenance
Logstdby Pre-requisites
Enterprise Edition license Same operating system and platform architecture as primary Same RDBMS version (10g supports rolling upgrades) FORCE LOGGING at database level
Supplemental Logging
If youre going to use supplemental logging, you need to be aware that you are actually asking for quite a lot of new information to be included in the redo stream and all that extra information might just be enough to tip LGWR and ARCH over into serious performance problems.
Howard J. Rogers, New Features in Oracle 9i
Much less of a problem if you have a unique or primary key on every table!
DBA_LOGSTDBY_PARAMETERS
DBMS_LOGSTDBY.APPLY_SET ('TRANSACTION_CONSISTENCY', 'NONE'); DBMS_LOGSTDBY.APPLY_SET ('MAX_EVENTS_RECORDED', '2000'); DBMS_LOGSTDBY.APPLY_SET ('RECORD_SKIP_DDL', 'FALSE'); DBMS_LOGSTDBY.APPLY_SET ('RECORD_APPLIED_DDL', 'FALSE'); DBMS_LOGSTDBY.APPLY_SET ('_EAGER_SIZE', 1000);
Todays Session
DataGuard Logical Standby going outside the DG box What is Logical Standby? How to set it up Reporting/Batch: refresh cycle, materialized views, maintenance
Previous Solution
Primary Redo apply (once every 24 hours) Daily Cycle:
1. 2. 3. 4. 5. 6. Close Physical Standby Mount Physical Standby Recover day's worth of redo Open Physical Standby read-only for rest of day Run batch and reporting processes using dblink Loop to step 1
Physical Standby
DB Link
Reporting Database
Primary
LogStdby
DG SQL Apply
OLTP application Reporting/Batch application
LogStdby
Now we can create Materialized View logs directly in the source schema without impacting the primary!
Reporting/Batch application
Example: MV logs
schema_blue> select table_name from user_tables; TEST_TABLE schema_blue> delete from test_table where name = 'test1'; ORA-01031: insufficient privileges <= table is guarded schema_blue> CREATE MATERIALIZED VIEW LOG on test_table 2 with sequence, primary key, rowid 3 (value, timestamp) 4 INCLUDING NEW VALUES; Materialized view log created.
LogStdby
Now we can create Materialized View logs directly in the source schema without impacting the primary!
Reporting/Batch application
References
Creating a Logical Standby with Minimal Production Downtime Oracle Data Guard Readme for SQL Apply Release 9.2.0.6 Oracle Data Guard Readme for SQL Apply Release 10.1.0.3 SQL Apply Best Practices (9i) SQL Apply Best Practices (10g) Oracle10g Data Guard SQL Apply Troubleshooting ORA-1 Occurring on Logical Standby Synchronizing tables in a Logical Standby Database Troubleshooting 9i Data Guard Network Issues Streams and Data Guard Role Transitions
Note:278371.1 Note:286787.1 Note:304059.1 http://otn.oracle.com/deploy/availability/pdf/DataGuard SQLApplyBestPractices.pdf http://www.oracle.com/technology/deploy/availability/p df/MAA_WP_10gSQLApplyBestPractices.pdf Note:312434.1 Note:257356.1 Note:271455.1 Note:241925.1 http://www.oracle.com/technology/deploy/availability/p df/MAA_WP_10gDataGuardRoleTransitionsStreams.p df
Thank you!
Copy of presentation will be available at NoCOUG web site
Questions?