0% found this document useful (0 votes)
337 views

Semantic Data Control

The document discusses semantic data control in distributed database management systems, including view management, data security, and semantic integrity control. It describes how views can be defined, manipulated, and updated. It also covers topics like query modification, view management challenges in distributed systems, data encryption techniques, and constraint specification languages.

Uploaded by

fatima_akram
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
337 views

Semantic Data Control

The document discusses semantic data control in distributed database management systems, including view management, data security, and semantic integrity control. It describes how views can be defined, manipulated, and updated. It also covers topics like query modification, view management challenges in distributed systems, data encryption techniques, and constraint specification languages.

Uploaded by

fatima_akram
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

Outline

n Introduction
n Background
n Distributed DBMS Architecture
n Distributed Database Design
o Semantic Data Control
➠ View Management
➠ Data Security
➠ Semantic Integrity Control
o Distributed Query Processing
o Distributed Transaction Management
o Distributed Database Operating Systems
o Parallel Database Systems
o Distributed Object DBMS
o Database Interoperability
o Current Issues
Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 1

Semantic Data Control


n Involves:
➠ View management

➠ Security control

➠ Integrity control

n Objective :
➠ Insure that authorized users perform correct
operations on the database, contributing to the
maintenance of the database integrity.

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 2

Page 1
View Management
EMP
View Ð virtual relation
ENO ENAME TITLE
➠ generated from base relation(s) by a
query E1 J. Doe Elect. Eng
E2 M. Smith Syst. Anal.
➠ not stored as base relations E3 A. Lee Mech. Eng.
E4 J. Miller Programmer
Example : E5 B. Casey Syst. Anal.
CREATE VIEW SYSAN(ENO,ENAME) E6 L. Chu Elect. Eng.
E7 R. Davis Mech. Eng.
AS SELECT ENO,ENAME E8 J. Jones Syst. Anal.
FROM EMP SYSAN
WHERE TITLE=“Syst. Anal.” ENO ENAME
E2 M.Smith
E5 B.Casey
E8 J.Jones

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 3

View Management
Views can be manipulated as base relations

Example :

SELECT ENAME, PNO, RESP


FROM SYSAN, ASG
WHERE SYSAN.ENO = ASG.ENO

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 4

Page 2
Query Modification
queries expressed on views

queries expresed on base relations
Example :
SELECT ENAME, PNO, RESP
FROM SYSAN, ASG
WHERE SYSN.ENO = ASG.ENO
ENAME PNO RESP

SELECT ENAME,PNO,RESP M.Smith P1 Analyst

FROM EMP, ASG M.Smith P2 Analyst


WHERE EMP.ENO = ASG.ENO B.Casey P3 Manager
AND TITLE = “Syst. Anal.” J.Jones P4 Manager

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 5

View Management
n To restrict access
CREATE VIEW ESAME
AS SELECT *
FROM EMP E1, EMP E2
WHERE E1.TITLE = E2.TITLE
AND E1.ENO = USER
n Query
SELECT *
FROM ESAME ENO ENAME TITLE

E1 J. Doe Elect. Eng


E2 L. Chu Elect. Eng

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 6

Page 3
View Updates
n Updatable

CREATE VIEW SYSAN(ENO,ENAME)


AS SELECT ENO,ENAME
FROM EMP
WHERE TITLE=“Syst. Anal.”
n Non-updatable

CREATE VIEW EG(ENAME,RESP)


AS SELECT ENAME,RESP
FROM EMP, ASG
WHERE EMP.ENO=ASG.ENO

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 7

View Management in DDBMS


n Views might be derived from fragments.
n View definition storage should be treated as
database storage
n Query modification results in a distributed query
n View evaluations might be costly if base relations
are distributed
➠ use snapshots
u Static views - do not reflect the updates to the base relations
u managed as temporary relations - only access path is
sequential scan
u bad selectivity - snapshots behave as pre-calculated answers
u periodic recalculation

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 8

Page 4
Data Security
n Data protection
➠ prevent the physical content of data to be
understood by unauthorized users
➠ encryption/decryption
u Data Encryption Standard
u Public-key encryption

n Authorization control
➠ only authorized users perform operations they are
allowed to on the database
u identification of subjects and objects
u authentication of subjects
u granting of rights (authorization matrix)

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 9

Semantic Integrity Control


Maintain database consistency by enforcing a set
of constraints defined on the database.
n Structural constraints
➠ basic semantic properties inherent to a data model
e.g., unique key constraint in relational model

n Behavioral constraints
➠ regulate application behavior
e.g., dependencies in the relational model
n Two components
➠ Integrity constraint specification
➠ Integrity constraint enforcement

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 10

Page 5
Semantic Integrity Control
n Procedural
control embedded in each application program
n Declarative
assertions in predicate calculus
➠ easy to define constraints
➠ definition of database consistency clear
➠ inefficient to check assertions for each update
u limit the search space
u decrease the number of data accesses/assertion
u preventive strategies
u checking at compile time

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 11

Constraint Specification Language


Predefined constraints
specify the more common constraints of the relational model
➠ Not-null attribute
ENO NOT NULL IN EMP
➠ Unique key
(ENO, PNO) UNIQUE IN ASG
➠ Foreign key
A key in a relation R is a foreign key if it is a primary key of
another relation S and the existence of any of its values in R
is dependent upon the existence of the same value in S
PNO IN ASG REFERENCES PNO IN PROJ
➠ Functional dependency
ENO IN EMP DETERMINES ENAME
Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 12

