Sie sind auf Seite 1von 123

Regional College of Management, Bhubaneswar

Management Information System


Subrat Kumar Parida
MIS (3rd Trimester) Regional College of Management Bhubaneswar.

9/18/2012

MIS

Regional College of Management, Bhubaneswar

Information is Critical
The

information we have is not what we want, information we want is not the information we need, information we need is not available.
ITM 574 2

The

The

9/18/2012

Regional College of Management, Bhubaneswar

Information is a Resource
It is scarce It has a cost It has alternative uses There is an opportunity cost factor involved if one does not process information

9/18/2012

ITM 574

Regional College of Management, Bhubaneswar

Why need Information?

To ensure effective and efficient decision making leading to prosperity of the Organisation.

9/18/2012

ITM 574

Regional College of Management, Bhubaneswar

What is MIS?
MIS

refers broadly to a computer-based system that provides managers with the tools for organizing, evaluating and efficiently running their departments.

9/18/2012

ITM 574

Regional College of Management, Bhubaneswar

What is MIS?

Right Information To the right person At the right place At the right time In the right form At the right cost
ITM 574 6

9/18/2012

Regional College of Management, Bhubaneswar

The three sub-components


Management, Information

together

bring out the focus clearly & effectively.

System

9/18/2012

ITM 574

Regional College of Management, Bhubaneswar

The three sub-components

System emphasizing a fair degree of integration and a holistic view; Information stressing on processed data in the context in which it is used by end users;

Management

focusing on the ultimate use of such information systems for managerial decision making.
8

9/18/2012

ITM 574

Regional College of Management, Bhubaneswar

The Concept of MIS

9/18/2012

ITM 574

Regional College of Management, Bhubaneswar

Why MIS?
Increased

Business & Management Complexities

9/18/2012

ITM 574

10

Regional College of Management, Bhubaneswar

Increased Business Complexities

Technological Revolution Research & Development Explosion of Information

9/18/2012

ITM 574

11

Regional College of Management, Bhubaneswar

Increased Management Complexities

Management Science Technologies Decision-making Onset of Computers

9/18/2012

ITM 574

12

Regional College of Management, Bhubaneswar

Functional Uses of MIS


Enhance : Quality of our operations Quality of our services We achieve : Efficiency Transparency Speedy Decision making
9/18/2012
ITM 574 13

Regional College of Management, Bhubaneswar

Strategic Uses of MIS


Precise development of strategies, planning, forecasting and monitoring Problem solving Decision-making Separate work from location

9/18/2012

ITM 574

14

Regional College of Management, Bhubaneswar

Definition:
An

information system can be any organized combination of


people, hardware, software, computer networks and data resources

that

stores and retrieves, transforms, and disseminates information in an organization.


ITM 574 15

9/18/2012

Regional College of Management, Bhubaneswar

Roles of IS in Business:
There

are three fundamental reasons for all business applications of information technology. They are found in the three vital roles that information system can perform for a business enterprise.

Support of its business processes and operations. Support of decision making by its employees and managers. Support of its strategies for competitive 9/18/2012 advantage. ITM 574 16

Regional College of Management, Bhubaneswar

Trends in IS:
The business applications of information systems have expanded significantly over the years. Data Processing (1950s 1960s): Electronic data processing systems which includes transaction processing, record keeping, and traditional accounting applications. Management Reporting (1960s 1970s): Management information systems that include preparation of management reports of pre specified information to support decision making. Decision Support (1970s 1980s): Decision support systems include interactive ad hoc support of managerial decision making process. Strategic and End User Support (1980s 1990s):
End user computing systems: Direct computing support for end user productivity and work group collaboration. Executive information systems: Critical information for top management. Expert Systems: Knowledge based expert advice for end users. Strategic Information Systems: Strategic products and services for competitive advantage.

Electronic Business and Commerce (1990s 2000s):

Internet based e-business and e-commerce systems: Web enabled 9/18/2012 enterprise and global e-business574 ITM operations and electronic commerce on 17 the internet, intranets, extranets, and other networks.

Regional College of Management, Bhubaneswar

Types of Information System:


Conceptually

the applications of information systems that are implemented in todays business world can be classified in several different ways. Several types information systems can be classified as
Operations Support System Management Information Systems
9/18/2012
ITM 574 18

Regional College of Management, Bhubaneswar

Operations Support System:

