42
Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Embed Size (px)

Citation preview

Page 1: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Chapter 1: Client/Server Databases

and the

Oracle 10g Relational Database

Guide to Oracle 10g

CE
Global comments:1. Is it okay that the title slides have a purple background?2. The titles on every slide (including the first slide) are in navy blue, instead of black - okay?3. The bullets (acual bullet icon) on every other slide are in navy blue - okay?4. Also, please note that the 'g' in Oracle 10g in the footer is not italicized (I don't think it can be).Global to this PPT: Please note that the figure slides have the figure caption as slide title, not heading - okay? (The individual slides are commented.)
Page 2: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Objectives

2

Database SystemsDescribe Transaction and its properties.Describe different types of Database

Systems

Page 3: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Database Systems

3

Consists ofDBMS

Manages physical storage and data retrievalDatabase applications

Provide interface that allows users to interact with database

Server Computer that shares resources with other computers

Server process Program that listens for requests for resources from

clients Responds to requests

ClientProgram that requests and uses server resources

Page 4: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

What is a Transaction?A Transaction is any action that reads from

and/or writes to a database.A transaction may consist of

a simple SELECT statement to generate a list of table contents;

a series of related UPDATE statements to change the values of attributes in various tables.

a series of INSERT statements to add rows to one or more tables

or combination of SELECT, UPDATE and INSERT statement.

4

Page 5: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

What is a Transaction?Logical unit of work that must be either

entirely completed or aborted; no intermediate steps are acceptable.

If there are a series of SQL commands in a transaction, all of these statements must be completed successfully or not at all.

If any of the SQL statement fail, the entire transaction is rolled back to the original database state that existed before the transaction started.

5

Page 6: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

What is a Transaction?A successful transaction changes database

from one consistent state to anotherOne in which all data integrity constraints are

satisfiedTo ensure consistency, all transactions are

controlled and executed by the DBMS to guarantee database integrity.

Most real-world database transactions are formed by two or more database requestsA database request is equivalent of a single

SQL statement in an application program or transaction

6

Page 7: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Evaluating Transaction Results Improper or incomplete transactions can

have devastating effect on database integritySome DBMSs provide means by which user

can define enforceable constraints based on the business rules

Other integrity rules (referential and entity integrity) are enforced automatically by the DBMS when the table structures are properly defined.

7

Page 8: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Transaction PropertiesEach transaction must display atomicity, consistency, isolation and durability.Atomicity

All operations of a transaction must be completed. A transaction is treated as a single, indivisible, logical unit of work.

Consistency Permanence of database’s consistent state. If any part of a transaction violates an integrity

constraint, the entire transaction is aborted.

8

Page 9: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Transaction PropertiesEach transaction must display atomicity, consistency, isolation and durability.Atomicity

All operations of a transaction must be completed. A transaction is treated as a single, indivisible, logical unit of work.

Consistency Permanence of database’s consistent state. If any part of a transaction violates an integrity

constraint, the entire transaction is aborted.

9

Page 10: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Transaction Properties (continued)Isolation

Data used during transaction cannot be used by second transaction until the first is completed

Durability Once transactions are committed, they cannot

be undone or lost, even in the event of a system failure.

SerializabilityEnsures that the schedule for the concurrent

execution of several transactions yields consistent results.

10

Page 11: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

The Transaction LogA DBMS uses a Transaction log to keep track

of all transactions that update the database.The information stored in this log is used by the

DBMS for a recovery requirement triggered by a ROLLBACK statement,a program’s abnormal terminationa system’s failure such as a disk or network

failure.While the DBMS executes transactions that

modify the database, it also automatically updates the transaction log.

Database Systems, 9th Edition11

Page 12: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

The Transaction LogTransaction log stores:

A record for the beginning of transactionFor each transaction component:

Type of operation being performed (update, delete, insert)

Names of objects affected by transaction“Before” and “after” values for updated fieldsPointers to previous and next transaction log entries

for the same transactionEnding (COMMIT) of the transaction

Database Systems, 9th Edition12

Page 13: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Database Systems, 9th Edition13

Page 14: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Types of Database Systems Personalized Database SystemsClient Server Database SystemsDistributed Database Systems

14

Page 15: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Personal Database Management Systems

15

DBMS and database applications run on same workstation

Appear to user as a single integrated application

Used primarily for creating single-user database applications

Can also be used for some multiuser applications

Should be used only for applications that are not mission critical

Page 16: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Using a Personal Database for a Multiuser Application

16

CE
Slide title is figure caption, not heading - okay?This seems odd b/c it comes b/w slides with the same header/title.
Page 17: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Personal Database Management Systems (continued)

17

Microsoft AccessStores all data for database in a single file

with an .accdb extensionDatabase administrator stores .accdb file on

a central file server.Each client workstation loads the entire

DBMS into main memory along with the database applications to view, insert, update or print data.

Impose heavy load on client workstations and on the network.

Problems with transaction Processing

Page 18: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Client/Server Database Management Systems

18

DBMS server process runs on one workstation

Database applications run on separate client workstations across network

Server DBMS process runs on the database server and listens for requests from clients.

Server sends only requested data back to client rather than entire database.

Page 19: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Client/Server Database Architecture

19

Page 20: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Distributed Processing in Client Server Architecture

20

Database’s logical processing is shared among two or more physically independent sites that are connected through a network

Example: the data input/output, data selection and data validation might be performed on one client and a report based on that data might be created on another client.

Page 21: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

21

Page 22: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Client/Server Database Management Systems (continued)

22

Generate less network traffic than personal databases

Extra features to minimize chance of failuremanagement and control is improved

Powerful recovery mechanisms that often operate automatically

Maintain file-based transaction log on database server

Page 23: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

The Oracle 10g Client/Server Database

23

Oracle 10g- Client/server databaseServer side

DBMS server processOracle Net

Utility that enables network communication between client and server

Page 24: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

The Oracle 10g Client/Server Database (continued)

24

Oracle Application ServerUsed to create World Wide Web pages that

allow users to access Oracle databases Oracle client products:

SQL*PlusOracle 10g Developer SuiteEnterprise Manager

Page 25: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Distributed Databases

25

Stores logically related database over two or more physically independent sites which are connected via a computer network.

A Database is composed of database fragments which are located at different sites and can be replicated among various sites. Each database fragment is managed by its local database process.

Page 26: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

26

Page 27: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Distributed Databases

27

Distributed processing does not require a distributed database, but a distributed database requires distributed processing. Each database fragment is managed by its own local database process.

Distributed processing may be based on a single database located on a single computer. Copies or parts of the database processing functions must be distributed to all storage sites.

Both distributed processing and distributed require a network to connect all components.

Page 28: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Characteristics of Distributed Management Systems (continued)

28

A fully distributed database management system must perform all of the functions of a centralized DBMS as follows:Receive an end user’s request.Validate, analyze and decompose the request.Map the request’s logical-to-physical data componentsDecompose the request into several disk I/O operations.Search for, locate, read and validate the data.Ensure database consistency, security and integrity.Validate the data for the conditions, if any, specified by

the request.Present the selected data in the required format.

In addition to that, a distributed DBMS must handle all necessary functions imposed by the distribution of data and processing transparently to the end user.

Page 29: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

29

Page 30: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

DDBMS Components

30

Must include (at least) the following components:Computer workstations: (sites or nodes) that

form the network system. The distributed database system must be independent of the computer system hardware.

Network hardware and software : components that reside in each workstation. Allow all sites to interact and exchange data. Distributed database can also work on multiple platform.

Data processor or data manager Software component residing on each computer that

stores and retrieves data located at the site May be a centralized DBMS

Page 31: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Database Systems, 8th Edition31

DDBMS ComponentsCommunications media : that carry the

data from one workstation to another. DDBMS must be able to support several types of communication media.

Transaction processor (application processor, transaction manager)Software component found in each computer that

requests data.Receives and processes the application’s data

requests (remote and local).

Page 32: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Types of Distributed SystemsSingle-Site Processing, Single-Site Data (SPSD)Multiple-Site Processing, Single-Site Data

(MPSD)Multiple-Site Processing, Multiple-Site Data

(MPMD) (continued)

32

Page 33: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Single-Site Processing, Single-Site Data (SPSD)

33

All processing is done on single CPU or host computer (single processor or multi processor server, mainframe, midrange, or PC)

All data storage and data processing are stored on host computer’s local disk

Processing cannot be done on end user’s side of system

Typical of most mainframe and midrange computer DBMSs

DBMS is located on host computer, which is accessed by dumb terminals connected to it

Page 34: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

34

TP and DP are embedded with the DBMS located on a single computer.The DBMS runs under a time-sharing, multi-tasking OS which allows several processes to run concurrently on a host computer accessing a single DP.

Page 35: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Multiple-Site Processing, Single-Site Data (MPSD)

35

Multiple processes run on different computers sharing single data repository

MPSD scenario requires network file server running conventional applications that are accessed through a network (LAN)

Many multiuser accounting applications, running under personal computer network fit such a description.

Page 36: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

36

Page 37: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Multiple-Site Processing, Single-Site Data (MPSD)

37

The TP on each workstation acts only as a redirector to route all network data requests to the file server.

The end user sees the file server as just another hard disk because only the data storage I/O is handled by the file server’s computer.

The end user must make a direct reference to the file server in order to access remote data.

All record and file locking activities are done at the end-user location.

All data selection, search and update functions take place at the workstation, thus requiring that entire files travel through the network for processing at the workstation. Such a requirement increases network traffic, slows response time and increases communication costs.

Page 38: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Multiple-Site Processing, Single-Site Data (MPSD)

38

Suppose the file server computer stores a CUSTOMER table containing 10,000 rows, 50 of which have balance greater than $1,000. Suppose site A issue the following query:

SELECT *FROM CUSTOMERWHERE CUS_BALANCE > 1000;

All 10,000 CUSTOMER rows must travel through the network to be evaluated at site A.

Page 39: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Multiple-Site Processing, Single-Site Data (MPSD)

39

A variation of the multiple-site processing, single-site data approach is know as client/server architecture, which is similar to that of the network fileserver except that all database processing is done at the server site, thus reducing network traffic.

Although both the network fileserver and the client/server systems performs multiple-site processing, the latter’s processing is distributed.

Network fileserver approach requires the database to be located at a single site, whereas the Client/server architecture is capable of supporting data at multiple sites.

Page 40: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Multiple-Site Processing, Multiple-Site Data (MPMD)

40

Fully distributed database management system

Support for multiple data processors and transaction processors at multiple sites

Depending on the level of support for various types of centralized DBMs, DDBMs are classified as either homogeneous or heterogeneous

Homogeneous DDBMSs Integrate only one type of centralized DBMS over

a networkSame DBMS will be running on different server

platforms .

Page 41: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

Multiple-Site Processing, Multiple-Site Data (MPMD) (continued)

41

Heterogeneous DDBMSsIntegrate different types of centralized

DBMSs over a network Fully heterogeneous DDBMSs

Support different DBMSs that may evenSupport different data models (relational,

hierarchical, or network) running underDifferent computer systems, such as

mainframes and microcomputers

Page 42: Chapter 1: Client/Server Databases and the Oracle 10g Relational Database Guide to Oracle 10g

42