introduction to oracle database administration lynnwood brown president system managers llc...

29
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003 all rights reserved.

Upload: phillip-boyd

Post on 21-Jan-2016

222 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

INTRODUCTION TO ORACLE DATABASE ADMINISTRATION

Lynnwood BrownPresident System Managers LLC

Introduction – Lecture 1

Copyright System Managers LLC 2003 all rights reserved.

Page 2: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

INTRODUCTION TO DATABASES

Companies have information that must be captured and stored. The information may include:

• Customer Billing• Payroll• Product orders• Services sold• Inventory• Bank account

Copyright System Managers LLC 2003 all rights reserved.

Page 3: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

INTRODUCTION TO DATABASES

Types Of Databases

• Utility companies, banks, and airlines, mail order businesses and pharmacies are examples of companies that may use a database for Online Transaction Processing (OLTP).

• OLAP database (data warehouse).• Data warehouses do not contain mission-critical data and as

such do not require response times as quick as OLTP databases.

• OLAP databases rely on complex queries that must take millions of records into consideration for knowledge discovery.

Copyright System Managers LLC 2003 all rights reserved.

Page 4: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

INTRODUCTION TO DATABASES

In the 1960’s and 1970’s

• Automation of back-office• Ad-hoc transactions rather then batch transactions• Network Database Management System• Hierarchical Database Management System• Relational Database Management System

Information consist of data. The software that accesses the data is the management system.

Copyright System Managers LLC 2003 all rights reserved.

Page 5: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

INTRODUCTION TO DATABASES

Hierarchical Database

• A database management system that links records together like a family tree such that each record type has only one owner, e.g. an order is owned by only one customer.

• Hierarchical structures were widely used in the first mainframe database management systems.

• Creates repetition of data within the database

• Hard to relate structures that exist in the real world

Copyright System Managers LLC 2003 all rights reserved.

Page 6: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

Hierarchical RDBMS

Copyright System Managers LLC 2003 all rights reserved.

Page 7: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

INTRODUCTION TO DATABASES

Network Database

• A database management system in which each record type can have multiple owners, e.g. orders are owned by both customers and products. This contrasts with a hierarchical database (one owner) or relational database (no explicit owner).

• Designed to solve the problem of data redundancy by representing relationships in terms of sets rather than a hierarchy.

• Similar to the hierarchical model (subset of the network model). Instead of using a single-parent tree hierarchy, the network model uses set theory to provide a tree-like hierarchy with the exception that child tables were allowed to have more than one parent. This allowed the network model to support many-to-many relationships.

Copyright System Managers LLC 2003 all rights reserved.

Page 8: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

Network RDBMS

Copyright System Managers LLC 2003 all rights reserved.

Page 9: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

INTRODUCTION TO DATABASES

Relational Database

• A relational database allows the definition of data structures, storage and retrieval operations and integrity constraints. In such a database the data and relations between them are organized in tables.

• A table is a collection of records and each record in a table

contains the same fields.

• Certain fields may be designated as keys, which means that searches for specific values of that field will use indexing to speed them up.

• Everything within the relational model can be stored in tables.

Copyright System Managers LLC 2003 all rights reserved.

Page 10: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RELATIONAL DATABASE VENDORS

Several companies have relational database products. These products include:

• Oracle RDBMS• Sybase• Informix• DB2 (IBM)• Microsoft SQL-Server• Red Brick• Microsoft ACCESS• MySQL

Copyright System Managers LLC 2003 all rights reserved.

Page 11: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

ORACLE PRODUCTS SUMMARY

Oracle offers many products

• The main product is the Relational DataBase Management System.

• The Oracle RDBMS is based on the research paper “A Relational Model of Data for Large Shared Databanks” written by the IBM mathematician Dr. Ted Codd.

• Oracle offers several products designed for application development and end user support.

Copyright System Managers LLC 2003 all rights reserved.

Page 12: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

ORACLE PRODUCT SUMMARY cont.

ApplicationDevelopment Tools

* CASE*Dictonary* CASE*Designer* CASE*Generator* Oracle Graphics* Oracle Terminal* SQL*PLUS* Oracle*FORMS* Oracle*REPORTS* Oracle Precompilars

Database Utilities

* Enterprise Manager* Server Manager* Export/Import* SQL*Loader

Oracle Value-AddedSolutions

* CAD/CAM/CIM/CAE* Retail* Distribution* Project Management

Financial Applications

* Oracle General Ledger* Oracle Purchasing* Oracle Payables* Oracle Assest

Oracle Serverand

IntergratedData Dictionary

Connectivity Products

* SQL*NET* SQL*Connect* Network Manager

ManufacturingApplications

* Oracle Work In Progress* Oracle Costing* Oracle Bills of Materials* Oracle Engineering* Oracle Master Scheduling

SQL

Human ResourceApplications

* Oracle Human Resources* Oracle Payroll* Oracle Training Administrator* Oracle Time Management* Oracle WEB Employees

PL/SQLOracle Projects