Information systems have always been needed to process data generated by and used in, business operations.
Produce a variety of information products for internal and external use. Do not emphasize producing the specific information products that can best be used by managers. The role of a business firms operations support system is to
efficiently process business transactions, control industrial processes, support enterprise communications and collaborations and update corporate databases.
ITM 574 19

9/18/2012

Regional College of Management, Bhubaneswar

Transaction Processing Systems:


Are

an important example of operations support system that record and process data resulting from business transactions.

9/18/2012

ITM 574

20

Regional College of Management, Bhubaneswar

Process Control Systems:


Monitors

and controls physical processes.


They enhance team and workgroup communications and productivity, and include applications that are sometimes called as office automation systems.

9/18/2012

ITM 574

21

Regional College of Management, Bhubaneswar

Management Support Systems:


When

information systems applications focus on providing information and support for effective decision making by managers, they are called management support systems.
Providing information and support for decision making by all types of managers and business professionals is a complex task.

9/18/2012

ITM 574

22

Regional College of Management, Bhubaneswar

Management Information System:


MIS

provides information in the form of reports and displays to managers and many business professionals.

9/18/2012

ITM 574

23

Regional College of Management, Bhubaneswar

Decision Support System:


DSS

give direct computer support to managers during the decision making process.

9/18/2012

ITM 574

24

Regional College of Management, Bhubaneswar

Executive Information System:


EIS

provide critical information from a wide variety of internal and external sources easy to use touch screen terminals to instantly view text and groups display that highlights key areas of organizational and competitive performance.
ITM 574 25

9/18/2012

Regional College of Management, Bhubaneswar

Information System Resources:


An

information system consists of five major resources:


People Resources: Hardware Resources: Software Resources: Data Resources: Network Resources:

9/18/2012

ITM 574

26

Regional College of Management, Bhubaneswar

People Resources:
People

are an essential ingredient for the successful operation of all information system.
The people resources include end users and IS specialists.

9/18/2012

ITM 574

27

Regional College of Management, Bhubaneswar

Hardware Resources:
The

concept of hardware resources include all physical devices and materials used in information processing.
Specifically, it includes not only machines, such as computers and other equipment, but also all data media, from sheets of paper to magnetic or optical disks.

9/18/2012

ITM 574

28

Regional College of Management, Bhubaneswar

Software Resources:
The

concept of software resources includes all sets of information processing instructions.


This generic concept of software includes not only the set of operating instructions called programs, which direct and control computer hardware, but also the sets of information processing instructions called procedures that people need.

9/18/2012

ITM 574

29

Regional College of Management, Bhubaneswar

Data Resources:
Data

are more than raw materials of information system. The concept of data resources has been broadened by managers of information systems professionals. They realize that data constitute valuable organizational resources. Thus data is viewed as an important resource that must be managed effectively to benefit the end users in an organization.
9/18/2012
ITM 574 30

Regional College of Management, Bhubaneswar

Network Resources:
Telecommunications

technologies and networks like the internet, intranet and extranet are essential to the successful electronic business and commerce operations of all types of organizations and their computer based information systems.
Telecommunications networks consist of computers, communications processors and other devices interconnected by communication media and controlled by communications software.

9/18/2012

ITM 574

31

Regional College of Management, Bhubaneswar

IS Activities:
The

basic information processing activities that occur in information system includes


inputting, storing, processing, outputting and controlling.

9/18/2012

ITM 574

32

Regional College of Management, Bhubaneswar

Inputting:

Data about business transactions and other events must be captured and prepared for processing by the input activity.
Input typically takes the form of data entry activities such as recording and editing. End users typically enter data directly into a computer system, or record about transactions on some type of physical medium such as a paper form. This usually includes a variety of editing activities to ensure that they have recorded data correctly. Once recorded data may be transferred onto a machine readable medium such as a magnetic disk until needed for processing.

9/18/2012

ITM 574

33

Regional College of Management, Bhubaneswar

Processing:
Data

are typically subjected to processing activities such as calculating, comparing, sorting, classifying and summarizing.
These activities organize, analyze, and manipulate data, thus converting them into information for end users. The quality of any data stored in an information system must also be maintained by a continual process of correcting and updating activities.

9/18/2012

ITM 574

34

Regional College of Management, Bhubaneswar

Outputting:
Information

in various forms is transmitted to end users and make available to them in the output activity.
The goal of information system is the production of appropriate information products for end users.

