Dbms Ia II 1413121

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

DBMS IA II

Name:Aditya Ajay Wani

Roll No.:1413121

E-mail:aditya.wani@somaiya.edu

1)Explain Shadow paging for transaction Recovery.

Ans:1)Shadow paging is an alternative to log-based recovery techniques, which has both


advantages and disadvantages. It may require fewer disk accesses, but it is hard to extend
paging to allow multiple concurrent transactions. In a multiuser environment, a log may be
needed for the concurrency control method.The paging is very similar to paging schemes
used by the operating system for memory management.

2)Shadow paging considers the database to be made up of a number of fixed size disk pages
(or disk blocks)say, n for recovery purposes. A directory with n entries is constructed, where
the ith entry points to the ith database page on disk. The directory is kept in main memory if
it is not too large, and all references reads or writes to database pages on disk go through it.
When a transaction begins executing, the current directory whose entries point to the most
recent or current database pages on disk is copied into a shadow directory. The shadow
directory is then saved on disk while the current directory is used by the transaction.

3) During transaction execution, the shadow directory is never modified. When a write item
operation is performed, a new copy of the modified database page is created, but the old copy of
that page is not overwritten. Instead, the new page is written elsewhere on some previously unused
disk block. The current directory entry is modified to point to the new disk block, whereas the
shadow directory is not modified and continues to point to the old unmodified disk block. Figure
below illustrates the concepts of shadow and current directories. For pages updated by the
transaction, two versions are kept. The old version is referenced by the shadow directory and the
new version by the current directory.
Recovery using Shadow Paging:
To recover from a failure during transaction execution, it is sufficient to free the modified database
pages and to discard the current directory. The state of the database before transaction execution is
available through the shadow directory, and that state is recovered by reinstating the shadow
directory. The database thus is returned to its state prior to the transaction that was executing when
the crash occurred, and any modified pages are discarded. Committing a transaction corresponds to
discarding the previous shadow directory. Since recovery involves neither undoing nor redoing data
items, this technique can be categorized as a NOUNDO/NO-REDO technique for recovery.

Disadvantages of Shadow Paging:

1)Commit overhead: The commit of a single transaction using shadow paging requires
multiple blocks to be output the current page table, the actual data and the disk address of the
current page table. Log-based schemes need to output only the log records.

2)Data fragmentation:Shadow paging causes database pages to change locations.

3)Garbage collection:Each time that a transaction commits, the database pages containing
the old version of data changed by the transactions must become inaccessible. Such pages are
considered to be garbage since they are not part of the free space and do not contain any
usable information. Periodically it is necessary to find all of the garbage pages and add them
to the list of free pages. This process is called garbage collection and imposes additional
overhead and complexity on the system.
2)What do you understand by database security? Explain implementation
of database security in DBMS.

Ans:What is Database Security:

Few of the things Data-base Security deals with are

1)Techniques for securing databases against a variety of threats.

2) Schemes of providing access privileges to authorized users and the mechanisms used to
grant and revoke privileges in relational database systems

3) Policy issues at the governmental, institutional, or corporate level as to what kinds of


information should not be made publicly available for example, credit ratings and personal
medical records.

4) System-related issues such as the system levels at which various security functions should
be enforcedfor example, whether a security function should be handled at the physical
hardware level, the operating system level, or the DBMS level.

5) The need in some organizations to identify multiple security levels and to categorize the
data and users based on these classificationsfor example, top secret, secret, confidential,
and unclassified. The security policy of the organization with respect to permitting access to
various classifications of data must be enforced.

The Threats faced by database are:

Loss of integrity: Database integrity refers to the requirement that information be protected
from improper modification. Modification of data includes creation, insertion, updating,
changing the status of data, and deletion. Integrity is lost if unauthorized changes are made to
the data by either intentional or accidental acts. If the loss of system or data integrity is not
corrected, continued use of the contaminated system or corrupted data could result in
inaccuracy, fraud, or erroneous decisions.

Loss of availability: Database availability refers to making objects available to a human user
or a program to which they have a legitimate right.

Loss of confidentiality: Database confidentiality refers to the protection of data from


unauthorized disclosure. The impact of unauthorized disclosure of confidential information
can range from violation of the Data Privacy Act to the jeopardization of national security.
Unauthorized, unanticipated, or unintentional disclosure could result in loss of public
confidence, embarrassment, or legal action against the organization.

To protect databases against these types of threats, four kinds of control measures are
implemented:

1)Access control:

A security problem common to computer systems is that of preventing unauthorized persons


from accessing the system itself, either to obtain information or to make malicious changes in
a portion of the database. The security mechanism of a DBMS must include provisions for
restricting access to the database system as a whole. This function, called access control, is handled
by creating user accounts and passwords to control the login process by the DBMS.

2)Inference control:

Statistical databases are used to provide statistical information or summaries of values based on
various criteria. For example, a database for population statistics may provide statistics based on age
groups, income levels, household size, education levels, and other criteria. Statistical database users
such as government statisticians or market research firms are allowed to access the database to
retrieve statistical information about a population but not to access the detailed confidential
information about specific individuals. Security for statistical databases must ensure that information
about individuals cannot be accessed. It is sometimes possible to deduce or infer certain facts
concerning individuals from queries that involve only summary statistics on groups; consequently,
this must not be permitted either. The corresponding control measures are called inference control
measures.

3)Flow control:

Another security issue is that of flow control, which prevents information from flowing in such a way
that it reaches unauthorized users. Channels that are pathways for information to flow implicitly in
ways that violate the security policy of an organization are called covert channels.

4)Encryption:

A final control measure is data encryption, which is used to protect sensitive data (such as credit card
numbers) that is transmitted via some type of communications network. Encryption can be used to
provide additional protection for sensitive portions of a database as well. The data is encoded using
some coding algorithm. An unauthorized user who accesses encoded data will have difficulty
deciphering it, but authorized users are given decoding or decrypting algorithms (or keys) to decipher
the data. Encrypting techniques that are very difficult to decode without a key have been developed
for military applications.

You might also like