Presentation is loading. Please wait.

Presentation is loading. Please wait.

20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations.

Similar presentations


Presentation on theme: "20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations."— Presentation transcript:

1 20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations

2 Copyright © 2006, Oracle. All rights reserved. 20 - 2 Objectives After completing this lesson, you should be able to do the following: Identify key operational tasks for maintaining your Streams environment Describe backup and recovery issues for a Streams environment Use triggers in a Streams environment Describe interoperability issues with Streams between Oracle9 i Database and Oracle Database 10g Implement best practices for configuring your Streams environment

3 Copyright © 2006, Oracle. All rights reserved. 20 - 3 Capture Process SCN Values Cnnn Instance SGA Java pool Large pool Shared pool Data dictionary cache Library cache Streams pool 816837890868924 First SCN Start SCN

4 Copyright © 2006, Oracle. All rights reserved. 20 - 4 Capture Process SCN Values *** NOTES

5 Copyright © 2006, Oracle. All rights reserved. 20 - 5 Capture Process Checkpoints CAPTURE First SCN Required checkpoint SCN Maximum checkpoint SCN 924890957 99210258681053

6 Copyright © 2006, Oracle. All rights reserved. 20 - 6 Checkpoint *** NOTES

7 Copyright © 2006, Oracle. All rights reserved. 20 - 7 Best Practices for Configuring Streams Use separate staging queues for: –Each capture process –Each apply process Configure a Streams pool for more efficient memory usage. Periodically change the first_scn for capture to a higher value. Protect your data. Use the DBMS_STREAMS_AUTH package to manage Streams administrator privileges.

8 Copyright © 2006, Oracle. All rights reserved. 20 - 8 *** Notes on Configuring Streams

9 Copyright © 2006, Oracle. All rights reserved. 20 - 9 Archive Logging Archiving must be enabled at all source sites. A source site requires extra disk space for: –Supplemental logging –Retention of archived redo logs The following redo log files must be available to the capture process: –All logs containing redo records for an SCN greater than or equal to the required checkpoint SCN –All logs containing redo records for an SCN greater than or equal to the first SCN when starting a new capture process

10 Copyright © 2006, Oracle. All rights reserved. 20 - 10 *** Notes Archive Logging

11 Copyright © 2006, Oracle. All rights reserved. 20 - 11 Sharing LogMiner Data Dictionaries C001 Instance SGA LogMiner data dictionary Streams pool 816837890868924 BUILD for C001 C002 LogMiner data dictionary BUILD for C002

12 Copyright © 2006, Oracle. All rights reserved. 20 - 12 Sharing LogMiner Data Dictionaries *** NOTES

13 Copyright © 2006, Oracle. All rights reserved. 20 - 13 Purging the LogMiner Data Dictionary Capture uses a LogMiner data dictionary. When you reset the first SCN value for an existing capture process, the Oracle Database automatically purges LogMiner checkpoint information prior to the new first SCN setting from the LogMiner data dictionary. First SCN Start SCN Required checkpoint SCN Applied SCN

14 Copyright © 2006, Oracle. All rights reserved. 20 - 14 *** Notes Purging Dictionary

15 Copyright © 2006, Oracle. All rights reserved. 20 - 15 Best Practices for Captured Events Do not rename the source database after a capture process has started capturing changes. Each table for which changes are applied by an apply process should have a primary key. Each column that you specify as a substitute key column should be a NOT NULL column and should be indexed. Do not permit updates to the primary key or substitute key columns.

16 Copyright © 2006, Oracle. All rights reserved. 20 - 16 Source Queue Growth There are two common reasons for source queue growth: An event cannot be propagated to a specified destination queue. One or more destination databases acknowledge successful propagation of events much more slowly than the other databases. User-enqueued events are not being dequeued.

17 Copyright © 2006, Oracle. All rights reserved. 20 - 17 NOLOGGING Operations NOLOGGING or UNRECOVERABLE operations do not write to the redo logs and thus cannot be captured. FORCE LOGGING prevents database changes from being missed by Streams. To override NOLOGGING operations: – STARTUP MOUNT – ALTER DATABASE FORCE LOGGING OR ALTER TABLESPACE FORCE LOGGING FORCE LOGGING must be configured again after you re-create the control file.

18 Copyright © 2006, Oracle. All rights reserved. 20 - 18 Clock Synchronization Ensure that system clocks are synchronized so that conflict resolution is handled correctly when multiple sites have the ability to update the same data. Alternatively, use TIMESTAMP WITH TIME ZONE data type for the time-based column when configuring conflict resolution based on the latest time.

19 Copyright © 2006, Oracle. All rights reserved. 20 - 19 Integrating Triggers with Streams Application of row LCRs to a shared table causes triggers that are defined on the table to fire. The SET_TRIGGER_FIRING_PROPERTY procedure in the DBMS_DDL package controls how a trigger is fired. A setting of “fire once” means not to fire for: –Data changes performed via apply process –Execution of one or more apply errors Default value is fire once for DML and DDL triggers.

20 Copyright © 2006, Oracle. All rights reserved. 20 - 20 SET_FIRING_PROPERTY Procedure Example: Configure a trigger to fire for both local changes and changes generated by the apply process. DBMS_DDL.SET_TRIGGER_FIRING_PROPERTY trig_owner IN VARCHAR2, trig_name IN VARCHAR2, fire_once IN BOOLEAN); EXEC DBMS_DDL.SET_TRIGGER_FIRING_PROPERTY ( - 'HR', 'UPDATE_JOB_HISTORY', FALSE);

