Presentation is loading. Please wait.

Presentation is loading. Please wait.

Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu

Similar presentations


Presentation on theme: "Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu"— Presentation transcript:

1 Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu
This PowerPoint is based on slides from: Byron Bush, Scott S. Hilpert and Lee, JeongKyu

2 Basic Oracle Architecture
Advanced Databases (ADAB) 4-Feb-2010 By Henrik Høltzer

3 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

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

5 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

6 Oracle Architecture Overview

7 Oracle Architecture Instance
An Oracle instance: Is a means to access an Oracle database Always opens one and only one database Consists of: Internal memory structures Processes

8 Oracle Architecture Interaction with the Database ( Dedicated Server )

9 Oracle Architecture Interaction with the Database ( Shared Server )

10 Oracle Architecture Database buffer cache
Used to hold data blocks read from datafiles by server processes Contains ‘dirty’ or modified blocks and ‘clean’ or unused or unchanged bocks Free space is created by DBWR writing out ‘dirty’ blocks or aging out blocks from the LRU Size is managed by the parameter DB_BLOCK_BUFFERS DB_BLOCK_BUFFERS Specifies the number of buffers in the DB buffer cache Each buffer is the size of a database block

11 Oracle Architecture Redo Log Buffer
A circular buffer that contains redo entries Redo entries reflect changes made to the database Redo entries take up contiguous, sequential space in the buffer Data stored in the redo log buffer is periodically written to the online redo log files Size is managed by the parameter LOG_BUFFER Default is 4 times the maximum data block size for the operating system LOG_BUFFER is sized in BYTES

12 Memory Structure : Shared Pool
Shared Pool Contents - Text of the SQL or PL/SQL statement - Parsed form of the SQL or PL/SQL statement - Execution plan for the SQL or PL/SQL statements - Data dictionary cache containing rows of data dictionary information Library Cache - shared SQL area - private SQL area - PL/SQL procedures and package - control structures : lock and library cache handles Dictionary Cache - names of all tables and views in the database - names and datatypes of columns in database tables - privileges of all Oracle users SHARED_POOL_SIZE Library Cache Dictionary Cache Shared SQL Area PL/SQL Procedures and Package Control Structures for example: Character Set Conversion Memory Network Security Attributes and so on .. 3) Database Buffer Cache SGA에서 disk의 data가 저장되는 곳으로서 performance에 큰 영향을 준다. 이곳의 size가 작으므로 발생 할 수 있는 현상은 빈번한 disk i/o이다.크기는 DB_BLOCK_BUFFERS로 지정하며 buffer의 갯수를 지정한다.byte 산정은 DB_BLOCK_BUFFERS * DB_BLOCK_SIZE로 산출된다. 4) Log Buffers 이것은 redo log 용도로 사용될 메모리 내의 log buffer size를 말 한다.크기는 byte단위로 LOG_BUFFERS 로 지정한다. 1. SGA 의 특징 - data와 control information을 저장한다. - SGA는 non-paged, non-swapped memory - 전체 메모리에 1/3 정도로 구성한다. 2. 오라클 기본 메모리 구조 - software code areas : 실행되고 있거나 실행될 오라클을 위한 코드가 저장되는 곳 - the system global area (SGA) the database buffer cache, the redo log buffer, the shared pool - program global areas (PGA) : 프로세스(Server,background)에 대한 data와 control 정보를 담고있다.( stack areas, data areas ) - sort areas (SORT_AREA_SIZE에서 지정) 3. Shared Pool 의 구성과 역할 - Identical SQL문 (by Hashing algorithm) for examples; Control Structures Locks Library Cache handles and so on ... Reusable Runtime Memory

13 Oracle Architecture Internal Memory Structures PGA
Program or ‘process’ Global Area (PGA) Used for a single process Not shareable with other processes Writable only by the server process Allocated when a process is created and deallocated when a process is terminated Contains: Sort area – Used for any sorts required by SQL processing Session information – Includes user privileges Cursor state – Indicates stage of SQL processing Stack space – Contains session variables Permanent portion of the PGA and temporary portion created process by process

14 Oracle Architecture Background Processes - DBWR
Writes contents of database buffers to datafiles Primary job is to keep the database buffer ‘clean’ Writes least recently used (LRU) ‘dirty’ buffers to disk first Writes to datafiles in optimal batch writes Only process that writes directly to datafiles Mandatory process

