Вы находитесь на странице: 1из 13

SPRING 2014 ASSIGNMENT

OPEN SOURCE DB SYSTEM


1. Explain ACID properties in transaction management.

Transaction is an event which reads or writes a value on the


database.
Every transaction must adhere to four properties.
Taking their initials letters collectively known as ACID
properties. These properties are:

1. Atomicity: A

transaction is an atomic unit of data processing

i.e. it is
either performed in its entirety or not performed at all.
2. Consistency preservation:

A transaction is consistency

preserving.
That means complete execution of a transaction takes the
database from one consistent state to another.
3. Isolation: A

transaction should appear as though it is being

executed in
isolation from other transactions. That is, the execution of a
transaction
Should not be interfered with by any other transactions
executing
Concurrently.
4. Durability or permanency: The

changes applied to the database

by a
committed (successful) transaction must persist in the
database. These
changes must not be lost because of some failures.
The atomicity property says that, a transaction will
performed either fully or not performed at all.
It is the responsibility of the transaction recovery subsystem
of a DBMS to ensure atomicity.

The preservation of consistency means, if the database is in


a consistent state before executing the transaction, it will be
in a consistent state after the complete execution of the
transaction.
Isolation is enforced by the concurrency control subsystem of
the DBMS.
Concurrency control methods such as locking protocols are
used to ensure that the execution of one transaction will not
interfere with another transaction executing concurrently.
The durability property is the responsibility of the recovery
subsystem of the DBMS.

2. What are the different strategies of OSS licensing?

Explain briefly.

The different strategies of OSS licensing


are:
Expansion strategy: It is an open source

demonstration of the law of


conservation of modularity which says
that a single layer of a software
stack is "modular and agreeable"
permitting adjacent software layers to
be "expanded.
Dual license strategy: In the dual license
strategy, a software company
provides either free use (it carries some
specific conditions) of its
software with some constraints or for a free
commercial allocation of
rights and a bigger set of characteristics .
Consulting strategy: As per this strategy,
consulting and its services
are rising as compared to software licenses .
Patronage strategy: This strategy may be used
for transforming a
specific layer of the software stack into a
commodity, removing

competitors that are extracting profit from


that layer.
strategy: According to this strategy, many
software companies
like Google, do not sell their software
instead permit you to use it or
rent it.
Embedded strategy: This strategy states that
there are many Operating
Systems (OS) such as Linux which are used
in many consumer
products.
3. Explain the SELECT and PROJECT
operations
SELECT Operation:

The select operation to select a subset of the tuples from a


relation that satisfy a selection condition.
This operation keeps only those tuples that satisfy a
qualifying condition.
For example, to select the EMPLOYEE tuples whose
department is 1, or those whose salary is greater than
300000, we can individually specify each of these two
conditions with a SELECT operation as follows:
DNO=1 (EMPLOYEE)
SALARY>300000 (EMPLOYEE)
In general, the SELECT operation is denoted by, <selection
condition>(R).
Where the symbol (sigma) is used to denote the SELECT
operator, and the selection condition is a Boolean expression
specified on the attributes of relation R.
The resulting relation of the SELECT operation has the same
attributes as R.
For example, to select the tuples for all employees who
either work in department 3 and make over 450000 per

year, or work in department 5 and make over 300000, we


can specify the following SELECT operation:
(DNO=3 AND SALARY>450000) OR (DNO=5 AND
SALARY>300000)(EMPLOYEE).
PROJECT Operation:

The PROJECT operation to select certain columns from the


table and discards the other columns.
The PROJECT operation, are used if we are interested in only
certain attributes of a relation.
For example, to list each employees name and salary, we
can use the PROJECT operation as follows:
ENAME, SALARY(EMPLOYEE)
The general form of the PROJECT operation is <attribute
list>(R).
Where (pi) is the symbol used to represent the PROJECT
operation and <attribute list> is a list of attributes from the
attributes of relation R.
The result of the PROJECT operation has only the attributes
specified in <attribute list> and in the same order as they
appear in the list.
Hence, its degree is equal to the number of attributes in
<attribute list>.
If the attribute list includes only non-key attributes of R,
duplicate tuples may occur in the result; the PROJECT
operation removes any duplicate tuples and the result of the
PROJECT operation is a set of tuples without any duplicate
values and hence it is a valid relation.
This is known as duplicate elimination.
4. What is a Trigger? Describe trigger
creation in detail.
SQL trigger is a set of SQL statements stored in the database
catalog and is executed or fired whenever an event (insert,
update or delete) that is associated with a table occurs.

