Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Oracle Documentation
http://tahiti.oracle.com/
http://www.oracle.com/pls/db112/homepage?
remark=tahiti
2/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Tasks of a Database Administrator
3/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Objectives of the lecture
4/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
The Oracle Server
Oracle server
Application/
network
server
Server Users
5/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Oracle server
6/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Oracle Database
Parameter
file
Password Archived
file log files
Database
9/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Connecting to a Database
Client Server
Server
Client Connection Server
process
established
Session created
User
User
10/49
10/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
User Process
Runs
Runs onon the
the client
client machine
machine
Is
Is spawned
spawned when
when aa tool
tool or
or an
an application
application
is
is invoked
invoked
Runs
Runs the
the tool
tool or
or application
application (SQL*Plus,
(SQL*Plus,
Oracle
Oracle Enterprise
Enterprise Manager,
Manager, OracleForms)
OracleForms)
Generates
Generates calls
calls to
to the
the Oracle
Oracle server
server
11/49
11/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Connection
Runs
Runs on
on the
the server
server machine
machine (host)
(host)
Services
Services aa single
single user
user process
process in
in the
the
dedicated
dedicated server
server configuration
configuration
Uses
Uses an
an exclusive
exclusive Program
Program Global
Global Area
Area
(PGA)
(PGA)
Processes
Processes calls
calls generated
generated by
by the
the client
client
Returns
Returns results
results to
to the
the client
client
14/49
14/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Oracle Instance
Instance
SGA
SGA -
System Global Area
Background processes
An
An Oracle
Oracle instance:
instance:
Is
Is aa means
means to
to access
access an
an Oracle
Oracle
database
database
Always
Always opens
opens one
one and
and only
only one
one
database
database
15/49
15/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Oracle Memory Structures
+ Streams Pool
in 10g
+ Result cache
in 11g
+ User Global
Area in 11g
16/49
16/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
System Global Area (SGA)
SHOW SGA;
18/49
18/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Sizing the SGA
19/49
19/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
System Global Area (SGA)
20/49
20/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
The Shared Pool
Shared pool
Library
cache
Data
dictionary
cache
Size
Size defined
defined by
by SHARED_POOL_SIZE
SHARED_POOL_SIZE
Library
Library cache
cache contains
contains statement
statement text,
text,
parsed
parsed code,
code, and
and an
an execution
execution plan
plan
Data
Data dictionary
dictionary cache
cache contains
contains table
table
and
and column
column definitions
definitions and
and privileges
privileges
21/49
21/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Resizing
22/49
22/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Library Cache
23/49
23/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
The library cache consists of two structures:
Shared SQL: The Shared SQL stores and
shares the execution plan and parse tree for
SQL statements run against the database. The
second time that an identical SQL statement
is run, it is able to take advantage of the
parse information available in the shared SQL
to expedite its execution. To ensure that SQL
statements use a shared SQL area whenever
possible, the text, schema, and bind
variables must be exactly the same.
Shared PL/SQL: The shared PL/SQL area
stores and shares the most recently executed
PL/SQL statements. Parsed and compiled
program units and procedures (functions,
packages, and triggers) are stored in this
24/49
24/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
area.
Data Dictionary Cache
26/49
26/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Database Buffer Cache
Stores
Stores the
the most
most recently
recently used
used blocks
blocks that
that
have
have been
been retrieved
retrieved from
from the
the data
data files
files..
DB_BLOCK_SIZE
DB_BLOCK_SIZE determines
determines the
the primary
primary
block
block size
size..
27/49
27/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Multiple Block Sizes
28/49
28/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Database Buffer Cache
29/49
29/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Types of buffers
30/49
30/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Access modes of a buffer
31/49
31/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Two lists of (pointers to) buffers
32/49
32/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
LRU list
35/49
35/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Buffer Touch Count
The frequency of access of buffers on the LRU list
- instead of constantly shuffling buffers on the LRU
list.
When a buffer gets pinned, the database
determines when its touch count was last
incremented. If the count was incremented over
three seconds ago, then the count is incremented.
If a buffer is on the cold end of the LRU, but its
touch count is high, then the buffer moves to the
hot end. If the touch count is low, then the buffer
ages out of the cache.
36/49
36/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Redo Log Buffer Cache
Size
Size defined
defined by
by LOG_BUFFER
LOG_BUFFER
Records
Records changes
changes made
made through
through the
the
instance
instance
Used
Used sequentially
sequentially
Circular
Circular buffer
buffer
37/49
37/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Redo Log Buffer Cache
38/49
38/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Result cache (11g)
Result
43/49
43/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Streams Pool (10g)
Oracle Streams enables information sharing.
Using Oracle Streams, each unit of shared
information is called a message, and you can
share these messages in a stream. The stream
can propagate information within a database or
from one database to another. The stream
routes specified information to specified
destinations.
Not
Not shared
shared
Server PGA
Contains:
Contains: process
Sort
Sort area
area
SORT_AREA_SIZE
SORT_AREA_SIZE Memory region that
Sort contains data and control
Sort area
area size
size can
can grow
grow
depending information for a single
depending onon the
the need.
need.
server process or a single
Session
Session information
information background process. The
Cursor state PGA is allocated when a
Cursor state
process is created and
Stack
Stack space
space deallocated when the
process is terminated.
45/49
45/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
PGA
46/49
46/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
User Global Area (UGA)
47/49
47/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Summary 1
48/49
48/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.
Summary 2
Fixed SGA
internal area for
communication
between
processes
49/49
49/49 Copyright Oracle Corporation, 1998, 2001, 2010. All rights reserved.