Basic Oracle Architecture

Slides:



Advertisements
Similar presentations
The Architecture of Oracle
Advertisements

Introduction to Oracle
Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
Overview of Database Administrator (DBA) Tools
Oracle9i Database Administrator: Implementation and Administration 1 Chapter 2 Overview of Database Administrator (DBA) Tools.
Oracle Architecture. Instances and Databases (1/2)
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2007 all rights.
15 Copyright © 2004, Oracle. All rights reserved. Monitoring and Managing Memory.
1 - Oracle Server Architecture Overview
Harvard University Oracle Database Administration Session 2 System Level.
Oracle Architectural Components
A Guide to Oracle9i1 Introduction to Oracle9i Database Administration Chapter 11.
Introduction History The principles of the relational model were first outlined by Dr. E.F Codd in a June 1970 paper is called “A Relational Model of Data.
Oracle Architecture. Database instance When a database is started the current state of the database is given by the data files, a set of background (BG)
IS 4510 – Database Administration Module – 1 Database Architecture 9/14/20141Compiled by: Zafar Iqbal Khan.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
1 Copyright © 2009, Oracle. All rights reserved. Exploring the Oracle Database Architecture.
Oracle Overview and Architecture
Oracle Database Workshop 1 Presented to IBRI CAS 27-Nov-2011 By Abdullah Alkalbani.
Oracle Documentation Oracle DBA Course (9i, 10g, 11g) Lecture 1: Oracle Architectural Components.
OTHER DATABASE MODELS OTHER DATABASE MODELS The relational database is not the only database model in use today. Two other common models are distributed.
Chapter Oracle Server An Oracle Server consists of an Oracle database (stored data, control and log files.) The Server will support SQL to define.
Oracle on Windows Server Introduction to Oracle10g on Microsoft Windows Server.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
Database Systems Slide 1 Database Systems Lecture 5 Overview of Oracle Database Architecture - Concept Manual : Chapters 1,8 Lecturer : Dr Bela Stantic.
The protection of the DB against intentional or unintentional threats using computer-based or non- computer-based controls. Database Security – Part 2.
7202ICT – Database Administration
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Copyright  Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
Copyright © Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
Backup and Recovery Overview Supinfo Oracle Lab. 6.
Anton TopurovIT-DB 23 April 2013 Introduction to Oracle2.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
Outline Introduction to Oracle Memory Structures SGA, PGA, SCA The Specifics of the System Global Area (SGA) Structures Overview of Program Global Areas.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
1 Copyright © 2005, Oracle. All rights reserved. Introduction.
11 Copyright © 2006, Oracle. All rights reserved. Checkpoint and Redo Tuning.
INTRODUCTION TO ORACLE DATABASE ADMINISTRATION Lynnwood Brown President System Managers LLC Introduction – Lecture 1 Copyright System Managers LLC 2003.
Instance and Media Recovery Structures Supinfo Oracle Lab. 7.
Chapter 1Oracle9i DBA II: Backup/Recovery and Network Administration 1 Chapter 1 Backup and Recovery Overview MSCD642 Backup and Recovery.
18 Copyright © 2004, Oracle. All rights reserved. Backup and Recovery Concepts.
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
3 Copyright © 2004, Oracle. All rights reserved. Creating an Oracle Database.
18 Copyright © 2004, Oracle. All rights reserved. Recovery Concepts.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
6 Copyright © Oracle Corporation, All rights reserved. Backup and Recovery Overview.
3 Copyright © 2004, Oracle. All rights reserved. Database Architecture Comparison.
1 Copyright © 2006, Oracle. All rights reserved. Introduction.
What is Oracle ? Oracle is a relational database management system. It is a management system which uses the relational data model. In the relational data.
6 Copyright © 2005, Oracle. All rights reserved. Managing Database Storage Structures.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
4 Copyright © 2004, Oracle. All rights reserved. Managing the Oracle Instance.
Oracle Database Architectural Components
Chapter 21 SGA Architecture and Wait Event Summarized & Presented by Yeon JongHeum IDS Lab., Seoul National University.
Instance and Media Recovery Structures
Oracle Architectural Components
Introduction To Oracle 10g
Oracle Memory Internals
Oracle Architectural Components
Index Index.
PL/SQL Dynamic SQL and Oracle Architecture.
Database administration
Presentation transcript:

Basic Oracle Architecture Presented to HIOUG 21-Jun-2005 By Byron Bush

Workshop Objectives Identify high-level architectural components of an Oracle Database Describe the function of each of these components Identify Oracle Database internal data structures Define the mechanisms used when processing Insert/Update/Delete statements

Most people call it a “Database” Technically an Oracle Database is broken into two high-level components INSTANCE – Non-persistent, memory-based processes and structures DATABASE – Persistent, disk-based data and control files

