Overview of Oracle Database

Lee, JeongKyu (jelee@bridgeport.edu)

Part 1. Introduction to Database System 

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 

Components of the DBMS Environment 
Hardware - Software - Data - Procedures - People

 Advantages of DBMS .Economy of scale .Balance of conflicting requirements .Cost of conversion.Increased concurrency .Improved data integrity . Performance. Additional H/W costs .Improved backup and recovery services  Disadvantages of DBMS .Improved data accessibility and responsiveness .Data consistency . Higher impact of a failure .Enforcement of standards . Size.Improved maintenance through data independence .Sharing of data .Control of data redundancy .More information from the same amount of data .Complexity. Cost of DBMSs.Improved security .Increased productivity .

 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 .

Concurrency control services 5. Authorization services 7. and update 2. Recovery services 6. retrieval. A user-accessible catalog 3. Integrity services 9. Services to promote data independence 10. Transaction support 4. Functions of a DBMS 1. Utility services . Data storage. Support for data communication 8.

 Components of a DBMS Programmers Application Programs Users Queries DBA Database Schema DML preprocessor Program object code Access methods System buffers Query processor Database manager File manager DDL compiler Dictionary manager DBMS Database and system catalog .

 Components of Database Manager Authorization control Integrity checker Command processor Transaction manager Buffer manager Query optimizer Scheduler Data Manager Recovery manager .