Common

information products include messages, reports, forms and graphic images, which may be provided by video displays, audio responses, paper products and multimedia.
ITM 574 35

9/18/2012

Regional College of Management, Bhubaneswar

Storing:
Storage

is the basic system component of information system.


Storage is the information system activity in which data and information are retained in an organized manner for later use. This facilitates their later use in processing or retrieval as outputs when needed by users of a system.

9/18/2012

ITM 574

36

Regional College of Management, Bhubaneswar

Controlling:
An

important information system activity is the control of system performance.

An information system should produce feedback about its input, processing, output, and storage activities. The feedback must be monitored and evaluated to determine if the system is meeting established performance 9/18/2012 standards. ITM 574

37

Regional College of Management, Bhubaneswar

Water Fall Model


Project Initiation System Analysis & Feasibility Study Logical Analysis & Design Accusation or Development Implementation

Operation Post Audit

Maintenance

9/18/2012

Go Back to the Previous Stage or Stop ITM 574

38

Regional College of Management, Bhubaneswar

Project Initiation
Usually

it is the manager outside the IS organisation who has a problem or sees an opportunity.
A formal planning process also may identify new systems that can help the organisation meet its objectives.

9/18/2012

ITM 574

39

Regional College of Management, Bhubaneswar

System Analysis
System

analysis refers to the investigation of the existing situation. is a process that may take weeks, or months involving many activities. aims at providing a thorough understanding of existing organisations and its operations.
ITM 574 40

It

It

9/18/2012

Regional College of Management, Bhubaneswar

System Analysis Activities


Isolating

the symptoms of the problem the cause

Determining Identification

of business process and their interrelations. of Information related to these processes


ITM 574 41

Flow

9/18/2012

Regional College of Management, Bhubaneswar

System Analysis deals with


People Procedures

involved

The
The

existing information system technology


environment surrounding the problem
ITM 574 42

9/18/2012

Regional College of Management, Bhubaneswar

System Analysis Methods


Observation Review

of Documents

Interviews
Performance
9/18/2012

Measurements
ITM 574 43

Regional College of Management, Bhubaneswar

Feasibility Studies
To

determine the probability of success of a proposed solution. May be conducted several times throughout SDLC To test whether the solution is achievable with given organisational resources and constraints.
9/18/2012
ITM 574 44

Regional College of Management, Bhubaneswar

Technological Feasibility
Are

the performance requirements achievable utilizing current information technology? not, are they attainable through capabilities that will be available by the time the project finishes?

If

newer technologies supersede in the proposed project before the organisation recovers its investment? 9/18/2012 ITM 574

Will

45

Regional College of Management, Bhubaneswar

Economical Feasibility
Are

the expected benefits greater than the costs? the organisation afford the costs in terms of spending and personal requirements?

Can

the risks including the possibility of cost and schedule overruns, acceptable for an 9/18/2012 ITM 574 46 investment of this size.

Are

Regional College of Management, Bhubaneswar

Organisational Factors
Is

the proposed system reasonably compactable with organisational culture, internal political considerations, and work rules. Are the skill levels to use the new system consistent with employees who will operate it.
9/18/2012
ITM 574 47

Regional College of Management, Bhubaneswar

Legal Ethical & Other Constraints


Is

the new or automated process ethical to employees and customers? it meets all regulatory requirements?

Does

Are
9/18/2012

any of the constraints in danger of being violated.


ITM 574 48

Regional College of Management, Bhubaneswar

Logical Design
The

emphasis is on

Identification of information requirements Specification of generic IS functions, such as input, output and storage. Not on program writing or identifying hardware.

9/18/2012

ITM 574

49

Regional College of Management, Bhubaneswar

Logical Designing Tools


Data

Flow Diagram Entity Relationship Diagram Flow Charts Hierarchy Inputs Process Outputs Charts Organisational Charts

9/18/2012

ITM 574

50

Regional College of Management, Bhubaneswar

Physical Design
Translation

of abstract logical model into the specific technical design for the new systems. Emphasis is on
User requirements of the system Computing requirements to features of available software Less time on designing systems. Configuration requirements for commercial packages
9/18/2012
ITM 574 51

Regional College of Management, Bhubaneswar

Acquisition or Development

Using the specifications proposed in Logical Design hardware and software are purchased. Configuration of the same as per the system requirements. Programmers write code for parts of the system where commercial sources are not appropriate. Technical writers develop documentation and training materials. Testing is done by IS personnel and some users for bugging and comparing system performance.