Page 6
Constraint Specification Language
Precompiled constraints
Express preconditions that must be satisfied by all tuples in
a relation for a given update type
(INSERT, DELETE, MODIFY)
NEW - ranges over new tuples to be inserted
OLD - ranges over old tuples to be deleted
General Form
CHECK ON <relation> [WHEN <update type>] <qualification>

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 13

Constraint Specification Language


Precompiled constraints

➠ Domain constraint

CHECK ON PROJ(BUDGET≥500000 AND BUDGET≤1000000)

➠ Domain constraint on deletion

CHECK ON PROJ WHEN DELETE (BUDGET = 0)

➠ Transition constraint

CHECK ON PROJ (NEW.BUDGET > OLD.BUDGET AND


NEW.PNO = OLD.PNO)

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 14

Page 7
Constraint Specification Language
General constraints
Constraints that must always be true. Formulae of
tuple relational calculus where all variables are
quantified.
General Form
CHECK ON <variable>:<relation>,(<qualification>)
➠ Functional dependency
CHECK ON e1:EMP, e2:EMP
(e1.ENAME = e2.ENAME IF e1.ENO = e2.ENO)
➠ Constraint with aggregate function
CHECK ON g:ASG, j:PROJ
(SUM(g.DUR WHERE g.PNO = j.PNO) < 100 IF
j.PNAME = ÒCAD/CAMÓ)

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 15

Integrity Enforcement
Two methods
n Detection
Execute update u: D → Du
If Du is inconsistent then
compensate Du → DuÕ
else
undo Du → D
n Preventive
Execute u: D → Du only if Du will be consistent
➠ Determine valid programs
➠ Determine valid states

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 16

Page 8
Query Modification
n preventive
n add the assertion qualification to the update
query
n only applicable to tuple calculus formulae with
universally quantified variables
UPDATE PROJ
SET BUDGET = BUDGET*1.1
WHERE PNAME =“CAD/CAM”

UPDATE PROJ
SET BUDGET = BUDGET*1.1
WHERE PNAME =“CAD/CAM”
AND NEW.BUDGET ≥ 500000
AND NEW.BUDGET ≤ 1000000
Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 17

Compiled Assertions
Triple (R,T,C) where
R relation
T update type (insert, delete, modify)
C assertion on differential relations
Example: Foreign key assertion
∀g ∈ ASG, ∃j ∈ PROJ : g.PNO = j.PNO
Compiled assertions:
(ASG, INSERT, C1), (PROJ, DELETE, C2), (PROJ, MODIFY, C3)
where
C1:∀NEW ∈ ASG+, ∃j ∈ PROJ: NEW.PNO = j.PNO
C2:∀g ∈ ASG, ∀OLD ∈ PROJ- : g.PNO ≠ OLD.PNO
C3:∀g ∈ ASG, ∀OLD ∈ PROJ-, ∃NEW ∈ PROJ+:g.PNO ≠OLD.PNO
OR OLD.PNO = NEW.PNO
Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 18

Page 9
Differential Relations
Given relation R and update u
R+ contains tuples inserted by u
R- contains tuples deleted by u

Type of u
insert R- empty
delete R+ empty
modify R+ ∪ (R Ð R- )

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 19

Differential Relations
Algorithm
Input: Relation R, update u, compiled assertion Ci
Step 1: Generate differential relations R+ and RÐ
Step 2: Retrieve the tuples of R+ and RÐ which do
not satisfy Ci
Step 3: If retrieval is not successful, then the
assertion is valid.
Example :
u is delete on J. Enforcing (J, DELETE, C2) :
retrieve all tuples of J-
into RESULT
where not(C2)
If RESULT = φ, the assertion is verified.
Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 20

Page 10
Distributed Integrity Control
n Problems:
➠ Definition of constraints
u consideration for fragments

➠ Where to store
u replication
u non-replicated : fragments

➠ Enforcement
u minimize costs

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 21

Types of Distributed Assertions


n Individual assertions
➠ single relation, single variable
➠ domain constraint

n Set oriented assertions


➠ single relation, multi-variable
u functional dependency
➠ multi-relation, multi-variable
u foreign key

n Assertions involving aggregates

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 22

Page 11
Distributed Integrity Control
n Assertion Definition
➠ similar to the centralized techniques
➠ transform the assertions to compiled assertions
n Assertion Storage
➠ Individual assertions
u one relation, only fragments
u at each fragment site, check for compatibility
u if compatible, store; otherwise reject
u if all the sites reject, globally reject
➠ Set-oriented assertions
u involves joins (between fragments or relations)
u maybe necessary to perform joins to check for
compatibility
u store if compatible
Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 23

Distributed Integrity Control


n Assertion Enforcement
➠ Where do you enforce each assertion?
u type of assertion
u type of update and where update is issued
➠ Individual Assertions
u update = insert
4 enforce at the site where the update is issued
u update = qualified
4 send the assertions to all the sites involved
4 execute the qualification to obtain R+ and R-
4 each site enforce its own assertion

➠ Set-oriented Assertions
u single relation
4 similar to individual assertions with qualified updates
u multi-relation
4 move data between sites to perform joins; then send the result to
the query master site

Distributed DBMS © 1998 M. Tamer …zsu & Patrick Valduriez Page 6. 24

Page 12

You might also like