15 Oracle Architecture Background Processes - DBWR
DBWR writes to disk when: A server process cannot find a clean reusable buffer A timeout occurs (3 sec) A checkpoint occurs DBWR cannot write out ‘dirty’ buffers before they have been written to the online redo log files

16 Oracle Architecture Background Processes - LGWR
Writes contents of redo log buffers to online redo log files Primary job is to keep the redo log buffer ‘clean’ Writes out redo log buffer blocks sequentially to the redo log files May write multiple redo entries per write during high utilization periods Mandatory process

17 Oracle Architecture Background Processes - LGWR
LGWR writes to disk when: A transaction is COMMITED A timeout occurs (3 sec) The redo log buffer is 1/3 full There is more than 1 megabyte of redo entries Before DBWR writes out ‘dirty’ blocks to datafiles

18 Oracle Architecture Background Processes - SMON
Performs automatic instance recovery Reclaims space used by temporary segments no longer in use Merges contiguous areas of free space in the datafiles (if PCTINCREASE > 0) SMON ‘wakes up’ regularly to check whether it is needed or it may be called directly Mandatory process

19 Oracle Architecture Background Processes - SMON
SMON recovers transactions marked as DEAD within the instance during instance recovery All non committed work will be rolled back by SMON in the event of server failure SMON makes multiple passes through DEAD transactions and only applies a specified number of undo records per pass, this prevents short transactions having to wait for long transactions to recover SMON primarily cleans up server-side failures

20 Oracle Architecture Background Processes - PMON
Performs automatic process recovery Cleans up abnormally terminated connections Rolls back non committed transactions Releases resources held by abnormally terminated transactions Restarts failed shared server and dispatcher processes PMON ‘wakes up’ regularly to check whether it is needed or it may be called directly Mandatory process

21 Oracle Architecture Background Processes - PMON
Detects both user and server aborted database processes Automatically resolves aborted processes PMON rolls back the current transaction of the aborted process Releases resources used by the process If the process is a background process the instance most likely cannot continue and will be shut down PMON primarily cleans up client-side failures

22 Oracle Architecture Background Processes - CKPT
Forces all modified data in the SGA to be written to datafile Occurs whether or not the data has been committed CKPT does not actually write out buffer data only DBWR can write to the datafiles Updates the datafile headers This ensures all datafiles are synchronized Helps reduce the amount of time needed to perform instance recovery Frequency can be adjusted with parameters

23 Oracle Architecture Background Processes - ARCH
Automatically copies online redo log files to designated storage once they have become full

24 Oracle Architecture Server Processes
Services a single user process in the dedicated server configuration or many user processes in the shared server configuration Use an exclusive PGA Include the Oracle Program Interface (OPI) Process calls generated by the client Return results to the client in the dedicated server configuration or to the dispatcher in the shared server configuration

25 Oracle Architecture User Processes
Run on the client machine Are spawned when a tool or an application is invoked SQL*Plus, Server Manager, Oracle Enterprise Manager, Developer/2000 Custom applications Include the User Program Interface (UPI) Generate calls to the Oracle server

26 Oracle Architecture Transaction Example - Update
Step 1 Connection to server is established PGA is allocated Statement is sent to server Step 2 Server checks the shared SQL pool for a parsed statement Statement is parsed and put in shared SQL area UPDATE table SET user = ‘SHIPERT’ WHERE id = 12345

27 Oracle Architecture Transaction Example - Update
Step 3 Statement is executed Server reads data from datafiles into database buffer cache

28 Oracle Architecture Transaction Example - Update
Step 4 Server makes the change to the block in the database buffer cache

29 Oracle Architecture Transaction Example - Update
Step 5 Change to database buffer cache written to redo log buffer

30 Oracle Architecture Transaction Example - Update
Step 6 Undo information recorded in rollback segment

31 Oracle Architecture Transaction Example - Update
Step 7 Change to rollback segment recorded in the redo log buffer

32 Oracle Architecture Transaction Example - Update
Step 8 Update confirmation 1 ROW UPDATED

33 Oracle Architecture Transaction Example - Update
Step 9 COMMIT statement issued Step 10 LGWR writes the redo information to the online redo logs ‘FAST’ COMMIT COMMIT

34 Oracle Architecture Transaction Example - Update
Step 10 Successful commit message COMMIT SUCCESSFUL

35 Oracle Architecture Transaction Example - Update
Step 12 DBWR writes changed blocks to the datafile


Download ppt "Acknowledgments Byron Bush, Scott S. Hilpert and Lee, JeongKyu"

Similar presentations


Ads by Google