So Why Differentiate? Most Oracle installations consist of only a single “Instance” and single “Database”… Instance Database

Oracle RAC is Different Oracle “Real Application Clusters” allow multiple “Instances” to interact with a single “Database” to provide high availability… Instance 1 Database Instance 3 Instance 2

“Instance” a Little Closer An Oracle Instance… Is a means to access an Oracle Database Always opens one and only one Database Consists of memory and background process structures

Picture of an “Instance” Library Cache Data Dictionary Cache Shared Pool SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Memory Structures Back- Ground Processes

“Database” a Little Closer An Oracle Database… Is a collection of data that is treated as a unit Consists of three file types

Picture of a “Database” Oracle Database Data Files Control Files Redo Log Files Parameter File Archived Log Files Password File

Picture of an “Instance” Library Cache Data Dictionary Cache Shared Pool SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Memory Structures Back- Ground Processes

Memory Structure Oracle’s memory structure consists of two memory areas known as: System Global Area (SGA): Allocated at instance start up, and is a fundamental component of an Oracle Instance Program Global Area (PGA): Allocated when the server process is started

System Global Area The SGA consists of several memory structures: Shared Pool Database Buffer Cache Redo Log Buffer Other structures There are two additional memory structures that can be configured within the SGA: Large Pool Java Pool

System Global Area The size of the SGA is determined by the parameters that set the sizes of the various pools; these parameters are dynamic The SGA_MAX_SIZE parameter sets the maximum size of the SGA (so you can limit it) and is not a dynamic parameter Thanks Ned!

Picture of an “Instance” Library Cache Data Dictionary Cache Shared Pool SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Memory Structures Back- Ground Processes

Shared Pool Used to store: Most recently executed SQL statements Most recently used data definitions It consists of two key performance-related memory structures: Library Cache Data Dictionary Cache Sized by the parameter SHARED_POOL_SIZE

Library Cache Stores information about the most recently used SQL and PL/SQL statements Enables the sharing of commonly used statements Is managed by a least recently used (LRU) algorithm Consists of two structures Shared SQL area Shared PL/SQL area Size is determined by the Shared Pool sizing

Picture of an “Instance” Library Cache Data Dictionary Cache Shared Pool SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Memory Structures Back- Ground Processes

Data Dictionary Cache A collection of the most recently used definitions in the database Includes information about database files, tables, indexes, columns, users, privileges, and other database objects During the parse phase, the server process looks at the data dictionary for information to resolve object names and validate access

Database Buffer Cache Stores copies of data blocks that have been retrieved from the data files Enables great performance gains when you obtain and update data Managed through an LRU algorithm DB_BLOCK_SIZE determines primary block size

Picture of an “Instance” Library Cache Data Dictionary Cache Shared Pool SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Memory Structures Back- Ground Processes

Redo Log Buffer Records all changes made to the database data blocks Primary purpose is recovery Changes recorded within are called redo entries Redo entries contain information to reconstruct or redo changes Size defined by LOG_BUFFER

Large Pool An optional area of memory in the SGA Relieves the burden place on the Shared Pool Used for: Session memory for the Shared Server I/O server processes Backup and restore operations for RMAN Does not use an LRU list Sized by LARGE_POOL_SIZE Can be dynamically resized

Java Pool Services parsing requirements for Java commands Required if installing and using Java Sized by JAVA_POOL_SIZE parameter

Oracle “Process” Structure Oracle takes advantage of various types of Processes: User Process: Started at the time a database user requests connection to the Oracle Server Server Process: Connects to the Oracle instance and is started when a user establishes a session Background Processes: Started when an Oracle instance is started

User Process A program that requests interaction with the Oracle server Must first establish a connection Does not interact directly with the Oracle server User Process Server Process Connection Established

Server Process A program that directly interacts with the Oracle server Fulfills calls generated and returns results Can be dedicated or shared server

Picture of an “Instance” Library Cache Data Dictionary Cache Shared Pool SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Memory Structures Back- Ground Processes

Background Processes Maintains and enforces relationships between physical and memory structures Mandatory background processes: DBWn PMON CKPT LGWR SMON Optional background processes: ARCn LMDn QMNn CJQ0 LMON RECO Dnnn LMS Snnn LCKn Pnnn

Database Writer (DBWn) Instance Shared Pool Library Cache Data Dictionary Cache SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others DBWn writes when: Checkpoint occurs Dirty buffers reach threshold There are no free buffers Timeout occurs Tablespace OFFLINE Tablespace READ ONLY Table DROP or TRUNCATE Tablespace BEGIN BACKUP Oracle Database Data Files Control Files Redo Log Files

Log Writer (LGWR) LGWR writes: At commit When one-third full Instance Shared Pool Library Cache Data Dictionary Cache SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others LGWR writes: At commit When one-third full When there is 1 MB of redo Every three seconds Before DBWn writes Oracle Database Data Files Control Files Redo Log Files

