Introduction To Database Administration
Introduction To Database Administration
University of Education
The Oracle database is a relational database
management system (RDBMS) with object
extensions.
Data to be managed by an RDBMS should be
normalized(converted into two-dimensional
tables).
Structured query language (SQL, pronounced
“sequel”) is an international standard for
managing data stored in relational databases.
Oracle Database 11g offers an
implementation of SQL that is generally
compliant with the current standard, which is
SQL-2003.
Oracle Product Family
There are many products developed and marketed
by Oracle Corporation. The core products can be
grouped as follows:
The server technologies
The Oracle database
The Oracle Application Server
The Oracle Enterprise Manager
The development tools
The languages
The Oracle Developer Suite
The applications
Oracle E-Business Suite
Oracle Collaboration Suite
The Server Technologies
There is a family of products that make up the
Oracle server technology stack. Taken
together, they aim to deliver the components
of Oracle’s Grid computing architecture.
The concept underlying the Grid is
virtualization: end users ask for a service, but
they neither know nor need to know the source
of that service.
The three server technologies that Oracle
provides to help deliver the Grid are
The Oracle Database Server
The Oracle Application Server
The Oracle Enterprise Manager
The database is the main concern here: it is
the repository for data and the engine that
manages access to the data.
The Oracle Application Server runs software
on behalf of end users: it generates the user
interfaces in the form of windows displayed in
users’ browsers, and submits calls for data
retrieval and modification to the database for
execution.
The Oracle Enterprise Manager is an
administration tool for monitoring, managing,
and tuning the Oracle processes and also
(through plug-ins) many third party products
The Oracle Database Server
it is a repository for data without effective limits on
size, and that is accessed by end users either
directly through client-server tools and applications
or indirectly through applications running on an
application server.
The choice between a two-tier client-server
architecture and an architecture consisting of three
or more tiers is irrelevant to the database: it can
execute SQL invoked by client software running on a
PC local to the end user as efficiently as it can
execute SQL submitted by an application server
running on a middle-tier server on behalf of a remote
client using a browser.
Oracle Application Server
An application server replaces the client-side software
traditionally installed on end-user computers: it runs
applications centrally, presenting them to users in windows
displayed locally in web browsers.
The applications make use of data stored in one or more
database servers. Oracle Application Server is a platform for
developing, deploying, and managing web applications.
A web application can be defined as any application with which
users communicate via HTTP.
Web applications usually run in at least three tiers: a database
tier manages access to the data, the client tier (often
implemented as a web browser) handles the local window
management for communications with the users, and an
application tier in the middle executes the program logic that
generates the user interface and the SQL calls to the database.
Web applications can be developed with a
number of technologies, predominant
among which today is Java. Applications
written in Java should conform to the J2EE
(Java 2 Enterprise Edition) standard, which
defines how such applications should be
packaged and deployed.
J2EE and related standards are controlled
by Sun Microsystems and accepted by
virtually all software developers. Oracle
Application Server is a J2EE-compliant
application server.
3 tier architecture
The simplest processing model of web applications is three tier:
a client tier that manages the user interface, a middle tier that generates the
interface and issues SQL statements to the data tier, and a data tier that
manages the data itself.
In the Oracle environment, the client tier will be a browser (such as Mozilla or
Microsoft Internet Explorer) that handles local window management, handles
the keyboard input, and tracks mouse movements.
The middle tier will be an Oracle Application Server running the software
(probably written in Java) that is generating the windows sent to the client tier
for display, and the SQL statements sent to the data tier for execution.
The data tier will be an Oracle server: an instance and a database.
In this three-tier environment, there are two types of session: end-user
sessions from the client tier to the middle tier, and database sessions from the
middle tier to the data tier. The end-user sessions will be established with
HTTP. The database sessions are client-server sessions consisting of a user
process and a server process.
Oracle Enterprise Manager
Oracle Enterprise Manager comes in
three forms:
Database Control
Application Server Control
Grid Control
Database control
Database Control has facilities for real-
time management and monitoring, for
running scheduled jobs such as backup
operations, and for reporting alert
conditions interactively and through e-mail.
Oracle Enterprise Manager Database
Control is a graphical tool for managing
one database, which may be a Real
Application Clusters (RAC) clustered
database.
Application server control
Oracle Enterprise Manager Application Server
Control is a graphical tool for managing one
application server instance, or a group of instances.
The grouping technology is dependent on the
version. Up to and including Oracle Application
Server 10g release 2, multiple application servers
were managed as a farm, with a metadata repository
(typically residing in an Oracle database) as the
central management point.
This is an excellent management model and offers
superb capabilities for deploying and maintaining
applications, but it is proprietary to Oracle.
Both Database Control and Application Server
Control consist of a Java process running on the
server machine, which listens for HTTP and HTTPS
connection requests.
Administrators connect to these processes from a
browser. Database Control then connects to the local
database server, and Application Server Control
connects to the local application server.
An advantage of using browser access is that remote
management should be no problem. Most, though
naturally not all, sites will permit incoming HTTP or
HTTPS connections through their firewalls
Grid Computing
Grid computing is virtualization. This
means that at all levels there is a layer
of abstraction between what is
requested and what is provided.
In the Oracle Grid environment, end
users ask for an application service and
let the Grid work out which clustered
J2EE application server can best
provide it.
Development Tools and
Languages
The Oracle server technologies include
various facilities for developing
applications, some existing within the
database, others external to it.
Anything that can be done with OEM can
also be done through SQL statements.
Within the database, it is possible to use
three languages:
SQL
PL/SQL
Java
Languages Internal to the
Database
SQL is used for data access, but it cannot be used just on its own for
developing complete applications. It has no real facilities for developing
user interfaces, and it also lacks the procedural structures needed for
manipulating rows individually.
The other two languages available within the database fill these gaps.
They are PL/SQL and Java.
PL/SQL is a 3GL proprietary to Oracle. It has the usual procedural
constructs (such as conditional branching based on if-then-else and
iterative looping) and facilities for user interface design.
In the PL/SQL code, one can embed calls to SQL. Thus, a PL/SQL
application might use SQL to retrieve one or more rows from the
database, then perform various actions based on their content, and
then issue more SQL to write rows back to the database.
Java offers a similar capability to embed SQL calls within the Java
code. This is industry-standard technology: any Java programmer
should be able write code that will work with an Oracle database
The DBA is likely to spend a large amount of
time tuning and debugging SQL and PL/SQL.
Oracle’s model for the division of
responsibility here is clear: the DBA identifies
code with problems and passes it to the
developers for fixing. But in many cases, the
developers lack the skills (or perhaps the
inclination) to do this and the DBA has to fill
this role. He/she will also often become a
teacher: spreading knowledge of better
techniques among the developers.
Oracle Developer Suite
Oracle Corporation provides rapid application development
tools as part of the Oracle Developer Suite. These can make
programmers far more productive than if they were working with
a 3GL
Oracle Forms Developer builds applications that run on an
Oracle Application Server middle tier and display in a Java
applet on the user’s terminal.
The entry point to Forms applications is through a browser.
Forms applications are generally much faster to develop than
applications written in, say, Java.
An advantage for end users is that the client-side intelligence
provided by the applet means that Forms applications can have
a better user interface than applications with user interfaces
generated by Java servlets.
Servlet applications are restricted by the limitations of HTML
tags, whereas the Forms applet can generate any user interface
gadget that may be required. For example, there is no HTML
tag for a rolling combo box, but these are no problem for Forms.
Oracle Applications
The Oracle E-Business Suite is a
comprehensive suite of applications
based around an accounting engine and
Oracle Collaboration Suite is a set of
office automation tools. The Oracle
Collaboration Suite includes (among
other things) servers for e-mail, diary
management, voicemail and fax, web
conferencing, and file serving.
Explain Relational Structures
Critical to an understanding of SQL is an
understanding of the relational paradigm,
and the ability to normalize data into
relational structures. Normalization is the
work of systems analysts, as they model
business data into a form suitable for
storing in relational tables. It is a science
that can be studied for years, and there are
many schools of thought that have
developed their own methods and
notations.
Rows and Tables
Using the relational paradigm, data is stored in
two-dimensional tables. A table consists of a
number of rows, each consisting of a set of
columns. Within a table, all the rows have the
same column structure, though it is possible
that in some rows some columns may have
nothing in them
A note on terminology: what Oracle refers to
as a table may also be called a relation or an
entity. Rows are sometimes called records or
tuples, and columns may be called attributes
or fields. The number of rows in the table is
the cardinality of the tuples.
Data Normalization
The process of modeling data into relational tables is
known as normalization.
There are commonly said to be three levels of
normalization: the first, second, and third normal
forms.
There are higher levels of normalization: fourth and
fifth normal forms are well defined, but any normal
data analyst (and certainly any normal human being)
will not need to be concerned with them.
It is possible for a SQL application to address un-
normalized data, but this will usually be dreadfully
inefficient because that is not what the language is
designed to do. In most cases, data stored in a
relational database and accessed with SQL should
be normalized to the third normal form.
Understand the SQL Language
SQL is defined, developed, and controlled by international
bodies. Oracle Corporation does not have to conform to the
SQL standard but chooses to do so.
The language itself can be thought as being very simple (there
are only sixteen commands), but in practice SQL coding can be
phenomenally complicated. What follow are the sixteen SQL
commands, separated into commonly used groups. The Data
Manipulation Language (DML) commands:
■ SELECT ■ INSERT ■ UPDATE ■ DELETE ■ MERGE
The Data Definition Language (DDL) commands:
■ CREATE ■ ALTER ■ DROP ■ RENAME ■ TRUNCATE ■
COMMENT
The Data Control Language (DCL) commands:
■ GRANT ■ REVOKE
The Transaction Control Language (TCL) commands:
■ COMMIT ■ ROLLBACK ■ SAVEPOINT
1. Which of these languages can run
within the database? (Choose all correct
answers.)
A. C
B. Java
C. PL/SQL
D. SQL
E. Any other language, if it is linked with
the OCI libraries
In a web application, on which tier does
the application software run? (Choose
the best answer.)
A. In the web browser on the client tier
B. On the middle tier
C. Within a Java-enabled database
For what data storage paradigm must
data be normalized? (Choose the best
answer.)
A. Hierarchical databases
B. Network databases
C. Object-oriented databases
D. Relational databases
What type of relationship should be
avoided when normalizing data?
(Choose the best answer.)
A. One-to-many
B. Many-to-one
C. Many-to-many
D. One-to-one
SQL cannot do everything. What
functions require another language?
(Choose all correct answers.)
A. User interface design
B. Branching structures such as
IF...THEN...ELSE
C. Operations that affect many rows at
once
D. Table creation and deletion
Which of these is not a SQL command?
(Choose the best answer.)
A. MERGE
B. UPSERT
C. COMMENT
D. SAVEPOINT
E. All the above are SQL commands