9/18/2012

ITM 574

52

Regional College of Management, Bhubaneswar

Implementation
Implementing

a new system requires conversion from a previous system Approaches:


Parallel Conversion:
Old and New system operate concurrently Safest approach The most expensive

Direct Cutover:
The Old system is turned off, and new system is turned on Fastest and least expensive Risk factor is the maximum
9/18/2012
ITM 574 53

Regional College of Management, Bhubaneswar

Pilot Conversion:
The new system is implemented in a subset of locations. Is like a direct cutover for pilot locations But for the whole organisation, it is like parallel conversion Both risks and costs are relatively low.

Phased Conversion:
Large systems often are built from distinct modules. If the modules were originally designed to be relatively independent, it may possible to replace the modules one at a time. Relatively safer Takes longer & requires more testing ITM 574 54

9/18/2012

Regional College of Management, Bhubaneswar

Operation:
After

successful conversion, the system will operate for an indefinite period of time, until
The system is no longer adequate Necessary Cost effective

9/18/2012

ITM 574

55

Regional College of Management, Bhubaneswar

Post Audit
Post

Audits introduce an additional element of decline into the development process.


The feedbacks from comparison of actual performance to specifications can help analysts to make better estimates on future projects.

9/18/2012

ITM 574

56

Regional College of Management, Bhubaneswar

Maintenance
Every

system needs two kinds of maintenance


Bugs: Updates:

9/18/2012

ITM 574

57

Regional College of Management, Bhubaneswar

Normalization
Data

structuring is refined through a process called Normalization.


Data

grouped in the simplest way possible so that later changes can be made with a minimum impact on data structure.

9/18/2012

ITM 574

58

Regional College of Management, Bhubaneswar

9/18/2012

ITM 574

59

Regional College of Management, Bhubaneswar

When

too many attributes are grouped together to form entities, some attributes are found to be entities themselves.
Further normalization of these entities into attributes linked by common data elements to form relationships improves the effectiveness of DBMS.

9/18/2012

ITM 574

60

Regional College of Management, Bhubaneswar

1st Normalization:
Isolate

repeating groups from an entity because they are easier to process


separate from the rest of an entity

9/18/2012

ITM 574

61

Regional College of Management, Bhubaneswar

Un Normalized Table
Employee Number 211306 211306 211306 211306 301421011 301421011 419846204 419846204 419846204 612047216 Employee Name Arnold Jim Arnold Jim Arnold Jim Arnold Jim Zmud Bill Zmud Bill Belo Jack Belo Jack Belo Jack Bony Tom Store Branch Downtown Downtown Downtown Downtown Dadeland Dadeland Detroit Detroit Detroit Frog St. Department Hardware Hardware Hardware Hardware Home Appliances Home Appliances Auto Parts Auto Parts Auto Parts Mens Clothing Item Number TR100 SA10 PT65 AB165 TT14 DS104 MC164 AC148 BB100 HS101 Item Description Router Saw Drill Cutter Humidifier Dish Washer Snow Tire Alternator Battery 3 Pc Suit Sale Price $36 $10 $21 $12 $245 $262 $85 $65 $49 $215

Sales person

Sales

9/18/2012

ITM 574

62

Regional College of Management, Bhubaneswar

First Normalization
Employee Number 211306 301421011 419846204 612047216 Employee Name Arnold Jim Zmud Bill Belo Jack Bony Tom Store Branch Downtown Dadeland Detroit Frog St. Department Hardware Home Appliances Auto Parts Mens Clothing Employee Number 211306 Item Number TR100 Item Description Router Sale Price $36

211306
211306 211306 30142101

SA10
PT65 AB165 TT14 DS104 MC164 AC148 BB100

Saw
Drill Cutter Humidifier Dish Washer Snow Tire Alternator Battery

$10
$21 $12 $245 $262 $85 $65 $49

Sales Person Data File

30142101 419846204 419846204 419846204

612047216

HS101

3 Pc Suit

$215

Sales Person Item File

9/18/2012

ITM 574

63

Regional College of Management, Bhubaneswar

2nd Normal Form:


The

2nd Normal Form makes sure that each non key attribute depends on a key attribute or concatenated key.
Non key attribute that do not meet this condition are split into simpler entities

9/18/2012

