Top Banner
ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008
30

ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Dec 24, 2015

Download

Documents

Marshall Ford
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

ADVANCE REPLICATION

Oracle Coretech Surabaya (OCS) One Day SeminarSurabaya, August 30th 2008

Page 2: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

AGENDA

• Introduction

• Master – View Replication

• Multimaster & Hybrid• Case 1 (Master – View with subset)

• Case 2 (Full Schema & Cross OS & DB)

• Troubleshoot

Page 3: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Overview Of Replication

User

Transaction

Site #1

Site #2

Database ReplicaDatabase

Replicate

Page 4: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Overview Of Replication

• Replication is the process of copying and maintaining database objects, such as tables,in multiple databases that make up a distributed database system.

Page 5: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Application

Replication typically apply for multiple site enterpise application.

Central – remote site application Autonomous remote sites Data integration consistency

Page 6: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Advance Replication Benefit

Oracle Advance Replication benefit: Failover Load Balancing (Site Autonomy) Interoperability (Can replicate data beetween

different platform) Enable Data Subsetting

Page 7: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Oracle HA Road MapIntegration

8i

High Availability (HA)

Oracle Streams Data Guard + SQL Apply (Logical Standby)

Basic readable standby database (Physical Standby - Redo Apply)

Data Guard + Fast-start failover + Reinstante

Active Data Guard

Basic Replication

Advanced Replication

9i

10g

11g

Page 8: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Prerequites Knowledge

Oracle Database Administrator (DBA) I : …6. Database User Account :7. Managing Schema Object :

– Table– Index– View– ….

11. Configuring Oracle Network Env.

Page 9: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Materialized View (MV)

• View = stored select … query

• MView = View which is materialized from a single point of time = snapshot table

SNAPSHOT MATERIALIZED VIEW

9i 10g 11g7.0 – 7.3 8i8.0

Page 10: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Create Materialized View

Updatable View :CREATE VIEW HR.V_COUNTRIES AS

select * from hr.countries;

Read Only MV :CREATE MATERIALIZED VIEW HR. MV_COUNTRIES AS

select * from hr.countries;

Page 11: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Create Materialized View (2)

Read Only View :CREATE VIEW HR.V_COUNTRIES2 AS

select * from hr.countries WITH READ ONLY;

Updatable MV :CREATE MATERIALIZED VIEW HR. MV_COUNTRIES2 FOR UPDATE AS

select * from hr.countries;

Page 12: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

View Vs MVSQL> Select TNAME, TAB from tab like '%COUNTRIES';TNAME TAB================ =====COUNTRIES TABLEMV_COUNTRIES TABLEV_COUNTRIES VIEW

SQL> select MVIEW_NAME, UPDATABLE from user_mviews;MVIEW_NAME U

==================== =MV_COUNTRIES NMV_COUNTRIES2 Y

Page 13: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Refresh

• Refresh Type Complete Fast Force

• Refresh Method Primary Key Row ID

Page 14: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Refresh

• Refresh Interval on demand on commit automatically on never

Page 15: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Database LinkPrivate & Fixed UserCREATE DATABASE LINK hr.target_db CONNECT TO hr IDENTIFIED BY hr123 USING net_target;

Public & Connected UserCREATE DATABASE LINK PUBLIC target_db USING net_target;

Current UserCREATE DATABASE LINK target_db CONNECT TO CURRENT_USER USING net_target;

Page 16: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Materialized View Log

CREATE MATERIALIZED VIEW LOG ON

Hr.countries WITH PRIMARY KEY (country_id)

Page 17: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Refresh Group

EXEC DBMS_REFRESH.MAKE

('group1', ‘mv_countries', SYSDATE, 'next_day(trunc(sysdate), '/*1:Hrs*/ sysdate + 1/24', FALSE, TRUE);

Page 18: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Advance Replication Type

• Materialized View Replication

(Master – View )

• Multimaster Replication

• Hybrid

Page 19: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Materialized View(Master – View)

MasterSite

Materialized ViewSite

Page 20: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Multimaster• peer-to-peer or n-way replication• equally participating in an update-anywhere model

MasterSite

MasterSite

MasterSite

Replication group

Replication group

Replication group

tables

tables

tables

orcl.site1

orcl.site2 prod.site3

Page 21: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Hybrid

MasterSite

MasterSite

MasterSite

MviewSite

Page 22: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Master – View

MasterSite

Materialized ViewSite

tables

mview

Master Group

mview log

mview Group

Database link

Database link

Page 23: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Step 1Master Site Setup

• Create replication user adminitrator

• Create materialized view user administrator

Page 24: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Step 2Master Site Group

• Create Master Site Group

Page 25: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Step 3Materialized view Log

• Define tables to replicate then create materialized view log

• Add to Master Site Group

Page 26: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Step 4Materialized View Site Setup

• Create materialized view user administrator

• Create Database link to master

Page 27: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Step 5Materialized View Group

• Create Materialized View Group

Page 28: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Step 6Materialized View

• Create Materialized View

• Add to Materialized View Group

Page 29: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

Master – View using prebuilt table

MasterSite

Materialized ViewSite

tables

Prebuilt tables

Master Group

mview log

mview Group

Database link

Database link

Page 30: ADVANCE REPLICATION Oracle Coretech Surabaya (OCS) One Day Seminar Surabaya, August 30 th 2008.

ADVANCE REPLICATION