Is a special type of stored procedure which is invoked


directly by an event.
Advantages:

SQL trigger provides an alternative way to check the


integrity of data.
It can catch errors in the database layer.
Disadvantages:

SQL trigger is invoked and executed invisibly from clientapplications.


It may increase the overhead of the database server.

Creating Trigger in MySQL


In order to create a trigger we can use CREATE TRIGGER
statement. The
syntax of CREATE TRIGGER statement is as follows:
CREATE TRIGGER trigger_name trigger_time trigger_event
ON table_name
FOR EACH ROW
BEGIN
...
END
The trigger are creating after the CREATE TRIGGER
statement.
The trigger name should follow the naming convention
[trigger time]_[tablename]_[trigger event], for example
before_employee_update.
Trigger activation time can be either BEFORE or AFTER. We
can use BEFORE keyword if we want to process the action
prior to the modification on the keyword if we want to
process the action prior to the modification on the table and
can use AFTER if we need to process action after changes
are made.
Example:

CREATE TABLE Emp_audit (eid int(11) NOT NULL AUTO_INCREMENT,


Name varchar(50) NOT NULL,
Changedon datetime DEFAULT NULL,
actionvarchar (50) DEFAULT NULL,PRIMARY KEY (eid));
actionvarchar (50) DEFAULT NULL,
PRIMARY KEY (eid));

5. Write
short notes
on:
a) Ingres
b) Postgres
c)
Postgres95
d)
PostgreSQL7
e)
PostgreSQL8
a) Ingres:
Ingres,
a
resear
ch
project
to
create
a
relatio
nal
databa
se,
was a
project
in the
early
1970s
at the

Univer
sity of
Califor
nia,
Berkel
ey.
From
Ingres,
many
open
and
closed
source
databa
ses
were
develo
ped.
Though
Ingres
is a
relation
al
databa
se, but
it did
not
support
SQL
(Struct
ured
Query
Langua
ge)
access.
Postgres:

Postgre
s was

develo
ped
from
Ingres,
so it
was
named
as
'Postgr
es'.
Postgre
s was
develo
ped
betwee
n 19861994
added
support
s for
object
relation
al
technol
ogies.
The
oracle
RDBMS
and
DB2
both
provide
d
support
for SQL
access.
Postgres95:

Two
Ph.D.

student
s from
Stonebr
aker's
lab,
Andrew
Yu and
Jolly
Chen,
replace
d
Postgre
s' with
an
extend
ed
subset
of SQL
in
1995.
They
rename
d the
system
to
postgre
s95.
The
main
advant
age of
Postgre
s95
was
that it
provide
d the
SQL
support

to the
databa
se.
PostgreSQ
L7:
The
main
advant
age of
Postgre
SQL
7was
the
support
of an
embed
ded
langua
ge
called
PL/pgS
QL
which
was
similar
to
PL/SQL.
It also
provide
many
advanc
e
feature
s like
Views,
Objects
,
transac

tion
support
, joins,
huge
selectio
n of
data
type
etc.
PostgreSQL8:

Postgre
SQL 8
was
release
d in
2005.
It
added
a
number
of new
feature
s like
support
for MSWindow
s,
better
locking,
table
spaces,
table
partitio
ning
and
more.

6. Describe briefly about the experimental


evaluation. Write the significance of generic
benchmarks.
It measures the performance of a
database running the most essential
parts of an operational HLR system.
The performance of a database system can be evaluated
with bench marks.
Probably the most popular and widely accepted is TPC-C (it is
a benchmark tool by TPC (Transaction processing
Performance Council)) on-line transaction processing
benchmark.
The performance and cost of each system is measured and
recorded.
The performance metric typically is transactions per second
(tps) and the price five year cost-of-ownership.
From these metrics price/performance figures can be
calculated.
The generic benchmarks suit evaluating the overall
performance of different systems in database can use well.
Different database systems can be compared with the same
hardware configuration or different hardware configurations
can be evaluated using the same database system.
the performance of a specific system depends on many
aspects that are not considered in the generic benchmarks.
The system should always be evaluated with a benchmark
that is application domain specific.
A domain-specific benchmark should be relevant, portable
scalable and simple.

Relevant in the sense that it reflects the application domain,


portable so that it can easily be implemented on several
systems, it should apply to small and large computer
systems and be simple.
The significance of generic benchmarks are:
Generics benchmarks can be used to give a rough
estimate of the systems performance.

Вам также может понравиться