ITM 574

64

Regional College of Management, Bhubaneswar

2nd Normal Form


Employee Number 211306 301421011 419846204 612047216 Employee Name Arnold Jim Zmud Bill Belo Jack Bony Tom Store Branch Downtown Dadeland Detroit Frog St. Department Hardware Home Appliances Auto Parts Mens Clothing

Sales Person Data File


Employee Number 211306 211306 211306 211306 30142101 30142101 419846204 419846204 419846204 612047216 Item Number TR100 SA10 PT65 AB165 TT14 DS104 MC164 AC148 BB100 HS101 Sale Price $36 $10 $21 $12 $245 $262 $85 $65 $49 $215 Item Number TR100 SA10 PT65 AB165 TT14 DS104 MC164 AC148 BB100 HS101 Item Description Router Saw Drill Cutter Humidifier Dish Washer Snow Tire Alternator Battery 3 Pc Suit

Sales Person Item File

Item File

9/18/2012

ITM 574

65

Regional College of Management, Bhubaneswar

3rd Normal Form:

If there exists some relationship between the non key attributes then
they are separated into separate entities.

9/18/2012

ITM 574

66

Regional College of Management, Bhubaneswar

3rd Normal Form


Employee Number 211306 301421011 419846204 612047216 Employee Name Arnold Jim Zmud Bill Belo Jack Bony Tom Store Branch Downtown Dadeland Detroit Frog St. Store Branch Downtown Dadeland Department Hardware Home Appliances

Detroit
Frog St.

Auto Parts
Mens Clothing

Sales Person Data File


Employee Number 211306 211306 211306 211306 30142101 30142101 419846204 419846204 419846204 612047216 Item Number TR100 SA10 PT65 AB165 TT14 DS104 MC164 AC148 BB100 HS101 Sale Price $36 $10 $21 $12 $245 $262 $85 $65 $49 $215 Item Number TR100 SA10 PT65 AB165 TT14 DS104 MC164 AC148 BB100 HS101

Store Branch File


Item Description Router Saw Drill Cutter Humidifier Dish Washer Snow Tire Alternator Battery 3 Pc Suit

Sales Person Item File

Item File

9/18/2012

ITM 574

67

Regional College of Management, Bhubaneswar

Transactions:
Collections

of operations that form a single logical unit of work are called transactions.
A database system must ensure proper execution of transactions despite failures either the entire transaction executes, or none of it does. It must manage concurrent execution of transactions in a way that avoids the introduction of inconsistency.

9/18/2012

ITM 574

68

Regional College of Management, Bhubaneswar

An example:
A transfer of funds from a checking account to a savings account is a single operation when viewed from a customers standpoint; within the database however it comprises of several operations.
Clearly

this is essential that all these operations occur, or that, in case of failures, none occur.
It would not be acceptable if the checking account were debited, but the savings account were not credited.

9/18/2012

ITM 574

69

Regional College of Management, Bhubaneswar

Transaction Concept
A

transaction is a unit of program execution that accesses and possibly updates various data.
A transaction usually results from the execution of a user program written in a high level data manipulation language or programming language.

9/18/2012

ITM 574

70

Regional College of Management, Bhubaneswar

Properties
To

ensure integrity of the data the database system maintains the following properties:
Atomicity Consistency Isolation Durability

9/18/2012

ITM 574

71

Regional College of Management, Bhubaneswar

Atomicity
Either

all operations of the transaction are reflected properly in the database or none are.

9/18/2012

ITM 574

72

Regional College of Management, Bhubaneswar

Consistency
Execution

of transaction in isolation (that is with no other transaction executing concurrently) preserves the consistency of the database.

9/18/2012

ITM 574

73

Regional College of Management, Bhubaneswar

Isolation:
Even

though multiple transactions may execute concurrently, the system guarantees that
For every pair of transaction Ti and Tj it appears to Ti that either Tj finished execution before Ti started or Tj started execution after Ti finished.

9/18/2012

ITM 574

74

Regional College of Management, Bhubaneswar

Durability
After

a transaction completes successfully, the changes it has made to the database persists even if there are system failures.
Ensuring durability is the responsibility of a component of the database system called the recovery management component.

9/18/2012

ITM 574

75

Regional College of Management, Bhubaneswar

example

