Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 123

Regional College of Management, Bhubaneswar

Management Information System

Subrat Kumar Parida


MIS (3rd Trimester)

Regional College of Management


Bhubaneswar.

12/08/21 MIS 1
Regional College of Management, Bhubaneswar

Information is Critical

 The information we have is not what we


want,

 The information we want is not the


information we need,

 The information we need is not available.

12/08/21 ITM 574 2


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

12/08/21 ITM 574 3


Regional College of Management, Bhubaneswar

Why need Information?

 To ensure effective and efficient decision


making leading to prosperity of the
Organisation.

12/08/21 ITM 574 4


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.

12/08/21 ITM 574 5


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

12/08/21 ITM 574 6


Regional College of Management, Bhubaneswar

The three sub-components

 together bring out the


 Management,
focus clearly &
effectively.
 Information

 System

12/08/21 ITM 574 7


Regional College of Management, Bhubaneswar

The three sub-components

 System emphasizing a  Management


fair degree of integration focusing on the
and a holistic view;
ultimate use of
such
information
 Information stressing on systems for
processed data in the
managerial
context in which it is used
by end users;
decision
making.

12/08/21 ITM 574 8


Regional College of Management, Bhubaneswar

The Concept of MIS

12/08/21 ITM 574 9


Regional College of Management, Bhubaneswar

Why MIS?

 Increased Business & Management Complexities

12/08/21 ITM 574 10


Regional College of Management, Bhubaneswar

Increased Business Complexities

 Technological Revolution
 Research & Development
 Explosion of Information

12/08/21 ITM 574 11


Regional College of Management, Bhubaneswar

Increased Management Complexities

 Management Science Technologies


 Decision-making
 Onset of Computers

12/08/21 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

12/08/21 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

12/08/21 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.

12/08/21 ITM 574 15


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 advantage.

12/08/21 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 enterprise and
global e-business operations and electronic commerce on the internet, intranets,
12/08/21
extranets, and other networks. ITM 574 17
Regional College of Management, Bhubaneswar

Types of Information System:

 Conceptually the applications of


information systems that are implemented
in today’s business world can be classified
in several different ways.
 Several types information systems can be
classified as
– Operations Support System
– Management Information Systems

12/08/21 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 firm’s operations support system is to
• efficiently process business transactions,
• control industrial processes,
• support enterprise communications and collaborations and
• update corporate databases.

12/08/21 ITM 574 19


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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 ITM 574 23


Regional College of Management, Bhubaneswar

Decision Support System:

 DSS give direct computer support to


managers during the decision making
process.

12/08/21 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.

12/08/21 ITM 574 25


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:

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.
12/08/21 ITM 574 35
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.

12/08/21 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 standards.

12/08/21 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

12/08/21 Go Back to the Previous StageITM


or Stop
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.

12/08/21 ITM 574 39


Regional College of Management, Bhubaneswar

System Analysis

 System analysis refers to the investigation of the


existing situation.

 It is a process that may take weeks, or months


involving many activities.

 It aims at providing a thorough understanding of


existing organisations and its operations.

12/08/21 ITM 574 40


Regional College of Management, Bhubaneswar

System Analysis Activities

 Isolating the symptoms of the problem

 Determining the cause

 Identification of business process and their


interrelations.

 Flow of Information related to these processes

12/08/21 ITM 574 41


Regional College of Management, Bhubaneswar

System Analysis deals with…

 People

 Procedures involved

 The existing information system technology

 The environment surrounding the problem

12/08/21 ITM 574 42


Regional College of Management, Bhubaneswar

System Analysis Methods…

 Observation

 Review of Documents

 Interviews

 Performance Measurements

12/08/21 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.

12/08/21 ITM 574 44


Regional College of Management, Bhubaneswar

Technological Feasibility

 Are the performance requirements achievable


utilizing current information technology?

 If not, are they attainable through capabilities that


will be available by the time the project finishes?

 Will newer technologies supersede in the


proposed project before the organisation recovers
its investment?

