1. Trang chủ
  2. » Công Nghệ Thông Tin

Distributed Database Management Systems: Lecture 25

61 5 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Distributed Database Management Systems
Trường học Virtual University of Pakistan
Chuyên ngành Distributed Database Management Systems
Thể loại lecture
Định dạng
Số trang 61
Dung lượng 386,31 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Distributed Database Management Systems: Lecture 25. The main topics covered in this chapter include: derived horizontal fragmentation; fragmenting/partitioning a table based on the constraints defined on another table; linked with each other through Owner-Member relation;...

Trang 1

Distributed Database Management Systems

Lecture 25

Trang 2

Distributed Database

Management Systems

Virtual University of Pakistan

Trang 3

In Previous Lectures: time

1:40-230

• Reasons for Fragmentation

– Maximizes local access

– Reduces table size, etc.

• PHF using the SQL Server on

same machine

Trang 5

In Previous Lectures

• Implemented PHF in a Banking

Environment (around 3: 40)

• DDBS layer is superimposed on the client sites (4:00)

• Actual Data resides with the local sites (4:35)

Trang 6

Today’s Lecture

Derived Horizontal Fragmentation

Trang 7

Derived Horizontal Fragmentation

• Fragmenting/ Partitioning a table based on the constraints defined

on another table

• Both tables are linked with each other through Owner-Member

relation

Trang 10

Why DHF Here (8: 50)

• Employee and salary record is

split in two tables due to

Normalization

• Storing all data in EMP table

introduces Transitive Dependency

• That causes Anomalies

Trang 11

PHF of TITLE table, around 11:00

• Predicates defined on the sal

attribute of TITLE table

• p1 = sal > 10000 and sal <= 20000

• p2 = sal > 20000 and sal <= 50000

• p3 = sal > 50000

Trang 12

Conditions for the TITLE Table (11:58)

• TITLE1 = (sal > 10000 and SAL ≤30000) (SAL)

• TITLE2 = (sal > 20000 and SAL ≤50000) (SAL)

• TITLE3 = (sal > 50000) (SAL)

Trang 13

Tables created with constraints: 12:20

• create table TITLE1 (titleID char(3) primary key, titleName char (15), sal int check (SAL between 10000 and 20000))

• create table TITLE2 (titleID char(3) primary key, titleName char (15), sal int check (SAL between 20001 and 50000))

• create table TITLE3 (titleID char(3) primary key, titleName char (15), sal int check (SAL > 50000))

Trang 14

titleID titleName Sal

Trang 15

EMP table at local sites (14:45)

• create table EMP1 (empId char(5) primary key,

empName char(25), empAdres char (30), titleId char(3) foreign key references TITLE1(titleID))

Trang 17

Referential Integrity Constraint

(18:30)

• Null value in the EMP1.titleId is

allowed

• This violates the correctness

requirement of the Fragmentation, i.e., it will violating the

completeness critetion

Trang 18

Tighten Up the Constraint Around

20:00

• Further we need to impose the

“NOT NULL” constraint on the

EMP1.titleID

• Now the records in EMP1 will

strictly adhere to the DHF

Trang 19

Revised EMP1 Definition(21::00)

• create table EMP1 (empId char(5) primary key, empName char(25), empAdres char (30), titleId

char(3) foreign key references

TITLE1(titleID) not NULL)

Trang 20

Defining all three EMP

tables:21:20

• create table EMP1 (empId char(5) primary key,

empName char(25), empAdres char (30), titleId char(3) foreign key references TITLE1(titleID) not NULL)

• create table EMP2 (empId char(5) primary key,

empName char(25), empAdres char (30), titleId char(3) foreign key references TITLE2(titleID) not NULL)

• create table EMP3 (empId char(5) primary key,

empName char(25), empAdres char (30), titleId char(3) foreign key references TITLE3(titleID) not NULL)

Trang 21

Implementing same scenario as PHF

22:10

Trang 22

PHF of EMP at different sites

Trang 23

• create table EMP2 (empId char(5) primary

key check (empId in (‘Elect Engr’,’Mech Engr’)), empName char(25), empAdres

char (30), titleId char(3))

• create table EMP3 (empId char(5)

primary key check (empId in (' Sys

empAdres char (30), titleId char(3))

Trang 24

titleID titleName Sal

Trang 25

Time 24:00

• All three predicates of PHF

defined in the two slide a couple

of slides ago

Trang 26

May be: 24:40

• create table EMP1 (empId char(5) primary key check (empId in

('Programmer‘, ‘Assist Supr’)),

empName char(25), empAdres

char (30), titleId char(3))

Trang 27

empId empName empAdres titleId

Trang 28

DHFs of EMP Table

Trang 29

empId empName empAdres titleId

Trang 30

Transactional Replication (30:30)

Trang 31

• Data replicated as the transaction executes

• Preferred in higher bandwidth and lower latency

• Transaction is replicated as it is

executed

Trang 32

• Begins with a snapshot, changes sent at

subscribers as they occur or at timed

intervals

• A special Type allows changes at

subscribers

Trang 33

• Lets do it

• From the Enterprise Manager, select Replication, after a

couple of nexts, we get this screen

Trang 40

• Publication has been created that can be viewed from

Replication Monitor or from Replication, like this

Trang 42

• It has also created snapshot and log reader agents,

which won’t work until we create a subscription

• For this, we select the publication from replication

monitor, right click it, then select Push new subscription

Trang 45

• You select the particular database where you want to

subscribe, we have created a new one

Trang 47

• On next slide is asks the schedule for Distributor

Trang 48

A couple of more nexts and then

Trang 49

• After this we run the snapshot agent, that creates a

snapshot, you can verify this from snapshot agent

history, or you can go to subscriber database and have a look, like this

Trang 51

• We delete a record from our publication and we see that

it is expressed in

Trang 53

• This will be automatically be transferred to Subscription.

• If this activity could not be performed on subscriber, then

the replication monitor will generate an error You have

to trap it and tune your application

Trang 54

Merge Replication

Trang 55

• From replication, start a new publication, a few nexts,

and once again our old familiar screen

Trang 58

• After a few nexts, the merge publication will be created

Trang 60

• Now you execute the snapshot agent of this replication

on the other side

Trang 61

• In case of merge replication, we have to be careful about

the constraints, like Primary Key, or other constraints

Ngày đăng: 05/07/2022, 13:38

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

  • Đang cập nhật ...

TÀI LIỆU LIÊN QUAN