Professional Documents
Culture Documents
Overview of Oracle Database
Overview of Oracle Database
Introduction to Database
History of RDBMS
Entity-Relationship Modeling
Database Language
Introduction to Database
File-Based Approach
Each program defines and manages its own data
Limitation
Separation and isolation of data
Duplication of data
Data dependence
Incompatibility of files
Fixed queries/proliferation of application program
Database Approach
A shared collection of logically related data, designed
to meet the information needs of an organization
Database Management System(DBMS)
A software system that enables users to define, create and
maintain the database and provides controlled access to
database
DDL
DML : procedural, non-procedural
Control : security, integrity, concurrency control,
recovery control, user-accessible catalog
Disadvantages of DBMS
- Complexity, Size, Cost of DBMSs, Additional H/W costs
- Cost of conversion, Performance, Higher impact of a failure
Three-Level Database Architecture
External Level
The users’ view of the database
Conceptual Level
The community view of the database
Internal Level
The physical representation of the database on the computer
Functions of a DBMS
1. Data storage, retrieval, and update
2. A user-accessible catalog
3. Transaction support
4. Concurrency control services
5. Recovery services
6. Authorization services
7. Support for data communication
8. Integrity services
9. Services to promote data independence
10. Utility services
Components of a DBMS
Programmers Users DBA
Application Database
Queries
Programs Schema
Access File
methods manager
Authorization
control
Transaction
Scheduler
manager
Data
Buffer Recovery
Manager
manager manager
History of RDBMS
History of DBMS
1960s - Apollo moon-landing project, GUAM
mid 1960s - IMS by IBM (hierarchical DBMS)
mid 1960s - IDS by GE (network DBMS)
1965 - CODASYL(Conference on Data SYStems Langua
ge)
1967 -DBTG(Data Base Task Group)
1970 - E.F.Codd of the IBM Research Lab.
Late 1970s - System R project at IBM
1980s - commercial relational DBMS(DB2, Oracle, Infor
mix..)
Now - OODBMS, ORDBMS
Terminology
Relation : a relation is a table with columns and rows
Attribute : an attribute is a named column of a relation
Domain : a domain is the set of allowable values for on
e or more attributes
Tuple : a tuple is a row of a relation
Degree : the degree of a relation is the number of attri
butes it contrains
Cardinality : the cardinality of a relation is the number
of tuples it contains
Relational database : a collection of normalized relatio
n
Properties of Relations
The relation has a name that is distinct from all other r
elation names
Each cell of the relation contains exactly on atomic val
ue
Each attribute has a distinct name
The values of an attribute are all from the same domain
The order of attributes has no significance
Each tuple is distinct; there are no duplicate tuples
The order of tuples has no significance, theoretically
When is a DBMS Relational?
Foundational rules
Rule 0 : Foundational rule Rule 12 : Nonsubversion rule
Structural rules
Rule 1 : Information representation Rule 6 : View updateing
Integrity rules
Rule 3 : Systematic treatment of null values Rule 10 : Integrity independance
SQL
1974 - SEQUEL by D.Chamberlin (IBM)
1975 - SQUARE by Boyce (System R project)
1976 - SEQUEL/2 (SQL) by Chamberlin and Boyce)
late 1970 - SQL(Oracle), QUEL(Ingres)
1982 - Relational Database Language(RDL) : ANSI
1987 - ISO standard
1989 - Integrity Enhancement Feature (ISO)
1992 - SQL2(SQL92) : ISO
DML
SELECT
INSERT
UPDATE
DELETE
DDL
CREATE(DROP) SCHEMA
CREATE(ALTER, DROP) DOMAIN
CREATE(ALTER, DROP) TABLE
CREATE(DROP) VIEW
CREATE(DROP) INDEX
Advanced SQL
View
Integrity Enhancement Feature
Primary key
Unique
Foreign key
Access Control
Embedded SQL
Host Language Variables
Application Programming Interface
Dynamic SQL
Part 2. Understanding Oracle Database
Memory Structure
Process Structure
Storage Structure
New Features
Overview of Oracle Architecture
TL-812
4,000,000 KByte 1,200,000 KByte 2,100 KByte
Shared SQL
Area
Memory Structure :Redo Log Buffer
change vector #1
redo record
change vector #1
change vector #1
Oracle Processes
Pnnn
SGA
Database Buffer Cache Redo Log
Buffer
Offline
Storage
Device
Dedicated
Snnn Server
Process
DBWR LGWR ARCH
Dnnn
User
Process CKPT
Control
Files
Users Redo Log
Data Files
Files
Background Process
User Processes
- A user process is used when a user runs an application program
- Runs the tool/application and is considered the client
- Passes SQL to the server process and receives the results
Server Processes
- A server process must place the data in the database buffer cache
- Parce and execute SQL statements
- Read data blocks from disk into the shred database buffers of the SGA
- Return the results of SQL statements to the user process
Parse : check syntax, security access, object resolution, optimization
Execute : applies the parse tree to the data, perform a physical read and cha
nge
Fetch : Passes data to the user (only SELECT)
Oracle Files
Datafile
Redo Log Files
Control Files
Parameter File
Archive File
Log File (alert*.log, sqlnet.log, listener.log...)
Trace File
Storage Architecture
Segment
96K
Extent Extent
24K 72K 2K
2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
2K 2K 2K 2K
Database Blocks
Logical Storage Architecture
Database
DATA1.ORA DATA2.ORA
DATA3.ORA
Cont’d
Objects stored in tablespaces
PCTFREE
PCTFREE PCTUSED
PCTUSED
PCTFREE = 20 PCTUSED = 40
Insert new row until 80% Can insert new row when below 60%
When Usage is below 40% (61% Free
20% use when Update space), block is listed in FREELIST
Extent
A set of contiguous database blocks within a datafile.
Extent are allocated when.
- The segment is created (INITIAL EXTENT)
- The segments grows (NEXT EXTENT)
- The table is altered to allocate extents.
Extent are de-allocated when the
- The segment is dropped and truncated.
- The segment is larger than optimal and contains free extents
(for rollback segments only)
Each segment is created with at least on extend( initial extent )
( Rollback segment : 2)
ALTER TABLE table_name DEALLOCATE UNUSED
Segment
a set of one or more extents that contains all the data for a specific type of logical storage structu
re within a tablespace
Data Segment
- A collection of extents that holds all of the data for a table or a cluster
Index Segment
- A collection of extents that holds all of the index data for search optimization on large tables a
nd clusters
Rollback Segment
- A collection of extents that holds rollback data for rollback, read-consistency, or recovery
Temporary segment
- A collection of extents that holds data belonging to temporary tables created during a sort oper
ation
Bootstrap segment
- An extent that contains dictionary definitions for dictionary tables to be loaded when the datab
ase is opened.
Oracle8 New Feature
NETWORK
Client Server b
Application
Client/Server Server/Server
Server A
Benefit of Client/Server Component
- Database S/W work on Server - Only Server upgrade to increase size
- Minimize network resource - Minimize Client H/W spec
- concurrency, consistency, transparency - concurrency, consistency, transparency
SQL*Net
What is SQL*Net?
- Oracle’s Client/Server middleware product
- transparent connection from client tool to DB ( from on DB to another )
- works across multiple network protocol and operation system
What is TNS?
- Transparent Network Substrate
- Oracle’s Network applications to access the underlying network protocols transparently
- TNS-based application, Oracle Protocol Adapters, Network software like TCP/IP
Configuration File
- TNSNAME.ORA ( Client )
- TNSNAV.ORA ( Client )
- SQLNET.ORA ( Client, Server )
- LISTENER.ORA ( Server )
SQL*Net Configuration
TNSNAME.ORA LISTENER.ORA
info = LISTENER=
(DESCRIPTION= (ADDRESS_LIST=
(ADDRESS_LIST=
(ADDRESS=
(ADDRESS=
(PROTOCOL=tcp)
(PROTOCOL=tcp)
(HOST=brinfoa01) (HOST=brinfoa01)
(PORT=1521) (PORT=1521)
) )
) )
(CONNECT_DATA= SID_LIST_LISTENER=
(SID=BRBINFO1) (SID_LIST=
) (SID_DESC=
) (SID_NAME=BRBINFO1)
(ORACLE_HOME=/oracle7/oracle7)
(ENVS='EPC_DISABLED=TRUE')
)
SQLNET.ORA )
STARTUP_WAIT_TIME_LISTENER=0
# SQLNET.EXPIRE_TIME = 0 CONNECT_TIMEOUT_LISTENER=0
SQLNET.AUTHENTICATION_S LOG_DIRECTORY_LISTENER=/oracle7/oracle7/network/log
ERVICES=(none, beq) LOG_FILE_LISTENER=listener
TRACE_LEVEL_LISTENER=OFF
Net8
Networking Challenge
Support large mission-critical
client/server, and provide migration
path towards distributed object
architecture
Net8 Focus
1. Scalability : Connection Pooling, Multiplexing(Connection Manager)
2. Manageability : Configuration-free installation option,
Centralized client administration, Automated client configuration
3. Security : Oracle Security Server
ODBC / oo4o / JDBC