DAVID M. KROENKE’S
DATABASE CONCEPTS, 2nd Edition
Chapter Seven
Advanced Topics
Chapter Objectives
Understand the nature, need and
importance of the following topics:





Web database processing
Database processing with XML
Distributed database processing
OLAP and data mining
Object-relational database management
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-2
Web Database Processing
• Client computers use browsers
• Web server communicates via
Hypertext Transfer Protocol (HTTP)
and scripting / programming
languages to browsers and DBMS
• DBMS communicates with database
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-3
Web Database Processing
Environment
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-4
N-Tier Architecture
• Tiers refers to the number of computers
involved in the Web database application
– The user’s workstation with its’ Web browser is
the first tier
– Two-tier architecture means that the Web
server and the DBMS are on the same server
– Three-tier architecture means that the Web
server and the DBMS are on separate servers
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-5
Typical Web Server Setups
Microsoft
Windows
Linux or Unix
Web Server
Internet Information Apache
Server (IIS)
Scripting
Languages
(Interpreted
ASP Pages with
VBScript or JScript
(PHP also works)
PHP
Object Oriented
Languages
(Complied)
ASP.NET pages
with
VisualBasic.Net,
C#.Net or others
JSP pages with
Java
(Also see the Mono
project)
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-6
Typical Web DBMS Servers
Microsoft
Windows
Linux or Unix
Web Server
Internet Information
Server (IIS)
Apache
DBMSs
Microsoft
SQL Server
Oracle
MySQL
API Interface
Standard
ODBC
JDBC
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-7
API Interface Standards
• Every DBMS has a different
application program interface (API)
• API interface standards are used to
make it easier for programmers – they
write to the interface standard instead
of the DBMS API
– OBDC – Open Database Connectivity
– JDBC – Not an acronym for anything!
(in particular, not Java Database Connectivity)
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-8
Sample HTML Code
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type"
CONTENT="text/html;charset=windows1252">
<TITLE>Artist</TITLE>
</HEAD>
<!--#include
virtual="ADOExamples/adovbs.inc"-->
<BODY>
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-9
Sample ASP Code
<%
Dim objConn, objRecordSet, varSql
If IsObject(Session("_conn")) Then
' if already have a connection, use it
Set objConn = Session("_conn")
Else
Set objConn = Server.CreateObject("ADODB.connection")
' get connection
objConn.open "ViewRidgeSS"
' open VRG database using operating
system authentication
objConn.IsolationLevel = adXactReadCommitted ' avoid dirty reads
Set Session("_conn") = objConn
End If
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-10
Sample ASP Code (continued)
Set objRecordSet = Server.CreateObject("ADODB.Recordset")
' create the record set object
varSql = "SELECT Name, Nationality FROM ARTIST"
' set up SQL command
objRecordSet.Open varSql, objConn, adOpenStatic,
adLockReadOnly
' static with no need to update
%>
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-11
Database Procesing with XML
• Extensible Markup Language (XML)
is a standard for defining the structure
of documents and communicating the
documents among computers
• It provides user definable tags that
can be used in Web pages and other
documents
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-12
Sample XML document
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE customer SYSTEM "C:\XML Docs\customer.dtd">
<customer>
<name>
<firstname>Michelle</firstname>
<lastname>Correlli</lastname>
</name>
<address>
<street>1824 East 7th Avenue</street>
<unit>Suite 700</unit>
<city>Memphis</city>
<state>TN</state>
<zip>32123-7788</zip>
</address>
</customer>
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-13
XML Schema Documents
• XML schema documents define
allowable tags and their relationships
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-14
XML Document Validation
• An XML document can declare the name
and location of the schema that defines its
tags
• XML documents that conform to their XML
schemas are schema-valid documents
• XML schema documents are XML
documents, and can be validated against
their designated schema
• The “Schema of all schemas” is at
www.w3.org/2001/XMLSchema
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-15
Sample XML Schema
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xsd:element name=“CUSTOMER-DATA">
<xsd:complexType>
<xsd:sequence>
<xsd:element name=“CUSTOMER">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name"/>
<xsd:element name="Phone/>
<xsd:element name="Email"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-16
XML and Database Processing
• DBMS programs are incorporating
means to read and create XML
documents
• SQL Server example:
SELECT
FROM
*
ARTIST
FOR XML AUTO, ELEMENTS;
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-17
XLM Web Services
• XML Webs Services allows
application functionality on one Web
server to be shared and incorporated
into Web applications on other Web
servers
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-18
Distributed Database
Processing
• A database is distributed when it is:
– Partitioned
– Replicated
– Both partitioned and replicated
• This is fairly straight forward for readonly replicas, but it can be very
difficult for other installations
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-19
Type of Distributed Databases
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-20
OLAP and Data Mining
• OnLine Analytical Processing (OLAP) is a
technique for dynamically examining
database data
– OLAP uses arithmetic functions (Sum, Average,
etc)
• Data Mining is a mathematically
sophisticated technique for analyzing
database data
– Data mining use mathematical and statistical
techniques
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-21
OLAP
• OLAP uses a table called an OLAP
cube
• The OLAP cube uses inputs called
dimensions
• The OLAP cube calculates outputs
called measures
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-22
Sample OLAP Cube
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-23
Data Mining Techniques
• Data Mining mathematical and
statistical techniques include:
– Cluster analysis
– Regression analysis
– Time-series analysis
– Factor analysis
– Nonparametric Monte Carlo analysis
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-24
Object-Relational Database
Management
• Object-oriented programming (OOP)
is based on objects, and OOP is now
used as the basis of many computer
programming languages
– Java
– VisualBasic.Net
– C++
– C#
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-25
Objects
• Object classes have
– Identifiers
– Properties
• These are data items associated with the object
– Methods
• These are programs that allow the object to perform
tasks
• The only difference between entity classes
and object classes is the methods.
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-26
Object Persistence
• Object persistence means that
values of the object properties are
storable and retrievable
• Object persistence can be achieved
by various techniques
– A main technique is database
technology
– Relational databases can be used, but
require substantial programming
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-27
OODBMS
• Object-Oriented DBMSs (OODBMSs)
have been developed
– Never achieved commercial success
• It would be too expensive to transfer existing
data from relational and other legacy
databases
• Therefore, the OODBMSs were not cost
justifiable
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-28
Object-Relational DBMSs
• Some relational DBMS vendors have
added object-oriented features to their
products
– Oracle
• These products are known as objectrelational DBMSs and support objectrelational databases
DAVID M. KROENKE’S DATABASE CONCEPTS, 2nd Edition
© 2005 Pearson Prentice Hall
7-29
DAVID M. KROENKE’S
DATABASE CONCEPTS, 2nd Edition
End of Presentation on Chapter Seven
Advanced Topics
Descargar

Kroenke-DBC-e02-PP