21 Copyright © 2006, Oracle. All rights reserved. 20 - 21 Firing Property of Triggers You can check the firing property of a trigger by using the IS_TRIGGER_FIRE_ONCE function in the DBMS_DDL package. DECLARE res BOOLEAN; BEGIN res := DBMS_DDL.IS_TRIGGER_FIRE_ONCE( 'HR', 'UPDATE_JOB_HISTORY'); IF res THEN DBMS_OUTPUT.PUT_LINE('Fire once? YES'); ELSE DBMS_OUTPUT.PUT_LINE('Fire once? NO'); END IF; END;

22 Copyright © 2006, Oracle. All rights reserved. 20 - 22 Best Practices for Rules Use simple rules. Do not use empty rule sets. Manage rules efficiently. Create rules so that only one rule in a positive rule set can evaluate to TRUE for any given condition. Set include_tagged_lcr to TRUE for negative rules. Specify a source database for propagation rules. Subset rules: –Place subset rules in positive rule sets only. –Use them for only those tables that are true data subsets of the source table.

23 Copyright © 2006, Oracle. All rights reserved. 20 - 23 Best Practices for Rules *** Notes

24 Copyright © 2006, Oracle. All rights reserved. 20 - 24 Replicating DDL LCRs 1.Explicitly grant privileges to the apply user. 2.Filter out certain DDL operations at destination sites. 3.Set the instantiation SCN at the schema or global level at each destination site.

25 Copyright © 2006, Oracle. All rights reserved. 20 - 25 Best Practices for Performing Backups of Your Streams Environment For user-managed online backups: –Use Non-NULL Streams tags –Force checkpoints Protect and retain the archived logs. Use COMMIT_SERIALIZATION of FULL for apply. Implement a “heartbeat” table.

26 Copyright © 2006, Oracle. All rights reserved. 20 - 26 *** Notes

27 Copyright © 2006, Oracle. All rights reserved. 20 - 27 Point-in-Time Recovery Issues After performing a complete recovery, check that all Streams processes are enabled and started. To resynchronize a source database in a bidirectional Streams environment, you can: –Verify that the destination database has applied all of the changes sent from the source database needing recovery –Remove the Streams configuration from the source database –At the destination database, drop the apply process that applies changes from the source database undergoing recovery –Follow the steps for adding a new source database to an existing Streams environment

28 Copyright © 2006, Oracle. All rights reserved. 20 - 28 *** Notes

29 Copyright © 2006, Oracle. All rights reserved. 20 - 29 Point-in-Time Recovery with Streams SITE2.NET Start SCN Applied SCN SITE1.NET PITR SCN SITE2.NET Apply progress Capture progress

30 Copyright © 2006, Oracle. All rights reserved. 20 - 30 Recovering a Destination Database After PITR Two methods of recapturing changes: Reset the START_SCN for capture at the source site and resend the missing changes. Create a new capture process with a specific START_SCN, a new propagation at the source site, and an apply process at the recovered site. Recovered site Existing source site Job A002 C001 C002 A001 Job

31 Copyright © 2006, Oracle. All rights reserved. 20 - 31 *** Notes

32 Copyright © 2006, Oracle. All rights reserved. 20 - 32 Recovering a Single-Source Database After PITR C002 C001 A001 Job Recovered to SCN 9462 Greatest applied SCN 9516 DBMS_CAPTURE_ADM.BUILD 1 2 3 A002 5 4 8 6 7

33 Copyright © 2006, Oracle. All rights reserved. 20 - 33 Recovering a Source Database in a Multiple-Source Environment After PITR C002 C001 A001Job Recovered to SCN 9462 Greatest applied SCN 9516 C001Job A001 Job 2 1 3 4 5 6

34 Copyright © 2006, Oracle. All rights reserved. 20 - 34 *** Notes

35 Copyright © 2006, Oracle. All rights reserved. 20 - 35 Upgrading Streams to Oracle Database 10g If you want to upgrade an Oracle9 i Release 2 Streams environment, do the following: Reconfigure database initialization parameters. Grant DBA role to the Streams administrator. Update enqueuing procedures if necessary. Query the DBA_STREAMS_NEWLY_SUPPORTED and DBA_STREAMS_UNSUPPORTED views. Revisit complex rules. Rewrite them to use negative rules or and_condition (if possible).

36 Copyright © 2006, Oracle. All rights reserved. 20 - 36 *** Notes

37 Copyright © 2006, Oracle. All rights reserved. 20 - 37 Configuring Streams to Operate Between Different Versions If you want to include both an Oracle9 i Database Release 2 site and an Oracle Database 10g site in your Streams environment, note the following: Capabilities at each site depend on the limitations of the earlier release. If the Oracle9 i Database Release 2 site is to be a source site, you must configure flow control. A downstream capture process cannot be created on an Oracle9 i Database Release 2 site.

38 Copyright © 2006, Oracle. All rights reserved. 20 - 38 *** Notes

39 Copyright © 2006, Oracle. All rights reserved. 20 - 39 Summary In this lesson, you should have learned how to: Identify key operational tasks for maintaining your Streams environment Describe backup and recovery issues for a Streams environment Use triggers in a Streams environment Describe interoperability issues with Streams between Oracle9 i Database and Oracle Database 10g Implement best practices for configuring your Streams environment

40 Copyright © 2006, Oracle. All rights reserved. 20 - 40


Download ppt "20 Copyright © 2006, Oracle. All rights reserved. Best Practices and Operational Considerations."

Similar presentations


Ads by Google