Sunteți pe pagina 1din 21

UNIT -4

Database recovery means recovering the data when it get deleted, hacked or damaged
accidentally. Atomicity is must whether is transaction is over or not it should reflect in
the database permanently or it should not effect the database at all. So database recovery
and database recovery techniques are must in DBMS. So database recovery techniques in
DBMS are given below.

Crash recovery:

DBMS may be an extremely complicated system with many transactions being executed
each second. The sturdiness and hardiness of software rely upon its complicated design
and its underlying hardware and system package. If it fails or crashes amid transactions,
it’s expected that the system would follow some style of rule or techniques to recover lost
knowledge.

Classification of failure:

To see wherever the matter has occurred, we tend to generalize a failure into numerous
classes, as follows:

 Transaction failure
 System crash

R.Vignesh
Department of CSE
UNIT -4

 Disk failure

Transaction failure: A transaction needs to abort once it fails to execute or once it reaches
to any further extent from wherever it can’t go to any extent further. This is often known
as transaction failure wherever solely many transactions or processes are hurt.

The reasons for transaction failure are:

 Logical errors
 System errors

Logical errors: Where a transaction cannot complete as a result of its code error or an
internal error condition.

System errors: Wherever the information system itself terminates an energetic


transaction as a result of the DBMS isn’t able to execute it, or it’s to prevent due to some
system condition. to Illustrate, just in case of situation or resource inconvenience, the
system aborts an active transaction.

System crash: There are issues − external to the system − that will cause the system to
prevent abruptly and cause the system to crash. For instance, interruptions in power
supply might cause the failure of underlying hardware or software package failure.
Examples might include OS errors.

Disk failure: In early days of technology evolution, it had been a typical drawback
wherever hard-disk drives or storage drives accustomed to failing oftentimes. Disk
failures include the formation of dangerous sectors, unreachability to the disk, disk crash
or the other failure, that destroys all or a section of disk storage.

Storage structure:

Classification of storage structure is as explained below:

Classification Of Storage

Volatile storage: As the name suggests, a memory board (volatile storage) cannot
survive system crashes. Volatile storage devices are placed terribly near to the CPU;
usually, they’re embedded on the chipset itself. For instance, main memory and cache
memory are samples of the memory board. They’re quick however will store a solely
little quantity of knowledge.

R.Vignesh
Department of CSE
UNIT -4

Non-volatile storage: These recollections are created to survive system crashes. they’re
immense in information storage capability, however slower in the accessibility. Examples
could include hard-disks, magnetic tapes, flash memory, and non-volatile (battery backed
up) RAM.

Recovery and Atomicity:

When a system crashes, it should have many transactions being executed and numerous
files opened for them to switch the information items. Transactions are a product of
numerous operations that are atomic in nature. However consistent with ACID properties
of a database, atomicity of transactions as an entire should be maintained, that is, either
all the operations are executed or none.

 When a database management system recovers from a crash, it ought to maintain


the subsequent:
 It ought to check the states of all the transactions that were being executed.
 A transaction could also be within the middle of some operation; the database
management system should make sure the atomicity of the transaction during this
case.
 It ought to check whether or not the transaction is completed currently or it must
be rolled back.
 No transactions would be allowed to go away from the database management
system in an inconsistent state.

There are 2 forms of techniques, which may facilitate a database management system in
recovering as well as maintaining the atomicity of a transaction:

 Maintaining the logs of every transaction, and writing them onto some stable
storage before truly modifying the info.
 Maintaining shadow paging, wherever the changes are done on a volatile memory,
and later, and the particular info is updated.

Log-based recovery Or Manual Recovery):

Log could be a sequence of records, which maintains the records of actions performed by
dealing. It’s necessary that the logs area unit written before the particular modification
and hold on a stable storage media, that is failsafe. Log-based recovery works as follows:

 The log file is unbroken on a stable storage media.

R.Vignesh
Department of CSE
UNIT -4

 When a transaction enters the system and starts execution, it writes a log regarding
it.

Recovery with concurrent transactions (Automated Recovery):

When over one transaction is being executed in parallel, the logs are interleaved. At the
time of recovery, it’d become exhausting for the recovery system to go back all logs, and
so begin recovering. To ease this example, the latest package uses the idea of
‘checkpoints’. Automated Recovery is of three types.

 Deferred Update Recovery


 Immediate Update Recovery
 Shadow Paging

R.Vignesh
Department of CSE
UNIT -4

R.Vignesh
Department of CSE
UNIT -4

R.Vignesh
Department of CSE
UNIT -4

R.Vignesh
Department of CSE
UNIT -4

R.Vignesh
Department of CSE
UNIT -4

R.Vignesh
Department of CSE
UNIT -4

Database Security:

Data is a valuable entity that must have to be firmly handled and managed as with any
economic resource. So some part or all of the commercial data may have tactical
importance to their respective organization and hence must have to be kept protected and
confidential. In this chapter, you will learn about the scope of database security. There is
a range of computer-based controls that are offered as countermeasures to these threats.

