copyright oracle corporation, 1998. all rights reserved. 1 oracle architectural components
TRANSCRIPT
Copyright Oracle Corporation, 1998. All rights reserved.
11
Oracle Architectural Components
Oracle Architectural Components
1-1-22 Copyright Oracle Corporation, 1998. All rights reserved.
ObjectivesObjectives
• Listing the structures involved in connecting a user to an Oracle server
• Listing the stages in processing a query
• Listing the stages in processing a DML statement
• Listing the stages in processing COMMITS
• Listing the structures involved in connecting a user to an Oracle server
• Listing the stages in processing a query
• Listing the stages in processing a DML statement
• Listing the stages in processing COMMITS
1-1-33 Copyright Oracle Corporation, 1998. All rights reserved.
The Oracle ServerThe Oracle Server
Server
Application/networkserver
Users
Oracle server
1-1-44 Copyright Oracle Corporation, 1998. All rights reserved.
Connecting to a DatabaseConnecting to a Database
UserUser
ClientClient ServerServerServerServer
processprocess
Oracle serverUserUserprocessprocess
1-1-55 Copyright Oracle Corporation, 1998. All rights reserved.
User ProcessUser Process
• Runs on the client machine
• Is spawned when a tool or an application is invoked
• Runs the tool or application (SQL*Plus, Server Manager, Oracle Enterprise Manager, Developer/2000)
• Includes the User Program Interface (UPI)
• Generates calls to the Oracle server
• Runs on the client machine
• Is spawned when a tool or an application is invoked
• Runs the tool or application (SQL*Plus, Server Manager, Oracle Enterprise Manager, Developer/2000)
• Includes the User Program Interface (UPI)
• Generates calls to the Oracle server
1-1-66 Copyright Oracle Corporation, 1998. All rights reserved.
Server ProcessServer Process
• Runs on the server machine (host)
• Services a single user process in the dedicated server configuration
• Uses an exclusive PGA
• Includes the Oracle Program Interface (OPI)
• Processes calls generated by the client
• Returns results to the client
• Runs on the server machine (host)
• Services a single user process in the dedicated server configuration
• Uses an exclusive PGA
• Includes the Oracle Program Interface (OPI)
• Processes calls generated by the client
• Returns results to the client
1-1-77 Copyright Oracle Corporation, 1998. All rights reserved.
Oracle InstanceOracle Instance
Background processes
An Oracle instance:
• Is a means to access an Oracle database
• Always opens one and only one database
An Oracle instance:
• Is a means to access an Oracle database
• Always opens one and only one database
Instance
SGA
1-1-88 Copyright Oracle Corporation, 1998. All rights reserved.
Oracle DatabaseOracle Database
Control files
Redo logfiles
Data filesPasswordfile
Parameterfile
Archivedlog files
Database
1-1-99 Copyright Oracle Corporation, 1998. All rights reserved.
Database
Other Key Physical StructuresOther Key Physical Structures
Archivedlog files
Passwordfile
Parameterfile
1-1-1010 Copyright Oracle Corporation, 1998. All rights reserved.
UserUserprocessprocess
ServerServerprocessprocess
Processing a QueryProcessing a Query
ParseParse
StatementStatement
OKOK
HandleHandle
ExecuteExecute
OKOK
HandleHandle
FetchFetch
ResultsResults
SELECT *
FROM emp
ORDER BY ename;
SELECT *
FROM emp
ORDER BY ename;
1-1-1111 Copyright Oracle Corporation, 1998. All rights reserved.
The Shared PoolThe Shared Pool
• Size defined by SHARED_POOL_SIZE
• Library cache contains statement text, parsed code, and an execution plan
• Data dictionary cache contains table and column definitions and privileges
• Size defined by SHARED_POOL_SIZE
• Library cache contains statement text, parsed code, and an execution plan
• Data dictionary cache contains table and column definitions and privileges
Shared pool
Librarycache
Datadictionary
cache
1-1-1212 Copyright Oracle Corporation, 1998. All rights reserved.
Database Buffer CacheDatabase Buffer Cache
• Number of buffers defined by DB_BLOCK_BUFFERS
• Size of a buffer based on DB_BLOCK_SIZE
• Stores the most recently used blocks
• Number of buffers defined by DB_BLOCK_BUFFERS
• Size of a buffer based on DB_BLOCK_SIZE
• Stores the most recently used blocks
1-1-1313 Copyright Oracle Corporation, 1998. All rights reserved.
Program Global Area (PGA)Program Global Area (PGA)
• Not shared and not writable
• Contains
– Sort area
– Session information
– Cursor state
– Stack space
• Not shared and not writable
• Contains
– Sort area
– Session information
– Cursor state
– Stack space
PGAServerServerprocessprocess
1-1-1414 Copyright Oracle Corporation, 1998. All rights reserved.
Instance
SGA Shared pool
Librarycache
Redo logbuffer
Database buffercache
Datadictionary
cache
UPDATE emp
SET sal=sal*1.1
WHERE empno=7369
UPDATE emp
SET sal=sal*1.1
WHERE empno=7369
Processing a DML StatementProcessing a DML Statement
1
ServerServerprocessprocess
Control files
Redo logfiles
Data files
Database
2
3
4
5
1-1-1515 Copyright Oracle Corporation, 1998. All rights reserved.
Rollback Segment Rollback Segment
DML DML statementstatement
Old Old imageimage
New New imageimage
Rollback Rollback segmentsegment
TableTable
1-1-1616 Copyright Oracle Corporation, 1998. All rights reserved.
Redo Log BufferRedo Log Buffer
• Size defined by LOG_BUFFER
• Records changes made through the instance
• Used sequentially
• Circular buffer
• Size defined by LOG_BUFFER
• Records changes made through the instance
• Used sequentially
• Circular buffer
1-1-1717 Copyright Oracle Corporation, 1998. All rights reserved.
Instance
SGA Shared pool
DBWR
Database buffercache
Database Writer (DBWR)Database Writer (DBWR)
Control files
Redo logfiles
Data files
1-1-1818 Copyright Oracle Corporation, 1998. All rights reserved.
Instance
SGA Shared pool
Redo logbuffer
LGWR
Log Writer (LGWR)Log Writer (LGWR)
Control files
Redo logfiles
Data files
1-1-1919 Copyright Oracle Corporation, 1998. All rights reserved.
Shared pool
Redo logbuffer
LGWR
Control files
Redo logfiles
Data files
Database
COMMIT ProcessingCOMMIT Processing
ServerServerprocessprocess
1
2UserUser
processprocess
3
Database buffercache4
SGA
Instance