A major objective in developing a database it to enables many users to access shared data concurrently.

Authors Avatar

CP2001 – Multi-User Databases                                        Sukhbir Bassi, Keranjit Kaur & Jasbir Ajimal

Contents

  1. Introduction                                                Page 2
  2. Transactions                                                Page 3 - 5
  3. Recovery                                                Page 6 - 7
  4. Locking                                                Page 8 - 9

5.0        Time-stamping                                        Page 10 - 11

6.0        Concurrency                                                Page 12 - 13

7.0        Indexes                                                Page 14

8.0        Conclusion                                                Page 15

9.0        References                                                Page 16

10.0        Bibliography                                                Page 17

Appendices

Grant Access to User 2                                        Page 19

User accessing granted tables                                Page 20

Test 1                                                                Page 21

Test 2                                                                Page 21

Teat 3                                                                Page 22

Test 4                                                                Page 22

Test 5                                                                Page 23

Test 6                                                                Page 23

Test 7                                                                Page 24

Test 8                                                                Page 24

Test 9                                                                Page 25

Test 10                                                        Page 26

Test 11                                                        Page 26

Test 12                                                        Page 27

Test 13                                                        Page 27

Test 14                                                        Page 28

Test 15                                                        Page 28

Test 16                                                        Page 28

Test 17                                                        Page 29

Test 18                                                        Page 30

Test 19                                                        Page 30

Test 20                                                        Page 31

Test 21                                                        Page 32

Test 22                                                        Page 32

Test 23                                                        Page 33

Test 24                                                        Page 33 - 34

Test 25                                                        Page 35

Test 26                                                        Page 36

1.0 Introduction

A major objective in developing a database it to enables many users to access shared data concurrently. Concurrent access is relatively easy if all users are only reading data, as there is no way that they can interfere with one another, an example of this can be seen in the appendices in tests 9, 10 and 11. However, when two or more users are accessing the database simultaneously and at least one is updating data, there may be interference that can result in inconsistencies (Begg & Thomas, 1999). An example of this can be seen in the appendices in tests 18 and 19.

 

In a multi-session database system environment, there are usually two primary requirements. First the data must be read and modified in a consistent, predictable manner without the risk of loss or corruption (Elmsari & Navathe, 1994). That is to say, it must be kept in a consistent state. Second, concurrent data access by multiple users must be optimised with the highest possible performance to provide maximum productivity for all users of the system.

In this report we will be discussing multi-user issues in databases including transaction management, recovery, locking, time stamping, concurrency control and indexes.

   

2.0 Transactions

Transactions are fundamental to the idea of controlled concurrent access to multi-user systems. A Transaction is a logical unit of a database processing that includes one or more database access operations. The operations may be insertion, deletion, modification or retrieval. The operation that forms a transaction can be embedded within an application program or can be specified interactively via SQL (Oxborrow, 1989).

A Transaction consists of a series of actions carried out by a single user, or application program, which must be treated as an indivisible unit, e.g. real-time flight reservation. If the operations carried out within a transaction are successful, all the changes made by that unit of work are committed to the database. A transaction transforms the database from one consistent state to another, if an operation during a transaction fails, the changes made by that transaction are rolled back, by doing this the database is restored to its state prior to the transaction.

Examples of a transaction

1

2)   SQL> INSERT INTO OPS$B0157700.SHOWING

       2  VALUES(130, 780, ’15-NOV-02’, 480);

2.1 ACID Properties of Transactions

The basic idea behind transactions is to provide something that fulfils four properties, atomicity, consistency, isolation and durability.

Atomicity

A transaction consists of a series of actions; each action must be successful in order for the transaction to be saved.

Consistency

No other transactions are permitted on a record until the current transaction is completed. This ensures that the transaction integrity has statement level consistence among all records.

Isolation

A transaction should appear as though it is being executed in independently from other transactions even if it is being executed simultaneously.

                                        

Durability

This indicates the permanence of the database’s consistent state. When a transaction is completed, the database reaches a consistent state which cannot be lost, even in the event of the system's failure (Gray & Reuter, 1993).

2.2 ISO Standards on Transaction Management

The ISO (International Standards Organisation) has defined standards that govern SQL database transactions. Transaction support is provided by two SQL statements: COMMIT and ROLLBACK. A transaction can completed if one of the following four events occurs:

A COMMIT statement is executed; all changes made to the database since the transaction was initiated are made permanent (Gray & Reuter, 1993). This can be seen in the appendices under Test 1.

A ROLLBACK statement aborts the transaction, in which case all the changes are aborted and the database is rolled back to its previous consistent state (Gray & Reuter, 1993).

The end of a program is successfully reached, in which case all changes are permanently recorded within a database. This action is equivalent to COMMIT (Gray & Reuter, 1993).

The program is terminated, in which case all changes are aborted and the database is rolled back to its previous consistent state. This action is equivalent to ROLLBACK.                                                        

                                                                                     

3.0 Recovery

Facilities for fast-recovery of a database include, backing up; transaction logging; before-images and after-images and checkpoints.

Backing up

The backup utility allows you to back up the databases, database files, transaction logs, and write files. There are two main types of database backups: full backups and incremental backups.

Full backups create a copy of all data and journal files, providing a copy of the entire database at one point in time. All important data must be backed up fully on a daily basis (Gray & Reuter, 1993).

Incremental backups create a copy of only the log files that have changed since the last backup. These files provide a copy of the changes made to the database since the last backup.

Transaction Logging

Transaction logging is a temporary maintenance tool used to track all database changes over a finite time period. It functions as a write-ahead log of database activity therefore all insert, update, and delete transactions are recorded from beginning to end (Date, 2001).

Join now!

Descriptions of these changes are durably recorded on disk in a type of transaction log file known as an undo-redo log. There is an optional second log, called the redo log; this can be used to enhance system reliability by recording the transaction log in two places.

           

         

Before Images and After Images

The undo-redo (before-image file) contains a log of all recent database changes. As transactions change the database during processing, the database manager writes one or more log records describing each change ...

This is a preview of the whole essay