* Oracle Project Costing* Oracle Project Billing* Oracle Personal Time andExpense* Oracle Activity ManagementGateway

Oracle Sales ForceAutomation

* Oracle Service* Oracle Sales and Marketing* Oracle Sales Compensation* Oracle Self Service* Oracle Financial Analyzer

Page 13: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

ORACLE PRODUCTS cont.

• The Oracle RDBMS is used as a data repository.• End user programs communicate with the Oracle

RDBMS through Oracle’s communication product NET8.

• Client applications can be developed using various applications development tools (Visual Basic, PowerBuilder, PRO*C, OCI etc...)

• Client application software generates SQL and PL/SQL to communicate with the RDBMS.

Copyright System Managers LLC 2003 all rights reserved.

Page 14: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

Structured Query Language

All relational databases use SQL

Basic SQL Commands

• SELECT – To get data from a database table

• INSERT – To place new data into the database table

• UPDATE – Modify existing data

• DELETE – Remove data

• ALTER – Modify a database objects structure

Copyright System Managers LLC 2003 all rights reserved.

Page 15: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

THE ORACLE RDBMS ARCHITECTURE

The Oracle RDBMS is separated into two distinct parts. The Oracle instance and the Oracle database.

Page 16: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHCITECTURE cont.

• The Oracle instance includes the Oracle background processes (PMON, SMON, DBWR, LGWR, TNSLSNR etc...) and a group of buffers called the System Global Area

• The database consist of the data files, log files and initialization files that are stored on the disk.

• The Oracle RDBMS consist of the instance and the database.

Copyright System Managers LLC 2003 all rights reserved.

Page 17: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

• Data files are the physical entity that makes up the logical entity called the tablespace.

• The database will consist of at least one tablespace called the SYSTEM tablespace.

• The SYSTEM tablespace contains the data dictionary.

• User data (tables, views, indexes, synonyms etc..) should never be stored in the SYSTEM tablespace.

• End users are assigned to a default tablespace.• All database objects are stored in a tablespace.

Page 18: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

• Oracle represents tables and indexes as segments.• There are four types of Oracle segments. Table,

index, temporary and rollback or UNDO segments.

• Segments consist of extents. Extents consist of data blocks.

• The finest granularity is the Oracle data block. • The Oracle data block size should be some

multiple of the operating system block-size.

Copyright System Managers LLC 2003 all rights reserved.

Page 19: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

• Oracle Data file Layout

Page 20: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

• There are three other types of files. They are log files, control files and initialization files

• Log files contain data used for database recovery.

• Control files contain information concerning the database creation and organization.

• Initialization files contain the database tuning parameters and various database startup parameters.

Copyright System Managers LLC 2003 all rights reserved.

Page 21: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

• The Oracle memory structure called the System Global Area contains the various Oracle database buffers.

• The SGA contains the database buffer cache, redo log buffer, data dictionary cache, the library cache and the sort area.

• The data dictionary cache and the library cache are often refereed to as the shared pool.

Copyright System Managers LLC 2003 all rights reserved.

Page 22: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

• Unit for SGA allocation is called a 'Granule'• A granule is a unit of contiguous virtual memory• Granule size = 4MB if the SGA size is less than

128MB• Granule size = 16MB if the SGA size is greater

than 128MB• The maximum size of the SGA is controlled by

the database initialization parameter SGA_MAX_SIZE

Copyright System Managers LLC 2003 all rights reserved.

Page 23: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

• There are several Oracle processes.• There are four main processes are DataBase

WRiter, LoG WRiter, System MONitor and Process MONitor.

• The Oracle communication process TNSLSNR.• The ARCH process is used for automatic

archiving of redo log files.• The CKPT process is used to flush data from the

buffers to the data files (checkpoint).

Copyright System Managers LLC 2003 all rights reserved.

Page 24: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

On the Windows Platform:• Oracle runs as a single process.• The Oracle process will create multiple threads• Oracle runs as a Windows service.• Various Oracle “keys” are stored in the Windows

registry.• Supports the Intel ESMA (Extended

Server Memory Architecture), which allows Oracle to access more than the 3GB of physical memory

Copyright System Managers LLC 2003 all rights reserved.

Page 25: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

Oracle Single Executable On Windows

Page 26: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

Oracle Service On Windows

Page 27: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE cont.

On the UNIX Platform:

• Oracle executable creates multiple processes.

• Requires a pre-allocated UNIX memory area to store the SGA.

• Support for most versions of UNIX and Linux

Copyright System Managers LLC 2003 all rights reserved.

Page 28: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

Oracle Memory Structure On UNIX

Page 29: INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003

RDBMS ARCHITECTURE SUMMARY

• Oracle Corporation makes many products. The central product is the RDBMS.

• Oracle’s RDBMS is divided into two parts. One part is called the instance and the other part is called the database.

• The instance consist of the various processes and memory structures.

• The database consist of the data files, log files, control files and the initialization file called init<SID>.ora.

Copyright System Managers LLC 2003 all rights reserved.