Database security is the technique that protects and secures the database against
intentional or accidental threats. Security concerns will be relevant not only to the data
resides in an organization's database: the breaking of security may harm other parts of the
system, which may ultimately affect the database structure. Consequently, database

R.Vignesh
Department of CSE
UNIT -4

security includes hardware parts, software parts, human resources, and data. To
efficiently do the uses of security needs appropriate controls, which are distinct in a
specific mission and purpose for the system. The requirement for getting proper security
while often having been neglected or overlooked in the past days; is now more and more
thoroughly checked by the different organizations.

We consider database security about the following situations:

 Theft and fraudulent.


 Loss of confidentiality or secrecy.
 Loss of data privacy.
 Loss of data integrity.
 Loss of availability of data.
These listed circumstances mostly signify the areas in which the organization should
focus on reducing the risk that is the chance of incurring loss or damage to data within a
database. In some conditions, these areas are directly related such that an activity that
leads to a loss in one area may also lead to a loss in another since all of the data within an
organization are interconnected.

Threat

Any situation or event, whether intentionally or incidentally, can cause damage, which
can reflect an adverse effect on the database structure and, consequently, the
organization. A threat may occur by a situation or event involving a person or the action
or situations that are probably to bring harm to an organization and its database.
The degree that an organization undergoes as a result of a threat's following which
depends upon some aspects, such as the existence of countermeasures and contingency
plans. Let us take an example where you have a hardware failure that occurs corrupting
secondary storage; all processing activity must cease until the problem is resolved.

Computer-Based Controls

The different forms of countermeasure to threats on computer systems range from


physical controls to managerial procedures. In spite of the range of computer-based

R.Vignesh
Department of CSE
UNIT -4

controls that are preexisting, it is worth noting that, usually, the security of a DBMS is
merely as good as that of the operating system, due to the close association among them.
Most of the computer-based database security are listed below:

 Access authorization.
 Access controls.
 Views.
 Backup and recovery of data.
 Data integrity.
 Encryption of data.
 RAID technology.

Access Controls:

The usual way of supplying access controls to a database system is dependent on the
granting and revoking of privileges within the database. A privilege allows a user to
create or access some database object or to run some specific DBMS utilities. Privileges
are granted users to achieve the tasks required for those jobs.
The database provides various types of access controls:

 Discretionary Access Control (DAC)


 Mandatory Access Control (MAC)

Backup and Recovery

Every Database Management System should offer backup facilities to help with the
recovery of a database after a failure. It is always suitable to make backup copies of the
database and log files at the regular period and for ensuring that the copies are in a secure
location. In the event of a failure that renders the database unusable, the backup copy and
the details captured in the log file are used to restore the database to the latest possible
consistent state.

Distributed Database Management Systems:

R.Vignesh
Department of CSE
UNIT -4

A logically interconnected set of shared data (and a description of this data) physically
scattered over a computer network.

 This software system allows the management of the distributed database and
makes the distribution transparent to users.

 A Distributed Database Management System (DDBMS) contains a single logical


database that is divided into a number of fragments.

 Every fragment gets stored on one or more computers under the control of a
separate DBMS, with the computers connected by a communications network.

 Each position is capable of independently process every user's requests that


require access to local data (i.e., each position of the distributed system has some
basic degree of local autonomy) and is also able to process data stored on other
computers within the network.

 Users access the distributed database via applications that are classified as those
which do not need data from other sites (local applications); and also those that do
need data from other sites (global applications).

 You will be requiring a DDBMS to have at least one global application.

A DDBMS, therefore, has the following characteristics:

 a collection of logically related shared data


 n the data is split into a number of fragments
 fragments may be replicated
 fragments/replicas are allocated to sites
 the sites are linked by a communications network
 the data at each site is under the control of a DBMS
 the DBMS at each site can handle local applications, autonomously
 each DBMS participates in at least one global application

R.Vignesh
Department of CSE
UNIT -4

Types of Distributed Databases


Distributed databases can be broadly classified into homogeneous and heterogeneous
distributed database environments, each with further sub-divisions, as shown in the
following illustration.

Homogeneous Distributed Databases

In a homogeneous distributed database, all the sites use identical DBMS and operating
systems. Its properties are −
 The sites use very similar software.
 The sites use identical DBMS or DBMS from the same vendor.
 Each site is aware of all other sites and cooperates with other sites to process user
requests.
 The database is accessed through a single interface as if it is a single database.

Types of Homogeneous Distributed Database

There are two types of homogeneous distributed database −


 Autonomous − Each database is independent that functions on its own. They are
integrated by a controlling application and use message passing to share data
updates.
 Non-autonomous − Data is distributed across the homogeneous nodes and a
central or master DBMS co-ordinates data updates across the sites.

Heterogeneous Distributed Databases

R.Vignesh
Department of CSE
UNIT -4

In a heterogeneous distributed database, different sites have different operating systems,


DBMS products and data models. Its properties are −
 Different sites use dissimilar schemas and software.
 The system may be composed of a variety of DBMSs like relational, network,
hierarchical or object oriented.
 Query processing is complex due to dissimilar schemas.
 Transaction processing is complex due to dissimilar software.
 A site may not be aware of other sites and so there is limited co-operation in
