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

MC 0067 02

DATABASE MANAGEMENT
1) Write about - Phyi!a" Stora#e Stru!ture o$ DBMS %&'e(i&#
Phyi!a" Stora#e Stru!ture)
Physical Storage unit deals with issues related to how the data is physically
stored on the disk and some of the access mechanisms commonly used for retrieving this
data. The Internal Level is the level which deals with the physical storage data. While
designing this layer, the main obective is to optimi!e performance by minimi!ing the
number of disk accesses during the various database operations.
The process of database access in general can be seen in the following figure.
The "#$S views the database as a collection of records. The %ile $anager of the
underlying &perating System views it as a set of pages and the "isk $anager views it as
a collection of physical locations on the disk.
When the "#$S makes a re'uest for a specific record to the %ile $anager, the
latter maps the record to a page containing it and re'uests the "isk $anager for the
specific page. The "isk $anager determines the physical location on the disk.
(
%&'e(i&#
Inde)ing is one of the common method for making retrievals faster.
The e)ample for inde)ing is as follows*+
,-etrieve the records of all customers who reside in "elhi./
0ere the se'uential search on the 12ST&$3- table has to be carried out and all
records with the value 4"elhi5 in the 1ust61ity field have to be retrieved. The time taken
for this operation depends on the number of pages to be accessed..If the records are
randomly stored, the page accesses depends on the volume of data. If the records are
stored physically together, the number of pages depends on the si!e of each record also.
If such 'ueries based on 1ust61ity field are very fre'uent in the application,
steps can be taken to improve the performance of these 'ueries. 1reating an Inde) on
1ust61ity is one such method. The results will be as follows+
7 new inde) file is created. the number of records in the inde) file is same as
that of the data file. The inde) file has two fields in each. &ne field contains the value
of the 1ust61ity field and the second contains a pointer to the actual data record in the
12ST&$3- table.
Whenever a 'uery based on 1ust61ity field occurs, a search is carried out on the
Inde) file. 0ere, it is to be noted that this search will be much faster than a se'uential
search in the 12ST&$3- table, if the records are stored physically together. This is
8
because of the much smaller si!e of the inde) record due to which each page will be able
to contain more number of records.
When the records with value 4"elhi5 in the 1ust61ity field in the inde) file are
located, the pointer in the second field of the records can be followed to a directly
retrieve the corresponding 12ST&$3- records.
Thus the access involves a Se'uential access on the inde) file and a "irect access
on the actual data file.
-etrieval speed v9s update speed*
Though inde)es help making retrievals faster, they slow down updates on the
table since updates on the basis table demand update on the inde) field as well.
It is possible to create an inde) with multiple fields i.e., inde) on field
combinations. $ultiple inde)es can also be created on the sme table simultaneously
though there may be a limit on the ma)imum number of inde)es that can be created on a
table.
:
2) Write about - A**"i!atio& +o#i!
- ,&e Tier Ar!hite!ture
- C"ie&t- Ser.er Ar!hite!ture
A**"i!atio& +o#i!
"atabase architectures can be distinguished by e)amining the way application
logic is distributed throughout the system. 7pplication logic consists of three
components* Presentation Logic, Processing Logic, and Storage Logic.
The presentation logic component is responsible for formatting and presenting
data on the user5s screen. The processing logic component handles data processing
logic, business rules logic, and data management logic. finally, the storage logic
component is responsible for the storage and retrieval from actual devices such as a hard
drive or -7$. #y determining which tier;s< these components are processed on we can
get a good idea of what type pf architecture and subtype we are dealing with.
,&e Tier Ar!hite!ture
7n e)ample of a one+tier architecture is a file server architecture. In this
scenario, a workgroup database is stored in a shared location on a single machine.
Workgroup members use a software package such as $icrosoft 7ccess to load the data
and then process it on their local machine. In this case, the data may be shared among
different users, but all of the processing occurs on the local machine. 3ssentially, the
file+server is ust an e)tra hard drive from which to retrieve files.
=et another way one+tier architectures have appeared is in that of mainframe
computing. In this outdated system, large machines provide directly connected
unintelligent terminals with the emans necessary to access, view and manipulate data.
3ven though this is considered a client server system, since all of the processing power
;for both data and applications< occurs on a single machine, we have a one+tier
architecture. &ne tier architectres can be beneficial when we are dealing with data that
>
is relevant to a single user ; or small number of users< and we have a relatively small
amount of data. They are somewhat ine)pensive to deploy and maintain.
C"ie&t-Ser.er Ar!hite!ture
7 two+tier architecture is familiar to many of today5s computer users, like &racle
or S?L Server. 2sers interact through a @2I;@raphical 2ser Interface< to communicate
with the database server across a network via S?L ;Structured ?uery Language<.
In this architecture, it is important to note that two configurations e)ist. 7 thin+
client ;fat server< configuration e)ists when most of the processing occurs on the server
tier. 1onversely, a fat client ;thin+server< configuration e)ists when most of the
processing occurs on the client machine. 7nother e). can be seen in web based database
applications. In this case, users interact with the database through applications that are
hosted on a web+server and displayed through web+browser such as Internet 3)plorer.
the web server processes the web application, which can be written in a language such as
P0P or 7SP. The web app connects to a database server to pass along S?L statements
which in turn are used to access, view and modify data. The "# server then passes back
the re'uested data which is then formatted by the web server for the user.
7lthough this appears to be a three+tier system because of the number of
machines re'uired to complete the process, it is not. The web+server does not normally
house any of the business rules and therefore should be considered part of the client tier
in partnership with the web+browser. Two+tier architectures can prove to be beneficial
when we have a relatively small number of users on the system ;(AA+(BA< and we desire
an increased level of scalability.
B
2) Write about Bai! Co&tru!t o$ E-/ Mo'e"i&#
+ E-/ Notatio& 0ith e(a1*"e
Bai! !o&tru!t o$ E-/ Mo'e"i&#
The 3- model views the real world as a construct of entities and association between
entities.
3ntities
3ntities are the principal data obect about which information is to be collected.
3ntities are usually recogni!able concepts, either concrete or abstract, such as person,
place, things, or events which have relevances to the database. 7n entity is analogous to
a table in the relational model. 3ntities are classified as independent or dependent in
some methodologies, the terms used are strong and weak, respectively<. 7n independent
entity is one that does not rely on another for identification. 7 dependent entity is one
that relies on another for identification. 7n entity occurrence is an individual occurrence
of an entity. 7n occurrence is analogous to a row in the relational value.
S*e!ia" E&tity ty*e
7ssociate entities also known as intersection entities are entities used to associate
two or more entities to reconcile a many+to+many relationship.
Subtypes entities are used in generali!ation hierarchies to represent a subset of
instances of their parent entity, called the supertype, but which have attributes or
relationships that apply only to the subset.
/e"atio&hi*
7 -elationship represents an association between two or more entities.
-elationships are classified in terms of degree, connectivity, cardinality, and e)istence.
C
Attribute
7ttributes describe the entity of which they are associated. 7 particular instance
of an attribute is a value. The domain of an attribute is the collection of all possible
values an attribute can have, The domain name is a character string.
7ttributes can be classified as identifiers or descriptors. Identifiers, more
commonly called keys, uni'uely identify an instance of an entity. 7 descriptor describes
a non+uni'ue characteristic of an entity instance.
E-/ Notatio& 0ith e(a1*"e
There is no standard for representing data obects in 3- diagrams. 3ach
modeling methodology uses its own notation. The original notation used by 1hen is
widely used in academics te)ts and ournals but rarely seen in either 17S3 tools or
publications by non+academics. Today, there are a number of notations used, among the
more common are #achman, crow5s foot and I"3%ID.
7ll notation styles represent entities as rectangular bo)es and relationships as
lines connecting bo)es. 3ach style uses a special set of symbols to represent the
cardinality of a connection. The notation used in this document is from $artin. the
symbols used for the basic 3- constructs are as follows/+
+ entities are represented by labeled rectangles. the label is th name of the
entity. 3ntity names should be singular nouns.
+ relationships are represented by a solid line connecting two entities. The
name of the relationship is written above the line. -elationship names
should be verbs.
+ attributes, when included are listed inside the entity rectangle. 7ttributes
which are identifiers are unidentified. 7ttribute names should be singular
nouns.
+ cardinality of many is represented by a line ending in a crow5s foot. If the
crow5s foot is omitted, the cardinality is one.
E
+ e)istence is represented by placing a circle or a perpendicular bar on the
line. $andatory e)istence is shown by a bar ;looks like a (< ne)t to the
entity for an instance is re'uired. &ptional e)istence is shown by placing
a circle ne)t to the entity that is optionl.
2) Write about Ty*e o$ Di!retio&ary Pri.i"e#e
+ *ro*a#atio& o$ Pri.i"e#e ui&# Gra&t o*tio&
Ty*e o$ 'i!retio&ary Pri.i"e#e)
The concept of an 7uthori!ation identifier is used to refer, to a user account ;or group of
user accounts<. "#$S must provide selective access to each relation in the database
based on specific accounts. &perations may also be controlled, thus. having an account
does not necessarily entitle the account holder to all the functionality provided by the
"#$S. Informally, there are 8 levels for assigning privileges to use the database
system.
+The a!!ou&t "e.e"* 7t this level, the "#7 specifies the particular privileges that each
account holds independently of the relations in the database.
+ The re"atio& 3or tab"e) "e.e" * 7t this level, the "#7 can control the privilege to
access each individual relation or view in the database.
The privileges at the account level apply to the capabilities provided to the
account itself and can include the 1-37T3 S103$7 or 1-37T3 T7#L3 privilege, to
create a schema or base relation/ the 1-37T3 FI3W privilege/ the 7LT3- privilege, to
apply schema changes such as adding or removing attributes from relations, the "-&P
privilege, to delete relations or views/ the $&"I%= privilege, to insert, delete, or update
tuples/ and the S3L31T privilege, to retrieve information from the database by using a
S3L31T 'uery. Gotice that these account privileges apply to the account in general. If
a certain account does not have the 1-37T3 T7#L3 privilege, no relations can be
created from that account.
H
The second level of privileges applies to the relation level, whether thay are base
relations or virtual ;view< relations. The term relation may refer either to a base relation
or to a view, unless we e)plicitly specify one or the other. Privileges at the relation level
specify for each user the individual relations on which each type of command can be
applied. Some privileges also refer to individual columns;attributes< of relations. S?L
commands provide privileges at the relation and attribute level only. 7lthough this is
'uite general, it makes it difficult to create accounts with limited privileges. The
granting and revoking of privileges generally follow an authori!ation model for
discretionary privileges known as the access matri) model, where the rows of a matri)
$ represent subects ;users, accounts, programs< and the columns represent obects
;relations, records, columns, views, operations<. 3ach position $;i, < in the matri)
represents the types of privileges ;read, write, update< that subect i holds on obect .
In S?L the following types of privileges can be granted on each individual
relation -*+
+ S3L31T ;retrieval or read< privilege on -* @ives the account retrieval
privilege. In S?L this gives the account the privilege to use the S3L31T
statement to retrieve tuples from -.
+ $&"I%= privileges on -* This gives the account the capability to modify
tuples of -. In S?L this privilege is further divided into 2P"7T3,
"3L3=3 and IGS3-T privileges to apply the corresponding S?L
command to -. In addition, both the IGS3-T and 2P"7T3 privileges
can specify that only cetain attributes of - can be updated by the account.
+ -3%3-3G13S privileges on -* This gives the account the capability to
reference relation - when specifying integrity constraints. This privilege
can also be restricted to specific attributes of -.
Gotice that to create a view, the account must have S3L31T privilege on all relations
involved in the view definition
I
Pro*a#atio& o$ Pri.i"e#e 4i&# the #ra&t o*tio&
Whenever the owner 7 of a relation - grants a privilege on - to another account
#, the privilege can be given to # with or without the @-7GT &PTI&G, if the @-7GT
&PTI&G is given, this means that # can also grant that privilege on - to other accounts.
Suppose that # is given the @-7GT &PTI&G by 7 and that # then grants the privilege
on - to a third account 1, also with @-7GT &PTI&G. In this way, privileges on - can
propagate to other accounts without the knowledge of the owner of -. If the owner
account 7 now revokes the privilege granted to #, all the privileges that # propagated
based on that privilege should automatically be revoked by the system.
(A

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