Suppose that, just prior to the execution of transaction Ti the values of Account A and B are 1000$ and 2000$ respectively. Now suppose that during the execution of transaction Ti a failure has occurred that prevented Ti from completing this execution successfully. Further, suppose that the failure happened after write(A) operation was executed, but before the write(B) operation. As the result of the failure the state of the system no longer reflects a real state of the world. Such a state is termed as inconsistent.

9/18/2012

ITM 574

76

Regional College of Management, Bhubaneswar

Ensuring Atomicity is handled by a component called the transaction management component.


The database system keeps track (on disk) of the old values of any data on which a transaction performs a write. If the transaction does not complete its execution, the old values are restored to make it appear as though the transaction never executed.

9/18/2012

ITM 574

77

Regional College of Management, Bhubaneswar

Another example

The database remains in a temporary inconsistent state while the transaction to funds transfer from A to B is executing. With the deducted total written to A and the increased total yet to be written to B If a 2nd concurrently running transaction reads A and B and at this intermediate point computes A+B it will observe an inconsistent value. Further more if this inconsistent transaction performs a write operation leads the database into an inconsistent state.
ITM 574 78

9/18/2012

Regional College of Management, Bhubaneswar

Solution:
A

solution to the problem of concurrently executing transaction is to execute them serially that is one after the other.
However concurrent execution of transactions provides significant performance benefits.

Ensuring

the isolation property is the responsibility of a component of database systems called the concurrency control component.
ITM 574 79

9/18/2012

Regional College of Management, Bhubaneswar

Transaction State
In

the absence of failures, all transactions complete successfully.


However a transaction may not always completes its execution successfully. Such a transaction is termed aborted.

9/18/2012

ITM 574

80

Regional College of Management, Bhubaneswar

Aborted State:
To

ensure atomicity an aborted transaction must have no effect on the state of the database. Thus any changes that the aborted transaction made to the database must be undone. Once the changes caused by an aborted transaction have been undone, we say that the transaction has been rolled back.
9/18/2012
ITM 574 81

Regional College of Management, Bhubaneswar

Committed State
A

transaction that completes its execution successfully is said to be committed. A committed transaction that has performed updates transforms the database into a new consistent state, which must persists even if there is a system failure. Once a transaction has committed we cannot undo its effects by aborting it.
9/18/2012
ITM 574 82

Regional College of Management, Bhubaneswar

The

only way to undo this effect is to execute a compensating transaction.


However it is not always possible to create such a compensating transaction Therefore it is the responsibility of writing and executing a compensating transaction is left to the user.

9/18/2012

ITM 574

83

Regional College of Management, Bhubaneswar

Active:
The

Initial State

The transaction stays in this state while it is executing.

9/18/2012

ITM 574

84

Regional College of Management, Bhubaneswar

Partially Committed
After

the final statement has been executed

9/18/2012

ITM 574

85

Regional College of Management, Bhubaneswar

Failed
After

the discovery that normal execution can no longer proceed.

9/18/2012

ITM 574

86

Regional College of Management, Bhubaneswar

Aborted
After

the transaction has been rolled back and the database has been restored to the state prior to the start of the transaction

9/18/2012

ITM 574

87

Regional College of Management, Bhubaneswar

Committed
After

successful completion

9/18/2012

ITM 574

88

Regional College of Management, Bhubaneswar

Partially Committed

Committed

Active

Failed

Aborted

9/18/2012

ITM 574

89

Regional College of Management, Bhubaneswar

transaction is said to be a committed transaction only if it has entered the committed state. transaction has aborted only if it has entered the aborted state. transaction is said to have terminated if it has either committed or aborted.
ITM 574 90

9/18/2012

Regional College of Management, Bhubaneswar

transaction starts in the active state.

When

it finishes its final statement it enters the partial committed state.


At this point the transaction has completed its execution, but it is still possible that it may have to be aborted, since the actual output may still in main memory, and thus a hardware failure may preclude its successful completion.

9/18/2012

ITM 574

91

Regional College of Management, Bhubaneswar

The

database system then writes out enough information to disk, when the last of this information is written out, the transaction enters the committed state.

9/18/2012

ITM 574

92

Regional College of Management, Bhubaneswar

transaction enters the failed state after the system determines that the transaction can no longer proceed.
Such a transaction must be rolled back At this point the transaction has two options.
Restart the Transaction: Kill the Transaction

9/18/2012

ITM 574

93

Regional College of Management, Bhubaneswar

Restart the Transaction


