• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Managing Oracle Streams Using Enterprise Manager Grid Control
 

Managing Oracle Streams Using Enterprise Manager Grid Control

on

  • 7,469 views

Presentation for Central Florida Oracle Users Group on how to manage Oracle Streams using Oracle Grid Control in 10g

Presentation for Central Florida Oracle Users Group on how to manage Oracle Streams using Oracle Grid Control in 10g

Statistics

Views

Total Views
7,469
Views on SlideShare
7,359
Embed Views
110

Actions

Likes
1
Downloads
292
Comments
1

7 Embeds 110

http://www.slideshare.net 51
http://wordpressconsultants.net 48
http://www.linkedin.com 5
http://static.slidesharecdn.com 2
http://translate.googleusercontent.com 2
http://www.lmodules.com 1
http://webcache.googleusercontent.com 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • nice
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Managing Oracle Streams Using Enterprise Manager Grid Control Managing Oracle Streams Using Enterprise Manager Grid Control Presentation Transcript

    • Managing Oracle Streams 10g Using Oracle Grid Control Scott R Baker 8/24/2009 This presentation can be viewed at: http://www.slideshare.net/scottb411
    • Scott R Baker
      • Fall 1999: - Graduated from the University of Central Florida with BS Management information Systems
      • Fall 1999 – August 2005: Senior Support Engineer with Oracle Corporation (Orlando)
      • 2002 – Oracle Certified DBA in 8i
      • August 2005 - May 2009: Senior Oracle DBA; DBA Manager with Bonnier Corporation (Formerly World Publications)
      • May 2009 - Present: Development Manager - (DBA / Quality Assurance / Support) with Bonnier Corporation
    • Bonnier Corporation
      • Bonnier Corporation is one of the largest consumer-publishing groups in America, and with nearly 50 special-interest magazines and related multimedia projects and events, it is the leading media company serving passionate, highly engaged audiences. With over 1,000 employees and more than $350 million in annual revenue, Bonnier Corp. ranks in the top 10 nationally among publishing companies.
      • Headquarters are in Winter Park, FL
      • http://www.bonniercorp.com
    • Bonnier Corporation’s Use of Oracle Streams
      • Bonnier Corporation’s use of Oracle Streams was featured in Oracle Magazine in June 2008:
        • http://www.oracle.com/technology/oramag/oracle/08-jul/o48linuxsupport.html
      • In December 2008, Oracle released a case study of our use of Oracle Streams at Bonnier:
        • http://www.oracle.com/technology/deploy/availability/pdf/bonnier_casestudy.pdf
    • Bonnier Corporation’s Use of Oracle Streams
    • Streams Replication Overview
    • Streams Replication
      • Logical Replication vs Physical Replication
        • Streams is logical-based replication
      • Rule-Based Replication
        • Positive Rules of Replication
          • What do you want to replicate?
        • Negative Rules of Replication
          • What don’t you want to replicate?
      • Streams Administrator
        • Streams environment self-contained within it’s own schema and administrator
    • Streams Replication
      • Processes:
      • Capture: A Streams capture process mines redo logs to create one or more logical change records (LCRs) and queues them to a Capture Queue. An LCR is a message with a specific format that describes a database change
      • Propagation: Streams propagation propagates the staged LCR to another queue residing in the destination database where apply will occur.
      • Apply: Once the LCR has reached the destination database, a Streams apply process consumes the change by applying the LCR to the shared database object.
      • Source: Oracle Streams Concepts and Administration
      • Source: Oracle® Database High Availability Overview 10 g Release 2 (10.2)
    • Oracle Streams Demonstration
    • Prerequisites
      • Database must be in archivelog mode
        • archive log list;
      • Undo_retention must be set to 86400
        • select name, value from v$parameter where name like '%global%';
        • alter system set global_names=TRUE scope=both;
      • Global_name must be set to true
        • select name, value from v$parameter where name like '%undo%';
        • alter system set undo_retention=86400 scope=both;
      • Global Names must be used for each database
      • From each database:
      • SQL> select * from global_name;
      • GLOBAL_NAME (Source)
      • --------------------------------------------------------------------------
      • RUNI.DOMAIN
      • GLOBAL_NAME (Destination)
      • --------------------------------------------------------------------------
      • TICKET.DOMAIN
      • Create streams administrator in both the source and destination database
      • > CREATE USER strmadmin identified by streams
      • default tablespace USERS
      • temporary tablespace TEMP;
      • >grant dba to strmadmin;
      • >alter user strmadmin quota unlimited on USERS;
      • Configure streams administrator in both environments:
      • BEGIN
      • DBMS_STREAMS_AUTH.GRANT_ADMIN_PRIVILEGE(
      • grantee => 'strmadmin',
      • grant_privileges => TRUE);
      • END;
      • /
      • select * from dba_streams_administrator;
      • Create a database link from the source to destination and vice-versa
      • On Source:
      • create database link ticket.DOMAIN connect to strmadmin identified by streams using 'TICKET';
      • select * from streams_apply_qt@ticket.DOMAIN
      • On Destination:
      • create database link RUNI.DOMAIN connect to strmadmin identified by streams using 'RUNI';
      • select * from streams_apply_qt@RUNI.DOMAIN
      • Directories must be setup for export and import
        • ($ ls -al | grep exp_dir)
      • In /home/oracle:
      • [oracle]$ mkdir src_exp_dir
      • [oracle]$ chmod 777 src_exp_dir
      • [oracle]$ mkdir dst_exp_dir
      • [oracle]$ chmod 777 dst_exp_dir
      • On source as strmadmin user:
      • ----------------------------
      • SQL> connect strmadmin/streams
      • >create directory src_exp_dir as '/home/oracle/src_exp_dir';
      • On destination as strmadmin user:
      • ---------------------------------
      • SQL> connect strmadmin/streams
      • >create directory dst_exp_dir as '/home/oracle/dst_exp_dir';
    • Begin Using Enterprise Manager
      • Log out of Enterprise Manager for the source database and log back into the source database as the strmadmin user
      • In Enterprise Manager, Click on the Maintenance Tab
        • Source (Runi) / Destination (Ticket)
      • Under Data Movement, click on the “Setup” link under Streams
      • Select:
      • Streams Global, Schema, Table and Subset Replication Wizard
      • Provide strmadmin for source/destination
      • For this demonstration, we will select “Schema Rule”
      Important: Go to next slide before hitting the “Next” button
      • Leave Processes to their default values
        • Capture
        • Propagate
        • Apply
      Important: Go to next slide before hitting the “Next” button
      • Use flashlights to select directory objects
      These are the directories we created in our prerequisites Important: Go to next slide before hitting the “Next” button
      • Choose to propagate DDL
      Capturing DDL changes will apply structural changes to tables and indexes to the destination database. If you create a new table, it will be created in the destination database as well. Click the “Next” button in the Wizard
      • Include the Schema “SCOTT” by using the flashlight or typing in directly.
      Click on the “Exclude Tables” Button at the bottom of the page. Proceed to next slide
      • Use the Flashlight to exclude the table “Bonus” in the Scott/Tiger schema
      • Review the replication settings that you have made.
    • Streams Rules
      • Selecting the Scott/Tiger schema to replicate was a positive rule
      • Choosing to not replicate the BONUS table from the Scott/Tiger schema was a negative rule.
      • You need to submit the job in order for the replication to take place.
      Make sure that you provide the host credentials prior to submitting the job. This is the Oracle account that you authenticate to the database server as.
    • We are now Streaming! In the source database, execute the following: SQL> CREATE TABLE SCOTT.streams_demo ( demo_pk NUMBER, demo NUMBER ); SQL> ALTER TABLE SCOTT.STREAMS_DEMO ADD ( CONSTRAINT STREAMS_DEMO_PK PRIMARY KEY (demo_pk)); SQL> insert into scott.streams_demo values (5,5); SQL> insert into scott.bonus values ('demo','teacher',200, 10); SQL> commit; Verify the table and record is showing up in the streams_demo destination database but not the bonus table (Negative Rule).
    • Let’s Break Streams
      • On destination database, execute the following:
      • SQL> update scott.streams_demo set demo = 6;
      • SQL> commit;
      • On the source database, execute the following:
      • SQL> update scott.streams_demo set demo = 7 where demo=5;
      • SQL> commit;
      • On the destination database In Enterprise Manager, Click on the Maintenance Tab
        • Destination (Ticket)
      • Under Data Movement, click on the “Management” link under Streams
      • We can see that the Apply process is having errors.
      Click on the “Apply” link to look into it
      • We can see that the Apply process has a status of “ABORTED”
      Click on the “Errors” button to look into the problem.
      • Click on the icon for “View Error LCRs”
      The operation failed on an update. Click on the “Compare Value” button. We can see what changed and what the different values are
      • Let’s correct the record in the destination database:
      • SQL> update scott.streams_demo set demo = 7 where demo_pk = 5;
      • SQL> commit;
      Select the record and click on the “DELETE” button In the Source database, insert a new record SQL> insert into scott.streams_demo values (8,8); SQL> commit;
      • Check the destination database for the new record.
      • What happened?
      • Why did it happen?
      • The Apply process is still aborted
      Click on the “Start” button to enable it Check the STREAMS_DEMO table on the destination database again. The record now shows up. It was saved in the queue until the apply process was enabled.
      • By Default, the streams apply process will stop all replication until the problem record(s) are cleaned up. If you want replication to continue even if there is a problem, click on the “Edit” button for the apply process…
      • … and change the parameter DISABLE_ON_ERROR from “Y” to “N” and click “Apply”.
      In the previous scenario, the new record would have been inserted, regardless of the previous error message, and the apply process would not have been aborted.
      • Go back to the source database and click on the Streams “Management” link
      • Under the Caputure section, click on the link under the “Negative Rule Set” column
      Click on the “Create” button
      • Select “Table Rule” and both DML and DDL Changes
      • Enter
        • Schema: SCOTT
        • Table: STREAMS_DEMO
        • Click on the “Go” button and “OK”
      • Under the Search Box, select Table for the Rule Type and click on the “Go” button
      We can see that there is now a negative DML rule and DDL rule for the BONUS and STREAMS_DEMO table.
      • Insert a new record into the STREAMS_DEMO table on the source database:
      • SQL> insert into scott.streams_demo values (9,9);
      • SQL> commit;
      • As expected, the record does not get copied over.
    • Remove Streams
      • From the Streams Dashboard, you can completely remove your streams environment by clicking on the “Remove Streams Configuration” link shown below.
    • Good to Know
      • Streams Healthcheck
        • Metalink Doc ID: 273674.1 Streams Configuration Report and Health Check Script (Equivalent to AWR/Statspack report built to diagnose Streams issues).
      • Error Logs not showing up in Enterprise Manager
        • If you are having errors for the streams processes but the logs aren’t showing up in Enterprise Manager, log out of Enterprise Manager and log back in. Enterprise Manager doesn’t always show the latest logs unless you log out and back in.
      • Sequences
        • If you are setting up master to master replication, be sure sequences are even numbers on source and odd numbers on destination or vice-versa.
      • Oracle Text
        • The Oracle text index will break if using streams when it is refreshed. Manage the indexes locally.
    • Questions?
      • Scott Baker
        • Email: [email_address]
        • Linked In: http://www.linkedin.com/in/scottbakerprofile
      This presentation can be viewed at: http://www.slideshare.net/scottb411