Unit - 4: Crash Recovery
Unit - 4: Crash Recovery
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.
Logical errors
System errors
Logical errors: Where a transaction cannot complete as a result of its code error or an
internal error condition.
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
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.
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.
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 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:
R.Vignesh
Department of CSE
UNIT -4
When a transaction enters the system and starts execution, it writes a log regarding
it.
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.
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.
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
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:
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.
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.
Every fragment gets stored on one or more computers under the control of a
separate DBMS, with the computers connected by a communications 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).
R.Vignesh
Department of CSE
UNIT -4
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.
R.Vignesh
Department of CSE
UNIT -4
This is a two-level architecture where the functionality is divided into servers and
clients.
R.Vignesh
Department of CSE
UNIT -4
However, they have some functions like consistency checking and transaction
management.
The two different client - server architecture are −
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
R.Vignesh
Department of CSE
UNIT -4
R.Vignesh
Department of CSE
UNIT -4
Design Alternatives
The distribution design alternatives for the tables in a DDBMS are as follows −
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.
R.Vignesh
Department of CSE
UNIT -4
R.Vignesh
Department of CSE