Oracle Architecture
Oracle Architecture
SQL or
Procedure Call
SQL or
Procedure
Call
Results
Client
HTTP:
GET
HTML
SQL or
Procedure Call
Proc./
Trans
Call
Results
HTML
Client
HTTP: GET
Web Server
Logical Objects
Logical Objects
Database
consists of
Schemas
own
Objects
Tables
Indexes
Sequences
Views
Procedures
Triggers
Etc
Schema Types
Application Schemas
Database
consists of
Schemas
own
Payroll
Student records
Financial Reporting
Nascar
Hollywood
User Schemas
Joe
Objects
(tables, indexes, etc)
Fred
Dave
Schema Attributes
Application Schemas
Usually referred to as a schema object
Contains a set of closely related tables and associated objects
Typical Object Reference:
Hollywood.Movies
User Schemas
Often referred to as a User or Account object.
May or may not contain personal tables (Joe.Contacts).
May or may not have the right to even create objects.
Are generally granted privileges to objects in application schemas.
LAB
Caution
LAB
Oracle
Database
consists of
Schemas
own
vs.
SQL Server
SQL Server
Software Instance
defines
Users
own
Databases
contain
Objects
Objects
Oracle
Database
consists of
Schemas (users)
Granted
Privileges to
vs.
SQL Server
SQL Server
Software Instance
defines
Users
own
Databases
contain
own
Objects
Granted
Privileges to
Objects
(tables, indexes, etc)
Profile
Provides default values for USER attributes such as
Number of Concurrent Sessions
Password complexity
LAB
Creating a role
Oracles Architecture
Database
(disk structures)
Instance B
(memory structures)
(memory structures)
Database 1
(disk structures)
Database 1
Database 2
(disk structures)
(disk structures)
Instance B
(memory structures)
(memory structures)
Via client
Or replication
process
Database 1
Database 2
(disk structures)
(disk structures)
Network
ORACLE INSTANCE
Database Buffer Cache
Shared Pool
Library
Cache
LSTNR
Data Dictionary
Cache
SERVER
SERVER
SERVER
DBWR
SMON
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
PMON
CKPT
Control
Files
Control
Files
LGWR
ARCH
On-line
Redo
On-line
Log Files
Redo
On-line
Log Files
Redo
Log Files
Background
Processes
DBWR
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Free block
Used block
Dirty block
* 100
LAB
Select
sum(decode(NAME, 'consistent gets',VALUE, 0)) "Consistent Gets",
sum(decode(NAME, 'db block gets',VALUE, 0)) "DB Block Gets",
sum(decode(NAME, 'physical reads',VALUE, 0)) "Physical Reads",
round((sum(decode(name, 'consistent gets',value, 0)) +
sum(decode(name, 'db block gets',value, 0)) sum(decode(name, 'physical reads',value, 0))) /
(sum(decode(name, 'consistent gets',value, 0)) +
sum(decode(name, 'db block gets',value, 0))) * 100,2) "Hit Ratio"
from v$sysstat
Next: change number of buffers, bounce service, large query, check hits
Shared Pool
Shared Pool
Library
Cache
Data Dictionary
Cache
Library Cache
Holds parsed SQL statements
Interrogate via v$sqlarea & v$librarycache
CURSOR_SHARING = FORCE
Data Dictionary Cache
Holds table and column definitions
and privileges
LAB
Oracle Processes
Background Processes
run on server
-as separate processes on UNIX (ps ef | grep
-As separate threads in single service on NT
<ORA_SID>)
Listener Process
one or more per server
listens for connection requests
hands off to server process (on diff. Port)
Server Processes
Run on server
Typically one process to support each connected user (unless MTS)
LAB
LAB
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Update Emp
Set Sal = 40000
Where name=FRED
On-line
Redo
On-line
Log File C
Redo
On-line
Log File B
Redo
Log File A
LGWR
DBWR
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Update Emp
Set Sal = 40000
Where name=FRED
On-line
Redo
On-line
Log File C
Redo
On-line
Log File B
Redo
Log File A
LGWR
DBWR
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Update Emp
Set Sal = 40000
Where name=FRED
On-line
Redo
On-line
Log File C
Redo
On-line
Log File B
Redo
Log File A
LGWR
DBWR
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Update Emp
Set Sal = 40000
Where name=FRED
On-line
Redo
On-line
Log File C
Redo
On-line
Log File B
Redo
Log File A
DBWR
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Update Emp
Set Sal = 40000
Where name=FRED
LGWR
On-line
Redo
On-line
Log File C
Redo
On-line
Log File B
Redo
Log File A
DBWR
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Update Emp
Set Sal = 40000
Where name=FRED
LGWR
On-line
Redo
On-line
Log File C
Redo
On-line
Log File B
Redo
Log File A
DBWR
Data
Files
Data
(Inc. RB
Files
Segments)
(Inc. RB
Segments)
Update Emp
Set Sal = 40000
Where name=FRED
LGWR
Definitive write
through commit
record
On-line
Redo
On-line
Log File C
Redo
On-line
Log File B
Redo
Log File A
LAB
Simulate Server
Failure after update
But before commit
GO
BACK
Go Back 2 slides
And discuss
consistent gets
Oracle
Tablespace is
similar to
SQL Server
File Group.
Database
Stores objects in
Tablespaces
Made Persistent via
DataFiles
Typical Tablespaces:
SYSTEM
RBS
USERS
TEMP
TOOLS
INDX
DRSYS
OEM_REPOSITORY
32464
265600
89440
10560
1280
2560
2560
3841
E:\ORACLE\ORADATA\INSY\SYSTEM01.DBF
E:\ORACLE\ORADATA\INSY\RBS01.DBF
E:\ORACLE\ORADATA\INSY\USERS01.DBF
E:\ORACLE\ORADATA\INSY\TEMP01.DBF
E:\ORACLE\ORADATA\INSY\TOOLS01.DBF
E:\ORACLE\ORADATA\INSY\INDX01.DBF
E:\ORACLE\ORADATA\INSY\DR01.DBF
E:\ORACLE\ORADATA\INSY\OEM_REPOSITORY.ORA
C:
123
456
789
10 11
12 13
14 15
123
10 11
16 17
456
12 13
18 19
789
14 15
20 21
1 3 2
4 3 5
Drive
Controller
1 3 2
4 3 5
1
0
0
0
0
0
1
1
1
0
0
0
1
0
1
1
1
0
0
1
0
1
0
0
=
=
0
1
1
1
parity
data
0
0
0
1
1
0
0
1
0
1
0
0
1
0
1
1
0
1
0
1
1
0
0
0
0
0
1
1
1
0
0
0
=
=
0
1
1
1
parity
data
0
0
0
1
1
0
0
1
0
1
0
0
1
0
1
1
0
1
0
1
123
10 11
16 17
456
12 13
18 19
789
14 15
20 21
456
12 13
18 19
789
14 15
20 21
Mirror container
123
10 11
16 17
Mirror Set
Mirror Set
123
10 11
16 17
456
12 13
18 19
789
14 15
20 21
123
10 11
16 17
456
12 13
18 19
789
14 15
20 21
c1
Log 1
Ndx 3
Log 2
c2
Data 1, Cntrl 1
Ndx 4
c3
Data 2, Cntrl 2
Log 3
Intf 1
c4
Log 4
Ndx 1
Data 3, Cntrl 3
Log 5
c5
RAID 1 (Log 1)
Controller 1
(c1) Details:
Ndx 2
Data 4, Cntrl 4
RAID 0 + 1 (Ndx 3)
c6
Log 6
Intf 2
Archived Logs
Redo
Log Files
Arch
Log Files
Raid 1
Raid 1
LAB
Directly Examine:
dba_tables
dba_tablespaces
V$datafile
Or indirectly:
@\\neelix\oracle\scripts\admin\datafiles
@\\neelix\oracle\scripts\admin\usertabs
Look at Same using DBA studio
Create a new tablespace
And related datafile(s).