Professional Documents
Culture Documents
1
Title of Assignment:
Implement a
system using
Inheritance in ORDBMS.
multivalued
Attributes
and
ORDBMS Definition
An object relational database is also called an object
relational database management system (ORDBMS). This system
simply puts an object oriented front end on a relational
database (RDBMS). When applications interface to this type
of database, it will normally interface as though the data
is stored as objects. However the system will convert the
object information into data tables with rows and columns
and handle the data the same as a relational database.
Likewise, when the data is retrieved, it must be reassembled
from simple data into complex objects.
Advantages of Objects
In general, the object-type model is similar to the class
mechanism found in C++ and Java. Like classes, objects make
it easier to model complex, real-world business entities and
logic, and the reusability of objects makes it possible to
develop database applications faster and more efficiently.
By natively supporting object types in the database, Oracle
enables application developers to directly access the data
structures used by their applications. No mapping layer is
required between client-side objects and the relational
database columns and tables that contain the data. Object
abstraction and the encapsulation of object behaviors also
make applications easier to understand and maintain.
Below are listed several other specific advantages that
objects offer over a purely relational approach.
Objects Can Encapsulate Operations Along with Data
Objects Are Efficient
Objects Can Represent Part-Whole Relationships
following sections.
Object Types
An object type is a kind of data type. You can use it in the
same ways that you use more familiar data types such as
NUMBER or VARCHAR2. For example, you can specify an object
type as the data type of a column in a relational table, and
you can declare variables of an object type. You use a
variable of an object type to contain a value of that object
type. A value of an object type is an instance of that type.
An object instance is also called an object.
Object types also have some important differences from the
more familiar data types that are native to a relational
database:
Type Inheritance
You can specialize an object type by creating subtypes that
have some added, differentiating feature, such as an
additional attribute or method. You create subtypes by
deriving them from a parent object type, which is called a
super type of the derived subtypes.
Subtypes and super types are related by inheritance: as
specialized versions of their parent, subtypes have all the
parent's attributes and methods plus any specializations
that are defined in the subtype itself. Subtypes and super
types connected by inheritance make up a type hierarchy.
Objects
When you create a variable of an object type, you create an
instance of the type: the result is an object. An object has
the
VALUE
Varrays
An array is an ordered set of data elements. All elements of a
given array are of the same data type. Each element has an
index, which is a number corresponding to the element's
position in the array.
The number of elements in an array is the size of the array.
Oracle allows arrays to be of variable size, which is why
they are called varrays. You must specify a maximum size when
you declare the array type.
For example, the following statement declares an array type:
CREATE TYPE prices AS VARRAY(10) OF NUMBER(12,2);
The VARRAYs of type PRICES have no more than ten elements,
each of datatype NUMBER(12,2).
Creating an array type does not allocate space. It defines a
datatype, which you can use as:
Nested Tables
A nested table is an unordered set of data elements, all of the
same datatype. It has a single column, and the type of that
Testing
The
attributes
and
inheritance
in
ORDBMS
is
implemented.
Assignment No.2
Title of Assignment:
Implement K-Means Data Mining Clustering Algorithm.
Relevant Theory / Literature Survey: (Brief Theory Expected)
.
and
denote
and
is
Testing:
Conclusion:
Thus grouped all the user data (X,Y)into three clusters by
minimizing the sum of squares of distances between data and
the corresponding cluster centroid.
Assignment No.3
Title of Assignment:
Design
a
Database.
Web-based
application
using
ASP
involving
Implementation:
Database Connectivity
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (ADODB.Connection)
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
C:\Databases\Students.mdb)
Dim RS
Set RS = Server.CreateObject (ADODB.Recordset)
RS.Open SELECT * FROM Students, DB
%>
</BODY>
</HTML>
The first few lines are the opening HTML tags for any page.
Theres no ASP code within them. The ASP block begins with
the statement,
Dim DB
which is a declaration of the variable that we are going to
use later on. The second line,
Set DB = Server.CreateObject (ADODB.Connection)
does the following two things:
Firstly,
the
right-hand-side
statement,
Server.CreateObject() is used to create an instance of a COM
object which has the ProgID ADODB.Connection. The Set
Statement then assigns this reference to our variable, DB.
Now, we use the object just created to connect to the
database using a Connection String.
The string,
"PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
C:\Databases\Students.mdb
is a string expression that tells our object where to locate
the database, and more importantly, what type the database
is whether it is an Access database, or a Sybase database,
or else, is it Oracle. (Please note that this is a
Connection String specific to Access 2000 databases. This
example does not use ODBC.)
If the DB.Open statement succeeds without an error, we have
a valid connection to our database under consideration. Only
after this can we begin to use the database.
The immediate next lines,
Dim RS
Set RS = Server.CreateObject (ADODB.Recordset)
serve the same purpose as the lines for
ADODB.Connection object.
Only now
were
ADODB.Recordset! Now,
creating the
creating
an
RS.AddNew
RS (FirstName) = Kavitha
RS (LastName) = Nair
RS (Email) = kavitha@kavithanair.com
RS (DateOfBirth) = CDate(4 Feb, 1980)
RS.Update
%>
</BODY>
</HTML>
Updating Records
<HTML>
<HEAD>
<TITLE>Student Records</TITLE>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (ADODB.Connection)
DB.Mode = adModeReadWrite
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
C:\Databases\Students.mdb)
Dim RS
Set RS = Server.CreateObject (ADODB.Recordset)
RS.Open
SELECT
*
FROM
Students
WHERE
FirstName
Kavitha, DB, adOpenStatic, adLockPessimistic
RS (Email) = mynewemail@kavithanair.com
RS (DateOfBirth) = CDate(4 Feb, 1980)
RS.Update
%>
</BODY>
</HTML>
Deleting Records
<HTML>
<HEAD>
<TITLE>Student Records</TITLE>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (ADODB.Connection)
DB.Mode = adModeReadWrite
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
C:\Databases\Students.mdb)
DB.Execute (DELETE * FROM Students WHERE FirstName =
Kavitha)
%>
</BODY>
</HTML>
Retrieving Data
<HTML>
<HEAD>
<TITLE>Student Records</TITLE>
</HEAD>
<BODY>
<%
Dim DB
Set DB = Server.CreateObject (ADODB.Connection)
DB.Open("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" +
C:\Databases\Students.mdb)
Dim RS
Set RS = Server.CreateObject (ADODB.Recordset)
RS.Open SELECT * FROM Students, DB
If RS.EOF And RS.BOF Then
Response.Write There are 0 records.
Else
RS.MoveFirst
While Not RS.EOF
Response.Write RS.Fields (FirstName)
Response.Write RS.Fields (LastName)
Response.Write <HR>
RS.MoveNext
Wend
End If
%>
</BODY>
</HTML>
Testing:
1. Insert data into Student Database.
2. Establish the connectivity with the database
3. Insert
record,
Delete
Record
Update
Record
and
Conclusion:
A
web
based
application
for
student
registration
is
Assignment No.4
Title of Assignment:
To create a simple multi-dimensional cube.
Relevant Theory / Literature Survey:
Installation of
Analysis Services Of MSSQL 2000 is the
primary requirement. When we installed MSSQL 2000 Analysis
Services, Analysis Manager was also installed as a tool .
What is a Cube?
Cubes are the main objects in online analytic processing
(OLAP), a technology that provides fast access to data in a
data warehouse. A Cube
is a set of data that is usually
constructed from a subset of a data warehouse and is
organized and summarized into a multidimensional structure
defined by a set of
dimensions and measures. A Cube
provides an easy-to-use mechanism for querying data with
quick and uniform response times.
Every cube has a schema, which is the set of joined tables
in the data warehouse from which the cube draws its source
data. The central table in the schema is the fact table, the
source of the cube's measures. The other tables are
dimension tables, the sources of the cube's dimensions.
A cube is defined by the measures and dimensions that it
contains. For example, a cube for sales analysis includes
the
measures
Item_Sale_Price
and
Item_Cost
and
the
dimensions Store_Location, Product_Line, and Fiscal_Year.
This cube enables end users to separate Item_Sale_Price and
Item_Cost
into
various
categories
by
Store_Location,
Product_Line, and Fiscal_Year.
Each cube dimension can contain a hierarchy of levels to
specify the categorical breakdown available to end users.
For example, the Store_Location dimension includes the level
hierarchy: Continent, Country, Region, State_Province, City,
Store_Number. Each level in a dimension is of finer
granularity than its parent. For example, continents contain
countries,
and
states
or
provinces
contain
cities.
Similarly, the hierarchy of the Fiscal_Year dimension
includes the levels Year, Quarter, Month, and Day.
Conclusion:
A simple multi-dimensional cube is created and studied
Assignment No.5
Title of Assignment:
Study OF LDAP (Light weight Directory Access Protocol)
Relevant Theory / Literature Survey:
Directory Service
A Directory is like a database: you can put information in,
and later retrieve it. But it is specialized. Some typical
characteristics are: designed for reading more than writing,
offers a static view of the data, simple updates without
transactions. Directories are tuned to give quick-response
to high-volume lookup or search operations.
A Directory Service sports all of the above, plus a network
protocol used to access the directory. And perhaps also a
replication scheme, a data distribution scheme.
The Lightweight Directory Access Protocol (LDAP) is a
protocol for accessing online directory services. It runs
directly over TCP, and can be used to access directory
services back-ended by X.500, standalone LDAP directory
services or other kinds of directory servers.
X500
LDAP was originally developed as a front end to X.500, the
OSI directory service. X.500 defines the Directory Access
Protocol (DAP) for clients to use when contacting directory
servers. DAP is a heavyweight protocol that runs over a full
OSI stack and requires a significant amount of computing
resources to run. LDAP runs directly over TCP and provides
most of the functionality of DAP at a much lower cost. This
use of LDAP makes it easy to access the X.500 directory.
X500 in more depth
In X.500, the namespace is explicitly stated and is
hierarchical. Such namespaces require relatively complicated
management schemes. The naming model defined in X.500 is
concerned mainly with the structure of the entries in the
namespace, not the way the information is presented to the
user. Every entry in a X.500 Directory Information Tree, or
DIT, is a collection of attributes, each attribute composed
of a type element and one or more value elements.
The X.500 standard defines 17 object classes for directories
as a baseline. Being extensible, X.500 directories may
include other objects defined by implementors. The 17 basic
object classes include:
Alias
Country
Locality
Organization
Organizational Unit
Person
the information
a namespace defining how information is referenced and
organized
an emerging distributed operation model defining how
data may be distributed and referenced (v3)
Both the protocol itself and the information model are
extensible
Data Types
Any data types can be into the directory: Text, Photos,
URLs, Pointers to whatever, Binary data, Public Key
certificates.
Different types of data are held in attributes of different
types. Each attribute type has a particular syntax. The LDAP
standard describes a rich set of standard attribute types
and syntax (based on X.500's set). Plus, you may define your
own attributes, syntax, and even object classes -- you can
tailor your directory to your own site's specific needs.
The information model and namespace
They are based on Entries. An entry is simply a place where
one stores attributes. Each attribute has a type and one or
more values.
Entries themselves are "typed". This is accomplished by the
objectClass attribute.
The namespace is hierarchical, so it has the concept of
fully-qualified names called Distinguished Names (DN).
DN
is
"cn=test
entry,
ou=people,
Given all this, what's the full DN of the LDAP record for
this oatmeal recipe? Remember, it reads backwards - just
like a host name in DNS.
cn=Oatmeal Deluxe,ou=recipes,dc=foobar,dc=com
(login-based)
LDAP (and X.500) use uid to mean "User ID", not to be
confused with the UNIX uid number. Most companies try to
give everyone a unique login name, so this approach makes
good sense for storing information about employees. You
don't have to worry about what you'll do when you hire the
next Fran Smith, and if Fran changes her name (marriage?
divorce? religious experience?), you won't have to change
the DN of the LDAP entry.
cn=FranSmith,ou=employees,dc=foobar,dc=com
(name-based)
Here we see the Common Name (CN) entry used. In the case of
an LDAP record for a person, think of the common name as
their full name. One can easily see the downside to this
approach: if the name changes, the LDAP record has to "move"
from one DN to another. As indicated above, you want to
avoid changing the DN of an entry whenever possible.
An example of an induvidual LDAP entry.
Let's look at an example. We'll use the LDAP record of Fran
Smith, an employee from Foobar, Inc. The format of this
entry is LDIF, the format used when exporting and importing
LDAP directory entries.
dn: uid=fsmith, ou=employees, dc=foobar, dc=com
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: foobarPerson
uid: fsmith
givenname: Fran
sn: Smith
cn: Fran Smith
cn: Frances Smith
telephonenumber: 510-555-1234
roomnumber: 122G
o: Foobar, Inc.
mailRoutingAddress: fsmith@foobar.com
mailhost: mail.foobar.com
userpassword: {crypt}3x1231v76T89N
uidnumber: 1234
gidnumber: 1200
homedirectory: /home/fsmith
loginshell: /usr/local/bin/bash
To start with, attribute values are stored with case intact,
but searches against them are case-insensitive by default.
Certain attributes (like password) are case-sensitive when
searching.
Let's break this entry down and look at it piece by piece.
dn: uid=fsmith, ou=employees, dc=foobar, dc=com
This is the full DN of Fran's LDAP entry, including the
whole path to the entry in the directory tree. LDAP (and
NIS
the
the
uid
Conclusion:
Thus, the Light weight Directory
studied.
Access Protocol is
Assignment No 6 (a)
Title: Case Study of SQL SERVER
What is SQL Server?
SQL Server 2000 is a family of products designed to meet the
data storage requirements of large data processing systems
and commercial Web sites, as well as meet the ease-of-use
requirements of individuals and small businesses. At its
core, SQL Server 2000 provides two fundamental services to
the emerging Microsoft .NET platform, as well as in the
traditional two-tier client/server environment. The first
service is the SQL Server service, which is a highperformance, highly scalable relational database engine. The
second service is SQL Server 2000 Analysis Services, which
provides tools for analyzing the data stored in data
warehouses and data marts for decision support.
Server Components
Graphical
Tool
Description
Defining groups of servers running SQL Server
Registering individual servers in a group
Configuring all SQL Server options for each
registered server
Creating and administering all SQL Server
databases,
objects,
logins,
users,
and
permissions in each registered server
Defining
and
executing
all
SQL
Server
administrative tasks on each registered server
Designing and testing SQL statements, batches,
and scripts interactively by invoking SQL
Query Analyzer
Invoking the various wizards defined for SQL
Server
SQL Server SQL Query Analyzer is a graphical
tool that helps you to perform
a variety of
tasks:
Graphical
Tool
Description
occur at specific times or intervals Detecting
specific conditions for which administrators
have defined an action, such as alerting
someone through pages or e-mail, or issuing a
task that will address the conditions
Running
replication
tasks
defined
by
administrators
Database
Object
Description
ASSIGNMENT NO. 6b
provides
the
are
System Architecture
Transaction Management
Transaction Overview
Transaction - A sequence of executions of SQL
statements that can be treated as a single unit in which all
data changes can be committed or cancelled as a whole.
of
transaction
management
follows
the
Only
two
storage
engines
support
transaction
management: InnoDB and BDB.
The default storage engine, MyISAM, doesn't support
transaction management.
To force a table to use a non-default storage engine,
you must specify the engine name in the "create table"
statement.
SET AUTOCOMMIT = 0 | 1;
START TRANSACTOIN;
COMMIT;
ROLLBACK;
Note that:
Read Committed - Dirty Read is prevented. But NonRepeatable Read and Phantom are possible.
Repeatable Read - Dirty Read and Non-Repeatable Read
are prevented. But Phantom is still possible.
Serializable - This is the highest isolation level. All
three phenomena are prevented.
Starting a Transaction
A transaction is started by the storage engine in
response to a call to either the start_stmt() or
external_lock() methods.
If there is no active transaction, the storage engine
must start a new transaction and register the transaction
with the MySQL server so that ROLLBACK or COMMIT can later
be called.
Implementing ROLLBACK
Of the two major transactional operations, ROLLBACK is
the more complicated to implement. All operations that
occurred during the transaction must be reversed so that all
rows are unchanged from before the transaction began.
To support ROLLBACK, create a method that matches this
definition:
int (*rollback)(THD *thd, bool all);
The method name is then listed in the rollback
(thirteenth) entry of the handlerton.
The THD parameter is used to identify the transaction
that needs to be rolled back, while the bool all parameter
indicates whether the entire transaction should be rolled
back or just the last statement.
layers?
There
are
number
of
Technology
evolves.
As
new
features
are
developed,
maintaining backward compatibility in the file format is not
always possible. Users, would need to run a conversion tool
when they upgrade, or even dump/import their entire dataset.
This is obviously very inconvenient. It would be much nicer
if users could upgrade their server (for bug-fixes and other
new features) without also having to migrate all their data.
This means that a single version of the server has to
support multiple file formats.
For server developers, changes in the data storage code may
require related changes elsewhere in the server, and like
with all new code there is always the possibility of
introducing bugs. This calls for abstraction: changes in the
underlying code, to a large extent, should not affect the
code at higher levels.
Query Processing
The query processing steps:
1. Parser (builds tree)
2. Preprocessor (checks syntax, columns)
3. Optimizer (generates query execution plan)
o query transformation
o search for optimal execution plan
o plan is refined
4. Query sent to execution engine
A query has only a few pre-defined operations, which eases
the task of processing a query:
access methods (whether table scan or index)
where conditions
joins
union, group, etc
MySQL uses a left-deep linear plan for executing a query.
All of the tables fall into a single line. Many other
systems use the bushy plan, which is more tree-like.
Timour shows a large query with 5 or 6 WHERE conditions and
steps through the process of how the query is parsed.
In optimizing a SQL statement there is quite a bit of
analysis of the cost of a query. The cost is calculated by
looking at things like how many times the disk will need
accessed, the number of pages per table, the length of the
rows and keys and the data schema (key uniqueness etc).
Determining costs involves mathematical operations to
determine the cost using different methods. The type of
storage engine isn't considered in the cost.
Applications
Applications
Billing Management
MySQL Usage