A

transaction is restarted only when the transaction was aborted as a result of some hardware or software errors.
A restarted transaction is considered to be a fresh transaction.

9/18/2012

ITM 574

94

Regional College of Management, Bhubaneswar

Kill the Transaction


A

transaction is killed when there exists

some internal logical error that can be corrected only by rewriting of application programs, or because the input was bad or because the desired data was not found in the database.

9/18/2012

ITM 574

95

Regional College of Management, Bhubaneswar

Implementation Techniques
The

recovery management component of database system implements the support of atomicity and durability.
The 1st scheme assumes that only one transaction is active at a time and is based on making copies of the database called shadow copies.

9/18/2012

ITM 574

96

Regional College of Management, Bhubaneswar

Shadow Paging
This

scheme assumes that the database is simply a file on the disk.


A pointer called db_pointer is maintained on the disk that points to the current copy of the database. In the shadow database a transaction that wants to update the database first creates a complete copy of the database. The original copy or the shadow copy is left untouched.

9/18/2012

ITM 574

97

Regional College of Management, Bhubaneswar

If at any point the transaction has to be aborted, the new copy is merely deleted. If the transaction completes the new copy then becomes the current copy of the database. The old copy of the database is then deleted.

9/18/2012

ITM 574

98

Regional College of Management, Bhubaneswar

Concurrency Control
When

several transactions execute concurrently, the isolation property may no longer be preserved.
It is necessary for the system to control the interaction among the concurrent transactions. This control is achieved through one of the variety of mechanisms called concurrency control schemes.

9/18/2012

ITM 574

99

Regional College of Management, Bhubaneswar

Lock Based Protocols


One

way to ensure serializability to require that access the data items be done in a mutually exclusively manner.
While one transaction is accessing a data item, no other transaction can modify that data item. The most common method used to implement this requirement is to allow a transaction to access a data item only if it is currently holding a lock on that item.

9/18/2012

ITM 574

100

Regional College of Management, Bhubaneswar

Locks
There

are various modes in which a data item may be locked.


Shared: If a transaction Ti has obtained a shared mode lock (denoted by S) on item Q, then Ti can read, but cannot write Q. Exclusive: If a transaction Ti has obtained an exclusive mode lock (denoted by X) on item Q, then Ti can both read and write Q.

9/18/2012

ITM 574

101

Regional College of Management, Bhubaneswar

We

require that every transaction request a lock in an appropriate mode on the data item Q, depending on the type of operation that it will perform on Q.
The request is made to the concurrency control manager.

The

transaction can proceed with the operation only after the concurrency control manager grants the lock to the transaction.
ITM 574 102

9/18/2012

Regional College of Management, Bhubaneswar

Compatibility Function
Let

A and B represent arbitrary lock modes.

Suppose that a transaction Ti requests a lock of mode A on item Q on which transaction Tj (Ti != Tj) currently holds a lock on mode B. If transaction Ti can be granted a lock on Q immediately, in spite of the presence of the mode B lock. Then we say mode A is compactable with mode B.

9/18/2012

ITM 574

103

Regional College of Management, Bhubaneswar

Comp matrix
S X

True

False

False

False

9/18/2012

ITM 574

104

Regional College of Management, Bhubaneswar

transaction requests a shared lock on data item Q by executing the instruction lock-S(Q). An exclusive lock is requested through the lock-X(Q). A data item Q can be unlocked via the unlock(Q) instruction.
9/18/2012
ITM 574 105

Regional College of Management, Bhubaneswar

Procedure
To

access a data item, transaction Ti must first lock that item.


If the data item is already locked by another transaction in an incompactable mode, the concurrency control manager will not grant the lock until all incompactable locks held by other transactions have been released. Thus Ti is made to wait until all incompactable locks held by other transactions have been released.

9/18/2012

ITM 574

106

Regional College of Management, Bhubaneswar

Transaction

Ti may unlock a data item that it has locked at some earlier point.
But it is important that a transaction must hold a lock on a data item as long as it access that item. Moreover for a transaction to unlock a data item immediately after its final access of that data item is not always desirable, since serializability may not be ensured.

9/18/2012

ITM 574

107

Regional College of Management, Bhubaneswar

An Illustration
T1: lock-X(B) read(B) B:=B-50 write(B) unlock(B) lock-X(A) read(A) A:=A+50 write(A) unlock(A) T2: lock-S(A) read(A) unlock(A) lock-S(B) read(B) unlock(B) display(A+B)

