1 / 14

Distributed Databases

Distributed Databases. For each employee, retrieve employee & dept. 3 Alternative solutions: 1. Transfer both Employee and Department and perform join at Site 3. 2. Transfer the Employee to site 2, execute the join, send the result to Site 3

carrington
Télécharger la présentation

Distributed Databases

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distributed Databases

  2. For each employee, retrieve employee & dept. 3 Alternative solutions: 1. Transfer both Employee and Department and perform join at Site 3. 2. Transfer the Employee to site 2, execute the join, send the result to Site 3 3. Transfer the Department to site 1, execute join, send both to site 3. 4. Use a semijoin operation. Project the columns needed before transferring.

  3. Query Decomposition • Must break up a query into subqueries that can be executed at the individual sites • Distributed and Replication Transparency: end-users and programmers must see the DB as if it was not distributed or replicated • At each site, there must be a list of distribution, fragmentation and replication. (p.823-824)

  4. Create a Database Link • schema object in the local database to access a remote database. • remote db may be non-Oracle system (but you need to purchase a Oracle add on) • Example: CREATE DATABASE LINK sales.hq.acme.com CONNECT TO scott IDENTIFIED BY tiger USING 'sales'; SELECT * FROM emp@sales.hq.acme.com;

  5. Fragmentation Transparency(DD with Horizontal Partition) Create Salesview as Select * from sales@NY Union Select * from Sales@LA union Select * from Sales@Atlantadb; ------------------------------------------------- Select * from Salesview;

  6. Fragmentation Transparency(DD with Vertical Partition) SalesPart (pnum, cost, qty) at NY database EngPart (pnum, materialType, supplier) at LA database Create View Part as Select pnum, cost, qty, materialType, supplier From SalesPart@NY sp, EngPart@LA ep Where sp.pnum = ep.pnum; ----------------------------------------------------------------------- Select * from Part;

  7. 2 Phase Commit Phase 1: prepare to commit. Each participant writes log buffer to disk and reply to coordinator (DB that establishes link) Phase 2: if all databases reply OK, the coordinator will send a commit to all. Otherwise, everything is rolled back. • Page 629-630 (Navathe) • 2 phase commit in oracle • Example in DB2

More Related