12/08/21 ITM 574 45


Regional College of Management, Bhubaneswar

Economical Feasibility

 Are the expected benefits greater than the costs?

 Can the organisation afford the costs in terms of


spending and personal requirements?

 Are the risks including the possibility of cost and


schedule overruns, acceptable for an investment
of this size.

12/08/21 ITM 574 46


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.

12/08/21 ITM 574 47


Regional College of Management, Bhubaneswar

Legal Ethical & Other Constraints

 Is the new or automated process ethical to


employees and customers?

 Does it meets all regulatory requirements?

 Are any of the constraints in danger of


being violated.
12/08/21 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.

12/08/21 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

12/08/21 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

12/08/21 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.

12/08/21 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

12/08/21 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

12/08/21 ITM 574 54


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

12/08/21 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.

12/08/21 ITM 574 56


Regional College of Management, Bhubaneswar

Maintenance…

 Every system needs two kinds of


maintenance
– Bugs:
– Updates:

12/08/21 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.

12/08/21 ITM 574 58


Regional College of Management, Bhubaneswar

12/08/21 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.

12/08/21 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

12/08/21 ITM 574 61


Regional College of Management, Bhubaneswar

Un Normalized Table
Employee Number Employee Name Store Branch Department Item Number Item Description Sale Price

211306 Arnold Jim Downtown Hardware TR100 Router $36

211306 Arnold Jim Downtown Hardware SA10 Saw $10

211306 Arnold Jim Downtown Hardware PT65 Drill $21

211306 Arnold Jim Downtown Hardware AB165 Cutter $12

301421011 Zmud Bill Dadeland Home Appliances TT14 Humidifier $245

301421011 Zmud Bill Dadeland Home Appliances DS104 Dish Washer $262

419846204 Belo Jack Detroit Auto Parts MC164 Snow Tire $85

419846204 Belo Jack Detroit Auto Parts AC148 Alternator $65

419846204 Belo Jack Detroit Auto Parts BB100 Battery $49

612047216 Bony Tom Frog St. Men’s Clothing HS101 3 Pc Suit $215

Sales person Sales

12/08/21 ITM 574 62


Regional College of Management, Bhubaneswar

First Normalization
Employee Number Employee Name Store Branch Department Employee Number Item Number Item Description Sale Price

211306 Arnold Jim Downtown Hardware 211306 TR100 Router $36

301421011 Zmud Bill Dadeland Home Appliances 211306 SA10 Saw $10

419846204 Belo Jack Detroit Auto Parts 211306 PT65 Drill $21

612047216 Bony Tom Frog St. Men’s Clothing 211306 AB165 Cutter $12

30142101 TT14 Humidifier $245

Sales Person Data File 30142101 DS104 Dish Washer $262

419846204 MC164 Snow Tire $85

419846204 AC148 Alternator $65

419846204 BB100 Battery $49

612047216 HS101 3 Pc Suit $215

Sales Person Item File

12/08/21 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

12/08/21 ITM 574 64


Regional College of Management, Bhubaneswar

2nd Normal Form


Employee Number Employee Name Store Branch Department

211306 Arnold Jim Downtown Hardware

301421011 Zmud Bill Dadeland Home Appliances

419846204 Belo Jack Detroit Auto Parts

612047216 Bony Tom Frog St. Men’s Clothing

Sales Person Data File

Employee Number Item Number Sale Price Item Number Item Description

211306 TR100 $36 TR100 Router

211306 SA10 $10 SA10 Saw

211306 PT65 $21 PT65 Drill

211306 AB165 $12 AB165 Cutter

30142101 TT14 $245 TT14 Humidifier

30142101 DS104 $262 DS104 Dish Washer

419846204 MC164 $85 MC164 Snow Tire

419846204 AC148 $65 AC148 Alternator

419846204 BB100 $49 BB100 Battery

612047216 HS101 $215 HS101 3 Pc Suit

Sales Person Item File Item File

12/08/21 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.

12/08/21 ITM 574 66


Regional College of Management, Bhubaneswar