System Monitor (SMON) Responsibilities: Instance recovery Shared Pool Library Cache Data Dictionary Cache SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Responsibilities: Instance recovery Rolls forward changes in online redo log files Opens database for user access Rolls back uncommitted transactions Coalesces free space Deallocates temporary segments Oracle Database Data Files Control Files Redo Log Files

Process Monitor (PMON) Instance Shared Pool Library Cache Data Dictionary Cache SGA Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Cleans up after failed processes by: Rolling back the transaction Releasing locks Releasing other resources Restarting dead dispactchers Database Buffer Cache Oracle Database Data Files Control Files Redo Log Files

Checkpoint (CKPT) Responsible for: Signaling DBWn at checkpoints Instance Shared Pool Library Cache Data Dictionary Cache SGA Database Buffer Cache Redo Log Buffer Java Pool Large Pool PMON SMON DBWR LGWR CKPT Others Responsible for: Signaling DBWn at checkpoints Updating datafile headers with checkpoint information Updating control files with checkpoint information Shared Pool Oracle Database Data Files Control Files Redo Log Files

Archiver (ARCn) Optional background process Automatically archives online redo log files when ARCHIVELOG mode is set Preserves the record of all changes made to the database Oracle Database Data Files Control Files Redo Log Files Archived Logs ARCn

Oracle Data Storage Oracle keeps all system and user data in two basic storage containers: Tablespace… a logical entity known only to Oracle Data Files… physical files that may (typically) be seen from the operating system

Tablespaces Can belong to only one database at a time Consist of one or more data files Are further divided into logical units of store

Data Files Can belong to only one tablespace and one database Are a repository for schema object data Database Tablespace Data File Data File

2 Types of Tablespace Tablespaces required by Oracle for normal operations Tablespaces that contain data and indexes that support your applications

Required Tablespaces System – Contains the Oracle Data Dictionary Sysaux - New to 10g; supports historic monitoring / tuning Temporary – Used for disk-based sorting of data (select...from…order by) Undo – Used for transaction consistency during Insert / Update / Delete statements

SQL Statements (IUDS) Insert Update Delete Select What happens when someone connects to the database and issues one of these statements?

Connect to Oracle – What Happens Server Process User Process Connect User/Pwd Are “User” definition and privileges in SGA “Dictionary Cache”? If not, try to fetch from the “System” tablespace If there, validate Pwd and privileges to login Allow connection if all is right; otherwise decline connection

“Select” – What Happens First? From MyTab Order by 1; Is this statement in the “Library Cache”? If statement cached then it has been recently been “parsed” and “executed” If not cached then “parse” the statement If cached then skip parsing stage and execute statement

“Select” – Parsing the Statement From MyTab Order by 1; Does “MyTab” exist? Does user have Privs to select from “MyTab” What columns are in “MyTab” What is the first column in “MyTab”

“Select” – Executing the Statement From MyTab Order by 1; Is “MyTab” data in the SGA “Buffer Cache”? If not, fetch data into Buffer Cache Sort data in “MyTab” by the first column If can sort records in memory then do so If cannot sort in memory then use “Temporary” tablespace as disk-based staging area Return records to client process

“I/U/D” – What Happens First? Insert (a,b,c) Into MyTab; Is this statement in the “Library Cache”? If statement cached then it has been recently been “parsed” and “executed” If not cached then “parse” the statement If cached then skip parsing stage and execute statement

“I/U/D” – Executing the Statement Insert (a,b,c) Into MyTab; Validate values to be inserted Execute the statement Keep DB version of the record in “Undo” tablespace until Commit or Rollback Record changes in SGA “Redo Log Buffer” Change records in SGA “Buffer Cache” DBWn writes changed records to data file(s) as part of buffer cache management

“I/U/D” – Executing the Statement Insert (a,b,c) Into MyTab; Commit; or Rollback; If “Commit” then… LGWn writes “Redo Log Buffer” entries to “Redo Logs” Undo entries are invalidated If “Rollback” then… Migrate DB version of record in Undo back to tablespace/data file

Archivelog Mode If Instance in “Archivelog” mode Redo Log Files are “Archived” to Archive Logs; which may be used to recover your database in the case of disaster Oracle Database Data Files Control Files Redo Log Files Archived Logs ARCn

Summary What we called a “Database” is really an “Instance” and a “Database.” An Oracle “Instance” is not persistent. It consists of the System Global Area (SGA) and a collection of processes. An Oracle “Database” is persistent. It consists of a collection of “Required” and “User” tablespaces (with corresponding data files) along with other supporting files. Nearly every component of the “Instance” and “Database” are mobilized to execute SQL statements.