Oracle..IDS by GE (network DBMS)  1965 .)  Now .IMS by IBM (hierarchical DBMS)  mid 1960s .CODASYL(Conference on Data SYStems Language)  1967 -DBTG(Data Base Task Group)  1970 .E. GUAM  mid 1960s .Apollo moon-landing project.commercial relational DBMS(DB2.History of RDBMS  History of DBMS  1960s .OODBMS. ORDBMS .Codd of the IBM Research Lab. Informix.  Late 1970s .F.System R project at IBM  1980s .

 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 one or more attributes  Tuple : a tuple is a row of a relation  Degree : the degree of a relation is the number of attributes it contrains  Cardinality : the cardinality of a relation is the number of tuples it contains  Relational database : a collection of normalized relation .

 Properties of Relations  The relation has a name that is distinct from all other relation names  Each cell of the relation contains exactly on atomic value  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 .

update. delete Rule5 : Comprehensive data sublanguage  Data independence rules Rule8 : Physical data independence Rule11 : Distribution independence Rule 9 : Logical data independence . 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  Data manipulation rules Rule2 : Guaranteed access Rule 4 : Dynamic online catalog based on the relational model Rule7 : High-level insert.

Entity-Relationship Modeling  Concepts of the E-R Modeling  Entity Types An object or concept that is identified by the enterprise as having an independent existence  Attributes A property of an entity or a relationship type  Relationship Types A meaningful association among entity types .

given the data requirements of an enterprise  UNF is a table that contains one or more repeating groups  1NF is a relation in which the intersection of each row and column contains one and only one value  2NF is a relation that is in 1NF and every non-primary-key attribute is fully functionally dependent on the primary key. Normalization  A technique for producing a set of relations with desirable properties.  3NF is a relation that is in 1NF. 2NF in which no non-primary-key attribute is transitively dependent on the primary key  BCNF is a relation in which every determinant is a candidate key  4NF is a relation that is in BCNF and contains no trivial multi-valued dependency  5NF is a relation that contains no join dependency .

but independent of a particular DBMS and other physical considerations. Conceptual Database Design  The process of constructing a model of the information used in an enterprise.  Physical Database Design  The process of producing a description of the implementation of the database on secondary storage. independent of all physical considerations  Logical Database Design  The process of constructing a model of the information used in an enterprise based on a specific data model. it describes the storage structures and access methods used to archieve efficient access to the data .

ISO standard  1989 .SQUARE by Boyce (System R project)  1976 . QUEL(Ingres)  1982 .Integrity Enhancement Feature (ISO)  1992 .SEQUEL by D.SEQUEL/2 (SQL) by Chamberlin and Boyce)  late 1970 .Database Language  SQL  1974 .Relational Database Language(RDL) : ANSI  1987 .Chamberlin (IBM)  1975 .SQL(Oracle).SQL2(SQL92) : ISO .

 DML  SELECT  INSERT  UPDATE  DELETE  DDL  CREATE(DROP) SCHEMA  CREATE(ALTER. DROP) TABLE  CREATE(DROP) VIEW  CREATE(DROP) INDEX . DROP) DOMAIN  CREATE(ALTER.

 Advanced SQL  View  Integrity Enhancement Feature Primary key Unique Foreign key  Access Control  Embedded SQL  Host Language Variables  Application Programming Interface  Dynamic SQL .

Understanding Oracle Database  Overview of oracle Database Architecture  Memory Structure  Process Structure  Storage Structure  New Features .Part 2.

000.100 KByte Server USER DBW0 CKPT LGWR Data File Raw Device ARCH Archive Log Mode(50M) .200.Overview of Oracle Architecture PMON SMON RECO D000 S000 P000 * Total SGA Size : 1700 Mbyte * Fixed Size : 70 Kbyte * Variavle Size : 490 MByte SGA Shared SQL Area Database Buffer Cashe Redo Log Buffer TL-812 4.000 KByte 2.000 KByte 1.

.Memory Structure : Shared Pool Shared Pool Library Cache Shared SQL Area Control Structures for example: PL/SQL Procedures and Package Character Set Conversion Memory Network Security Attributes and so on .Text of the SQL or PL/SQL statement Dictionary Cache .Parsed form of the SQL or PL/SQL statement .  Shared Pool Contents ..privileges of all Oracle users  SHARED_POOL_SIZE .Data dictionary cache containing rows of data dictionary information  Library Cache Control Structures for examples.Execution plan for the SQL or PL/SQL statements .names of all tables and views in the database .control structures : lock and library cache handles  Dictionary Cache Reusable Runtime Memory .PL/SQL procedures and package .shared SQL area .names and datatypes of columns in database tables .private SQL area ... Locks Library Cache handles and so on .

Memory Structure :Database Buffer Cache  Database Buffer Cache holds copies of data blocks read from disk  All users concurrently connected to the system share access to the buffer cache  Dirty List  LRU List  Size = DB_BLOCK_SIZE * DB_BLOCK_BUFFERS SGA Shared Pool Shared SQL Area Database Buffer Cache .

Memory Structure :Redo Log Buffer      Circular buffer containing information about changes made to the database save it redo entry Redo Entries is used when Database Recovery DBWR write contents of Redo Log Buffer to Online Redo Log LOG_BUFFER change vector #1 redo record change vector #1 change vector #1 .

Oracle Processes SNPn Pnnn SGA Database Buffer Cache Redo Log Buffer Offline Storage Device SMON PMON RECO LCK0 Snnn Dedicated Server Process DBWR Dnnn User Process LGWR ARCH CKPT Control Files Users Data Files Redo Log Files .

write all dirty buffers to datafiles .writes redo log entries to disk  Commit occurs  The redo log buffers pool becomes one-third full  DBWR completes cleaning the buffer blocks at a checkpoint  LGWR time-out .A commit confirmation is not issued until the tx has been recorded in the rego log file .Use a LRU algorithm to keep most recently used blocks in memory .Defers write for I/O optimization  dirty list reaches a threshold length  A process scnas a specifed number of buffer in the LRU without finding free buffer  A time-out occurs  DBWR checkpoint occurs  LGWR (Log Writer) .Background Process  DBWR (Database Writer) .

Rolls back uncommited transactions .Reclaims space used by temporary segments no longer in use .Cont¶d  PMON (Process Monitor) .Cleans up abnormally terminated connection .Database maintenance  SMON (System Monitor) .Performs automatic instance recovery .Frees SGA resources allocated to the failed processes .Releases locks held by a terminated process .Merges contiguous area of free space in the datafile .

May write to a tape drive or to a disk  LCKn (Lock). Snnn (Server). QMNn(Queue Monitor). SNPn(Job Queue). take over LGWR¶s task of updating files at a checkpoint .Cont¶d  CKPT (Check Point) .Operates only when a log switch occurs . .CKPT improve the performance of database with many database files  ARCH (Archiver) . Dnnn (Dispatcher).If enabled.is enabled by setting the parameter CHECKPOINT_PROCESS=TRUE .Updates header of datafiles and control files at the end of checkpoint .Copies redo log files to tape or disk for media failure .More frequent checkpoint reduce recovery time from instance failure .Is optional and is only needed when in ARCHIVELOG mode . RECO (Recover). Pnnn(Parallel).

Return the results of SQL statements to the user process  Parse : check syntax.Read data blocks from disk into the shred database buffers of the SGA . optimization  Execute : applies the parse tree to the data. object resolution. perform a physical read and change  Fetch : Passes data to the user (only SELECT) . security access.Runs the tool/application and is considered the client .A user process is used when a user runs an application program .A server process must place the data in the database buffer cache .Server/User Process  User Processes .Parce and execute SQL statements .Passes SQL to the server process and receives the results  Server Processes .

listener.log..) Trace File .. sqlnet.Oracle Files        Datafile Redo Log Files Control Files Parameter File Archive File Log File (alert*.log.log.

Storage Architecture  Physical storage structures  Data files  Segments  Extents  Blocks  Logical storage structures  Tablespaces  Tables / Clusters / Indexes  Rows  Columns .

and Blocks Segment 96K Extent 24K 2K 2K 2K 2K 2K 2K 2K 2K 2K 2K Extent 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 Database Blocks . Extents.Physical Storage Architecture  Relationship among Segments.

ORA DATA2.ORA .ORA DATA3.Logical Storage Architecture  Relationship between tablespaces and datafiles Database System Tablespace USER Tablespace DATA1.

Cont¶d  Objects stored in tablespaces Tablespace (one or more datafiles) Table INDEX INDEX INDEX INDEX INDEX Table INDEX INDEX INDEX INDEX INDEX Table Database Files (Physical structures associated with only one tablespace) Objects (stored in tablespace may span serveral datafiles) .

Segment type) 85 ~ 100 bytes Table info in Cluster Row info in Block (2 byte per row) Row Data using when New Row Insert or Update (pctfree. pctused) Table or Index Data .Block Header Table Dictionary Row Dictionary Free Space General Block Information (Block add.

block is listed in FREELIST .PCTFREE / PCTUSED PCTFREE PCTUSED 20% Free space 61% Free space PCTFREE = 20 Insert new row until 80% 20% use when Update PCTUSED = 40 Can insert new row when below 60% When Usage is below 40% (61% Free space).

The segment is dropped and truncated.  Extent are de-allocated when the .  Extent are allocated when.The segments grows (NEXT EXTENT) . .The segment is created (INITIAL EXTENT) .The table is altered to allocate extents.The segment is larger than optimal and contains free extents (for rollback segments only)  Each segment is  ALTER TABLE created with at least on extend( initial extent ) table_name DEALLOCATE UNUSED ( Rollback segment : 2) .Extent  A set of contiguous database blocks within a datafile. .

. or recovery Temporary segment .A collection of extents that holds rollback data for rollback. read-consistency.A collection of extents that holds all of the data for a table or a cluster Index Segment .Segment       a set of one or more extents that contains all the data for a specific type of logical storage structure within a tablespace Data Segment .A collection of extents that holds data belonging to temporary tables created during a sort operation Bootstrap segment .An extent that contains dictionary definitions for dictionary tables to be loaded when the database is opened.A collection of extents that holds all of the index data for search optimization on large tables and clusters Rollback Segment .

Oracle8 New Feature VLDB. Warehouse Parallel DML Parallel Index Scans Star Query Optimization Partitioning Parallel Backup/Recovery Incremental Backup Point-in-time Recovery OLTP Advanced Queuing XA rewrite Memory reduction Serially reusable memory New OCI Interface Improve Function Performance Objects Object Relational Database Object Type Object View Network Computing Simple User Integration Simple Maintenance Simple Development .

VM in Database  Java stored procedure.Oracle8i New Features Data Warehousing Summary management  Analytic function  Hash and Composite Paritioning  Resource Management  Transportable tablespace  Functional index.  SQLJ: embedded SQL in Java  WebDB   Security Virtual Private Database  LDAP integration  N-tier authentication/authorization  SSL and X. decrypt . RAIDUS support  Data encrypt. function. virtual column   OLTP Publish and subscribe capabilities  Database event trigger  Single table hash cluster  Object type column in partition table  Partitioned index-organized table  Stable optimizer execution plans Application Development Oracle Jserver.509v3..

Key Infrastructure Area  Availability     Key Application Area     Internet Contents Management B2B and B2C eBusiness Packaged Application Business Intelligence Scalability and Performance Security Development Platform Manageability  Windows2000 Integration .Oracle 9i . Oracle9i continues to add features and capabilities that extends existing investment in mission-critical infrastructure. In addition. Oracle9i has been designed with focus on certain key development areas.The eBusiness Platform  Oracle9i continues Oracle8i's focus on the Internet by providing a series of specific capabilities and product bundles targeted at eBusiness environments.

Oracle Client/Server Architecture NETWORK Client Application Client/Server Server b Server/Server Server A  Benefit of Client/Server Component .Only Server upgrade to increase size .Minimize network resource . consistency. transparency .Minimize Client H/W spec .Database S/W work on Server . consistency.concurrency. transparency .concurrency.

Oracle¶s Client/Server middleware product . Network software like TCP/IP  Configuration File .ORA ( Client ) .Transparent Network Substrate .TNS-based application.ORA ( Client ) .Oracle¶s Network applications to access the underlying network protocols transparently . Server ) .TNSNAME.TNSNAV.transparent connection from client tool to DB ( from on DB to another ) .ORA ( Client. Oracle Protocol Adapters.works across multiple network protocol and operation system  What is TNS? .LISTENER.SQL*Net  What is SQL*Net? .ORA ( Server ) .SQLNET.

SQL*Net Configuration  TNSNAME.ORA  SQLNET.ORA info = (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=tcp) (HOST=brinfoa01) (PORT=1521) ) ) (CONNECT_DATA= (SID=BRBINFO1) ) )  LISTENER.ORA # SQLNET.AUTHENTICATION_S ERVICES=(none.EXPIRE_TIME = 0 SQLNET. beq) LISTENER= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=tcp) (HOST=brinfoa01) (PORT=1521) ) ) SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (SID_NAME=BRBINFO1) (ORACLE_HOME=/oracle7/oracle7) (ENVS='EPC_DISABLED=TRUE') ) ) STARTUP_WAIT_TIME_LISTENER=0 CONNECT_TIMEOUT_LISTENER=0 LOG_DIRECTORY_LISTENER=/oracle7/oracle7/network/log LOG_FILE_LISTENER=listener TRACE_LEVEL_LISTENER=OFF .

Scalability : Connection Pooling. and provide migration path towards distributed object architecture Net8 Focus 1. Multiplexing(Connection Manager) 2. Manageability : Configuration-free installation option. Centralized client administration.Net8 Networking Challenge  Support large mission-critical client/server. Security : Oracle Security Server  . Automated client configuration 3.

Excel. Oracle Data Control.OLE 2. Two C++ Class Library  JDBC (Java Database Connectivity ) .is a standardized API.0 Automation Server.a set of classes and interfaces written in Java to allow other Java programs to send SQL statements to a relational database management system .Provide a way for client program (eg VB. Access) to access database . JDBC OCI for Java application .a middleware product manufactured by Oracle that allows native access to Oracle7 databases from client applications via the Microsoft OLE standard .ODBC / oo4o / JDBC  ODBC (Open Database Connectivity ) . developed according to the specification of the SQL Access Group.JDBC Thin for Java applets. than allows one to connect to SQL database  oo4o (Oracle Object for OLE) .

Sign up to vote on this title
UsefulNot useful