Professional Documents
Culture Documents
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0
Contents
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 2
Oracle Server
• RDBMS
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 3
Data Modeling
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 4
Data Modeling types
• Logical data model includes all required entities, attributes, key groups, and relationships that
represent business information and define business rules.
• The transformations from logical model to physical model include imposing database rules,
implementation of referential integrity, super types and sub types etc.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 5
Entity Relationship Model
• the ER model is a conceptual data model that views the real world as entities and
relationships. A basic component of the model is the Entity-Relationship diagram
which is used to visually represents data objects.
– It maps well to the relational model. The constructs used in the ER model can
easily be transformed into relational tables.
– It is simple and easy to understand with a minimum of training. Therefore, the
model can be used by the database designer to communicate the design to the end
user.
– In addition, the model can be used as a design plan by the database developer to
implement a data model in a specific database management software.
• Entities are the principal data object about which information is to be collected.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 6
Normalization
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 7
Normalization Types
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 8
Overview of Database Structure
• Physical Structure
• Logical Structure
Physical Structure
– Operating System files that constitute the database.
– Files are physical storage of the database information.
– 3 types of files:
Data files
Redo log files
Control files
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 9
Overview of Database Structure
Logical Structure
Dictate how the physical space of the database is used.
Comprises:
– Table spaces : Logical area of storage
– Schema Objects: Logical structures that directly refer to the dB
data. Schema objects and their relationships
form the relational design of the database.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 10
Oracle Instance
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 11
Logical Database Structure - Tablespaces
Database
System Tablespace USERS Tablespace
Data1.ORA
(1MB)
Data2.ORA Data3.ORA
(1MB) (4MB)
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 12
Logical Database Structure - Schemas
& Schema Objects
Schema Objects
– Tables : Basic unit of data storage. Data is stored in the form of
rows and columns.
– Views : Custom tailored presentation of data in one or more
tables.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 13
Logical Database Structure -
Schemas & Schema Objects
Schema Objects
– Sequences: Generate a serial list of unique numbers for
numeric columns of a database’s table.
– Program Unit: Stored procedures, functions and packages.
– Indexes: Provides a faster access path to a table data.
– Clusters: Groups of one or more tables physically stored
together because they share common columns, thus improving
the disk access time.
– Database links: Describes a path from one database to
another. Used in distributed databases.
– Data Blocks: A data block corresponds to a specific number of
bytes of physical database space on the disk.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 14
Logical Database Structure - Schemas
& Schema Objects
Schema Objects
– Extents: A specific number of contiguous data blocks, obtained
in a single allocation, used to store a specific type of
information
– Segments: A set of extents allocated for a certain logical
structure. 4 types are:
Data Segment: Each table has a data segment
Index Segment: Each index has a index segment
Rollback Segment: Stores ‘undo’ information
Temporary Segment: Created when a SQL statement needs
a temporary work area.
Oracle allocates segments dynamically when existing extents
of a segment become full. This dynamic allocation causes
non-contiguous extents.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 15
Physical Database Structure
Data files
– One or more physical files in the disk
– Contain database data
– Can be associated with only one database
– Have certain characteristics that allow them to automatically
extend when the database runs out of space
– One or more data files form a tablespace
The data in a data file is read during normal database operation and
stored in the memory cache of Oracle.
Modified / new data is pooled in memory and written to appropriate
data files all at once.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 16
Physical Database Structure
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 17
Physical Database Structure
Control Files
– One physical file in the disk
– Contains entries that specify the physical structure of the
database viz. Database name, names and locations of
data files and redo log files, time stamp of database
creation etc.
– Can be associated with only one database
When an instance of an Oracle database is started, the control
file is used to identify the database and the redo log files that
have to be opened. If the physical makeup of the database is
altered, this control file is automatically modified by Oracle to
reflect the change.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 18
Data Dictionary
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 19
Oracle Server Architecture
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 20
Oracle Server Architecture
Figure 1
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 21
Memory Structures
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 22
Memory Structures -SGA
• Shared memory region that contains data and control information for
one Oracle instance.
• Oracle allocates the SGA when an instance starts and de-allocates it
when an instance shuts down.
• Optimal performance requires that the SGA be as large as possible, to
store as much data as possible, thus minimizing disk I/O.
• Types of structures (fixed sizes) within the SGA:
– Database Buffer Cache
– Redo log Buffer
– Shared Pool
– Cursors
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 23
Memory Structures -SGA
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 24
Memory Structures -SGA
Shared Pool
– Stores shared memory constructs like shared SQL areas
– Shared SQL area is used to process every unique SQL
statement submitted to the database and contains information
such as the execution plan for the SQL statement
These are used by multiple applications that issue the same
statement, thus leaving more shared memory for other users
Cursors
– Handle for the memory associated with a specific statement
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 25
Memory Structures - PGA
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 26
Processes
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 27
Processes - User
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 28
Processes - Oracle
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 29
Processes - Oracle Server
Server Processes
– Created by Oracle to handle requests from connected user
processes
– Communicates with user process and interacts with Oracle to
carry out requests of the user.
– The number of server processes viz.. a viz. the user processes
can be configured based on a dedicated server / multi-
threaded server configuration
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 30
Processes - Oracle Background
Background Processes
– Oracle creates a set of background processes for each
instance
– Background processes consolidate common functions that are
handled by Oracle programs
– Perform asynchronous I/O and monitor other Oracle processes
– Each Oracle instance may use several background processes
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 31
Processes - Oracle Background
Checkpoint (CKPT)
Responsible for signalling DBWR to do its job at specific times, called
the check point. Also updates all data files and control files to indicate
the most recent check point. CKPT is optional. If not present LGWR
will assume its role.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 32
Processes - Oracle Background
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 33
Processes - Oracle Background
Archiver (ARCH)
Copies the online redo log files to archive storage when they
get full.
Recoverer (RECO)
Resolves the distributed transactions that are pending due to
n/w or system failure. Applicable in a distributed database
scenario.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 34
Processes - Oracle Background
Dispatcher (Dnnn)
Routes requests from connected user processes to shared
server processes. Also returns response back to user
processes. Applicable in a multi-threaded server configuration.
Atleast one dispatcher process is created for every
communication protocol in use (D000,….., Dnnn)
Lock (LCKn)
Used to lock inter-instances in a Oracle Parallel Server
scenario.
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 35
Program Interface
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 36
Oracle Architecture
Session 2
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0
Contents
• Data Access
• Data Concurrency & Consistency
• Database Security
• Database Backup & Recovery
• Distributed Processing
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 38
Data Access
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 39
Data Access
• SQL
– Simple yet powerful database access language
– Compliant with ANSI/ISO standard SQL data la
• Transactions
– A logical unit of work that comprises one or more SQL
statements, executed by a single user.
Transactions are committed - making permanent changes to
the database
Transactions are rolled back - retracting any of the changes
made by SQL statements
Save points - Large transactions are divided into smaller
parts using intermediate markers
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 40
Data Access
• Transactions
– Guarantee consistent changes to data when SQL statements within a
transaction are grouped logically.
– Data in the referenced tables are in a consistent state before and after
the transaction
• PL/SQL
– Procedural language extension to SQL - Combines ease & flexibility of
SQL with the procedural functionality of a structured programming
language
– Defined and stored in compiled form, centrally in a database
Stored Procedures Functions
Packages Database triggers
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 41
Data Access
• Data Integrity
– Guarantees that data adheres to certain business rules as
determined by the application developer or the database
administrator
– Achieved using
Integrity Constraints
NOT NULL
UNIQUE
KEYS
Database Triggers
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 42
Data Concurrency & Consistency
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 43
Data Concurrency & Consistency
• Concurrency
– Simultaneous access of the same data in the database, by
many users causing data integrity issues.
– Concurrency is controlled using
Read Consistency
Rollback segments
Read-only transactions
Locking
Automatic Locking
Manual Locking
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 44
Database Security
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 45
Database Security
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 46
Database Security
Security Mechanisms
– Database users & Schemas
actions
tablespace quotas
system resource limits
– privileges
system privileges
object privileges
granting privileges
– storage settings and quotas
Default tablespace
Temporary tablespace
Tablespace quotas
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 47
Database Security
Security Mechanisms
– roles
– profiles & resource limits
number of concurrent sessions
CPU processing time
amount of logical I/O
amount of idle time for a user session
amount of connect time for a user session
– auditing
statement
privilege
object
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 48
Database Backup & Recovery
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 49
Database Backup & Recovery
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 50
Database Backup & Recovery
Recovery Steps
– Rolling Forward
– Rolling Back
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 51
Distributed Processing
www.perotsystems.com Proprietary and confidential. © 2005 Perot Systems. All rights reserved. All registered trademarks are the property of their respective owners. V1.0 52