9/18/2012

ITM 574

108

Regional College of Management, Bhubaneswar

lock-X(B) read(B) B:=B-50 write(B) unlock(B)

Grant X(B, T1)

lock-S(A) read(A) unlock(A) lock-S(B) read(B) unlock(B) display(A+B) lock-X(A) read(A) A:=A+50 write(A) unlock(A)
9/18/2012
ITM 574

Grant S(A, T2)

Grant S(B, T2)

Grant X(A,T1)

109

Regional College of Management, Bhubaneswar

T3:

lock-X(B) read(B) B:=B-50 write(B) lock-X(A) read(A) A:=A+50 write(A) unlock(A) unlock(B)

T4:

lock-S(A) read(A) lock-S(B) read(B) display(A+B) unlock(A) unlock(B)

9/18/2012

ITM 574

110

Regional College of Management, Bhubaneswar

T3:

lock-X(B) read(B) B:=B-50 write(B)

T4:

lock-S(A) read(A) lock-S(B) lock-X(A) read(A) A:=A+50 write(A) unlock(A) unlock(B)

read(B) display(A+B) unlock(A) unlock(B)

9/18/2012

ITM 574

111

Regional College of Management, Bhubaneswar

This

situation is called dead lock

When deadlock occurs the system must roll back one of the two transactions. Once a transaction has been rolled back, the data items that were locked by that transaction are unlocked. These items are then available to other transactions.
9/18/2012
ITM 574 112

Regional College of Management, Bhubaneswar

If

we use locking, or unlock data items as soon as possible after reading or writing,
We may get inconsistent results.

On

the other hand, if we do not unlock a data item before requesting a lock on another data item,
Deadlocks may occur.

9/18/2012

ITM 574

113

Regional College of Management, Bhubaneswar

There

are ways to avoid deadlocks in some situations.


However, in general deadlocks are necessary evil associated with locking if we want to avoid inconsistent states.

Deadlocks are definitely preferable to inconsistent states, since they can be handled by rolling back of transactions. Inconsistent may lead to real life problems that can not be handled by the database systems.
9/18/2012
ITM 574 114

Regional College of Management, Bhubaneswar

Locking Protocol
Each

transaction in the system follow a set of rules, called a locking protocol, indicating when a transaction can lock and unlock data items.
Locking protocols restrict the number of possible schedules.

9/18/2012

ITM 574

115

Regional College of Management, Bhubaneswar

Granting of Locks
When

a transaction requests a lock on a data item in a particular mode, and no other transaction has a lock on the same data item in a conflicting mode, the lock can be granted.

9/18/2012

ITM 574

116

Regional College of Management, Bhubaneswar

But
Suppose

a transaction T2 has a shared mode lock on a data item and another transaction T1 requests an exclusive mode lock on the same data item.
Clearly T1 has to wait for T2 to release the shared mode lock.

9/18/2012

ITM 574

117

Regional College of Management, Bhubaneswar

Meanwhile, a transaction T3 may request a shared mode lock on the same data item.
The lock request is compactable, so T3 is given the grant

At this point T2 may release the lock


But T1 still has to wait for T3 to finish.

But again there may be another transaction T4 that requests for a shared mode lock.
But T1 never gets the exclusive mode lock on the data item and is said to be starved.

9/18/2012

ITM 574

118

Regional College of Management, Bhubaneswar

Thus
We

can avoid starvation by granting locks as follows.


There is no other transaction holding a lock on the data item in a conflicting mode. There is no other transaction that is waiting for a lock on the data item and that made its lock request before.

9/18/2012

ITM 574

119

Regional College of Management, Bhubaneswar

The Two Phase Locking Protocol


One

protocol that ensures serializability is the two phase locking protocol. This protocol requires that each transaction issue lock and unlock requests in two phases.
Growing Phase Shrinking Phase

9/18/2012

ITM 574

120

Regional College of Management, Bhubaneswar

Growing Phase
A

transaction may obtain locks, but may not release any locks.

9/18/2012

ITM 574

121

Regional College of Management, Bhubaneswar

Shrinking Phase
A

transaction may release locks, but may not obtain any new locks.

9/18/2012

ITM 574

122

Regional College of Management, Bhubaneswar

9/18/2012

ITM 574

123

Das könnte Ihnen auch gefallen