3rd Normal Form


Employee Number Employee Name Store Branch Store Branch Department

211306 Arnold Jim Downtown Downtown Hardware

301421011 Zmud Bill Dadeland Dadeland Home Appliances

419846204 Belo Jack Detroit Detroit Auto Parts

612047216 Bony Tom Frog St. Frog St. Men’s Clothing

Sales Person Data File Store Branch File

Employee Number Item Number Sale Price Item Number Item Description

211306 TR100 $36 TR100 Router

211306 SA10 $10 SA10 Saw

211306 PT65 $21 PT65 Drill

211306 AB165 $12 AB165 Cutter

30142101 TT14 $245 TT14 Humidifier

30142101 DS104 $262 DS104 Dish Washer

419846204 MC164 $85 MC164 Snow Tire

419846204 AC148 $65 AC148 Alternator

419846204 BB100 $49 BB100 Battery

612047216 HS101 $215 HS101 3 Pc Suit

Sales Person Item File Item File

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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

12/08/21 ITM 574 71


Regional College of Management, Bhubaneswar

Atomicity

 Either all operations of the transaction are


reflected properly in the database or none
are.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 ITM 574 78


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.
12/08/21 ITM 574 79
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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 ITM 574 83


Regional College of Management, Bhubaneswar

Active:

 The Initial State

– The transaction stays in this state while it is


executing.

12/08/21 ITM 574 84


Regional College of Management, Bhubaneswar

Partially Committed

 After the final statement has been executed

12/08/21 ITM 574 85


Regional College of Management, Bhubaneswar

Failed

 After the discovery that normal execution


can no longer proceed.

12/08/21 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

12/08/21 ITM 574 87


Regional College of Management, Bhubaneswar

Committed

 After successful completion

12/08/21 ITM 574 88


Regional College of Management, Bhubaneswar

Partially Committed
Committed

Active

Failed Aborted

12/08/21 ITM 574 89


Regional College of Management, Bhubaneswar

A transaction is said to be a committed


transaction only if it has entered the committed
state.

A transaction has aborted only if it has entered


the aborted state.

A transaction is said to have terminated if it has


either committed or aborted.

12/08/21 ITM 574 90


Regional College of Management, Bhubaneswar

A 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.

12/08/21 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.

12/08/21 ITM 574 92


Regional College of Management, Bhubaneswar

A 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

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 ITM 574 102


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.

12/08/21 ITM 574 103


Regional College of Management, Bhubaneswar

Comp matrix

S X

S True False

X False False

12/08/21 ITM 574 104


Regional College of Management, Bhubaneswar

A 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.

12/08/21 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.

12/08/21 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.

12/08/21 ITM 574 107


Regional College of Management, Bhubaneswar

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

12/08/21 ITM 574 108


Regional College of Management, Bhubaneswar

lock-X(B)
Grant – X(B, T1)
read(B)
B:=B-50
write(B)
unlock(B)

lock-S(A)
read(A) Grant – S(A, T2)
unlock(A)
lock-S(B)
read(B) Grant – S(B, T2)
unlock(B)
display(A+B)

lock-X(A)
Grant – X(A,T1)
read(A)
A:=A+50
write(A)
unlock(A)
12/08/21 ITM 574 109
Regional College of Management, Bhubaneswar

T3: lock-X(B) T4: lock-S(A)


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

12/08/21 ITM 574 110


Regional College of Management, Bhubaneswar

T3: lock-X(B) T4:


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

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

12/08/21 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.

12/08/21 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.

12/08/21 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.
12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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.

12/08/21 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

12/08/21 ITM 574 120


Regional College of Management, Bhubaneswar

Growing Phase

A transaction may obtain locks, but may


not release any locks.

12/08/21 ITM 574 121


Regional College of Management, Bhubaneswar

Shrinking Phase

A transaction may release locks, but may


not obtain any new locks.

12/08/21 ITM 574 122


Regional College of Management, Bhubaneswar

12/08/21 ITM 574 123

You might also like