processing user requests.

Types of Heterogeneous Distributed Databases

 Federated − The heterogeneous database systems are independent in nature and


integrated together so that they function as a single database system.
 Un-federated − The database systems employ a central coordinating module
through which the databases are accessed.
Distributed DBMS Architectures
DDBMS architectures are generally developed depending on three parameters −
 Distribution − It states the physical distribution of data across the different sites.
 Autonomy − It indicates the distribution of control of the database system and the
degree to which each constituent DBMS can operate independently.
 Heterogeneity − It refers to the uniformity or dissimilarity of the data models,
system components and databases.
Architectural Models
Some of the common architectural models are −

 Client - Server Architecture for DDBMS


 Peer - to - Peer Architecture for DDBMS
 Multi - DBMS Architecture

Client - Server Architecture for DDBMS

This is a two-level architecture where the functionality is divided into servers and
clients.

R.Vignesh
Department of CSE
UNIT -4

 The server functions primarily encompass data management, query processing,


optimization and transaction management.
 Client functions include mainly user interface.

However, they have some functions like consistency checking and transaction
management.
The two different client - server architecture are −

 Single Server Multiple Client


 Multiple Server Multiple Client (shown in the following diagram)

Peer- to-Peer Architecture for DDBMS

In these systems, each peer acts both as a client and a server for imparting database
services. The peers share their resource with other peers and co-ordinate their activities.
This architecture generally has four levels of schemas −
 Global Conceptual Schema − Depicts the global logical view of data.
 Local Conceptual Schema − Depicts logical data organization at each site.

R.Vignesh
Department of CSE
UNIT -4

 Local Internal Schema − Depicts physical data organization at each site.


 External Schema − Depicts user view of data.

Multi - DBMS Architectures

This is an integrated database system formed by a collection of two or more autonomous


database systems.
Multi-DBMS can be expressed through six levels of schemas −
 Multi-database View Level − Depicts multiple user views comprising of subsets
of the integrated distributed database.
 Multi-database Conceptual Level − Depicts integrated multi-database that
comprises of global logical multi-database structure definitions.
 Multi-database Internal Level − Depicts the data distribution across different
sites and multi-database to local data mapping.
 Local database View Level − Depicts public view of local data.
 Local database Conceptual Level − Depicts local data organization at each site.
 Local database Internal Level − Depicts physical data organization at each site.
There are two design alternatives for multi-DBMS −

R.Vignesh
Department of CSE
UNIT -4

 Model with multi-database conceptual level.


 Model without multi-database conceptual level.

R.Vignesh
Department of CSE
UNIT -4

Design Alternatives
The distribution design alternatives for the tables in a DDBMS are as follows −

 Non-replicated and non-fragmented


 Fully replicated
 Partially replicated
 Fragmented
 Mixed

Non-replicated & Non-fragmented

In this design alternative, different tables are placed at different sites. Data is placed so
that it is at a close proximity to the site where it is used most. It is most suitable for
database systems where the percentage of queries needed to join information in tables
placed at different sites is low. If an appropriate distribution strategy is adopted, then
this design alternative helps to reduce the communication cost during data processing.

R.Vignesh
Department of CSE
UNIT -4

Fully Replicated

In this design alternative, at each site, one copy of all the database tables is stored. Since,
each site has its own copy of the entire database, queries are very fast requiring
negligible communication cost. On the contrary, the massive redundancy in data requires
huge cost during update operations. Hence, this is suitable for systems where a large
number of queries is required to be handled whereas the number of database updates is
low.

Partially Replicated

Copies of tables or portions of tables are stored at different sites. The distribution of the
tables is done in accordance to the frequency of access. This takes into consideration the
fact that the frequency of accessing the tables vary considerably from site to site. The
number of copies of the tables (or portions) depends on how frequently the access
queries execute and the site which generate the access queries.

Fragmented

In this design, a table is divided into two or more pieces referred to as fragments or
partitions, and each fragment can be stored at different sites. This considers the fact that
it seldom happens that all data stored in a table is required at a given site. Moreover,
fragmentation increases parallelism and provides better disaster recovery. Here, there is
only one copy of each fragment in the system, i.e. no redundant data.
The three fragmentation techniques are −

 Vertical fragmentation
 Horizontal fragmentation
 Hybrid fragmentation

Mixed Distribution

This is a combination of fragmentation and partial replications. Here, the tables are
initially fragmented in any form (horizontal or vertical), and then these fragments are
partially replicated across the different sites according to the frequency of accessing the
fragments.

Advantages and Disadvantages of DDBMS

 Organization's choice: Many organizations are distributed over several locations. It is


natural for databases used in such an application to be spread over these locations.

R.Vignesh
Department of CSE
UNIT -4

 Improved availability: A failure at one site of a DDBMS, or a failure of a


communication link making some sites unreachable, does not make the entire system
inoperable. Distributed DBMSs are designed to carry on the function despite such
failures.
 Improved performance: With the concept of parallelism of distributed DBMSs, the
speed of database access may be better than that achievable from a remote centralized
database.

R.Vignesh
Department of CSE

S-ar putea să vă placă și