Sunteți pe pagina 1din 39

Overview

Oracle 10G

LEVEL LEARNER

Icon Used

Hands on Exercise

Coding
Standards

Referenc
e

Lend A
Hand

Overview

Question
s

Points To
Ponder

Summar
y

Test Your
Understanding

Objective

Check Your
Understandi

Overview

The session provides insight towards


Overview,

Physical

Database

Structures,

and

Logical

Application

Architecture, Database Security and


Utilities of Oracle.

Objective
After completing this session, participants
will be able to:
Overview about Oracle.
Oracle's Physical and Logical Database
Structures.
Oracle Application Architecture.
How Oracle Works?
Oracle Memory Architecture
Oracle Process Architecture
Oracle Database Security
Overview of PL/SQL
4

Oracle Database Overview


Oracle is an Relational Database Management System developed
by Oracle Corporation.
The Oracle Database is commonly referred to as Oracle
RDBMS .
Oracle was the first database product to run on a variety of
platforms from micro to mainframe.
An Oracle database are made up of files namely data and
system files.
A single Oracle Server installation can have one or more
database.

Oracle Database and Oracle Instance


Every running database is associated with its own Oracle
instance.

Database

Oracle database is associated


with an oracle instance

Oracle Instance

When the database is started Oracle allocates a memory area


called SGA (System Global Area) and starts many oracle
process to manage the database. The combination of
Oracle Process and SGA is called Oracle Instance
6

Understand Oracle Instance with an


Example
Assume a administrator installs three databases in a database server (CHN1234) for
three applications.

Banking application - Banking


Retail application - Retail
Media application - Media

Database Server CHN1234

Banking
Database

Retail
Database

Media
Database

Oracle Instance

Oracle Instance

Oracle Instance

When each database is


started an oracle instance
will be started and
associated to the respective
databases.

So each database will have its own instance


created.

Oracle database structures

Oracle Database structure has two classifications,


Oracle Database
Structure

Physical Database
Structure
Oracle database physically maintains
data in one or more physical files
grouped under physical data structure.

Logical Database
Structure
Oracle logically divides the database
into smaller units to manage, store,
and retrieve data efficiently.

Logical Data Structure


The logical data structure includes the following,

Physical Data Structure


The physical data structure includes the following
files,

Oracle uses these files for physically storing the


10
database data.

Accessing the Database


The data from the Oracle Database can be accessed, modified and removed
by using SQL (Structured Query Language) with the help of several tools.
Some of the tools which are commonly used are
1. Oracle SQL*Plus and iSQL*Plus
2. Third-party tools.
The SQL executed
in
The database
server.

The SQL will be sent over TCP/IP.

The data retrieved is returned to the


client.
The SQL developed
in client machine

11

Database

Oracle SQL*Plus and iSQL*Plus


SQL*Plus :

SQL * Plus is a tool for accessing, updating and removing data


from Oracle Database.

SQL * Plus is a command line tool which are used for executing SQL
queries.

iSQL*Plus:

iSQL*Plus is a browser-based interface for accessing, updating and


removing data from Oracle Database.

iSQL*Plus enables you to use a web browser to connect to Oracle


Database and perform the same actions as the command line
SQL*Plus .

12

SQL * Plus Tool screen shot

SQL * Plus Login Screen

SQL * Plus Editor screen executing SQLs

13

Oracle iSQL*Plus Tool Screen Shot

Accessing Oracle Database through iSQL*PLUS tool

14

What is inside a Oracle Instance?


Oracle Instance internally has two major components for managing
the database,
Memory Structure
Process Structure
Memory structure refers to how the memory of the oracle database
is organized to ensure the management of database.
Process structure refers to the processes running inside oracle
memory for managing the functioning of database.

15

Inside an Oracle Instance


Oracle Instance
Server
Process 1

SGA

Buffer
Cache

Shared
Pool
Java
Pool

Server
Process 2

16

Backgroun
d Process

PGA

PGA

PGA

Redo Log
Buffer
Large
Pool

PMON

PGA

Oracle Memory structure


Oracle Memory Structure uses:
Oracle creates and uses memory structures to
complete several jobs.
Memory stores program code being run and data
shared among users.

17

System Global Area

The System Global Area (SGA) is a shared memory region that


contains data and control information for one Oracle instance.
Oracle allocates the SGA when an instance starts and
deallocates it when the instance shuts down.
Each instance has its own SGA.
All users currently connected to an Oracle server share the
data in the SGA. So this is also referred as Shared Global Area.
The SGAs purpose is to speed up query performance and to
enable a high amount of concurrent database activity.

18

System Global Area


Shared Global Area has several memory structures ,

Buffer
Cache

SGA

Shared
Pool

Redo Log
Buffer

The Database buffer


cache caches the
database data.

19

The redo log buffer


stores redo entries,
alog of changes made
to the database.

Used to store most


recently executed
SQL/PLSQL
Statements and data
Definitions, like table,
views etc.

Program Global Area


The PGA is the area in the memory that contains the data and control
information for one server process.
Each server process will have its own PGA.
A server process is started when a user logs into the database to
access it.
A server process is tagged to one or more user process based on
configuration.
PGA is allocated when a server process is created and deallocated
when the server process is terminated.
PGA is not sharable and used by only one server process.
The PGA is used to process SQL statements fired by users and to hold
logon and other session information.
20

PGA can be dynamically resized.

Oracle Process architecture

A process is a "thread of control" or a mechanism in an operating system


that can run a series of tasks. A process normally has its own private
memory area in which it runs.
Example: Tim a user connect to database to executed a query and retrieve
data. A process will be created to handle the user request of connecting to
database and executing the query. Here, connection establishment and
query execution are referred to as tasks of the process.
Process Created and runs
in database server

Connects to database
Execute SQL

Tim
21

Databa
se

The process performs the


tasks of Tim namely,
Connect to database.
Execute SQL.

Process Types

Oracle processes are invoked by user


processes to perform functions on
behalf of the invoking process.

22

Oracle creates a user process to run


the user's application
Example: User process created for a
Java program which tries to connect
to database (or) a user tries to
connect to the database using SQL*
plus.

Process Illustration
Assume Ron, Tim and Jack have connected to database and queries the
database.
Oracle Instance
Tim User
Process

Ron User
Process

Jack User
Process

User Process created for


each user login.

SGA
Server
Proces
s

Recover
er

Proces
s
Monito
r

Syste
m
Monito
r

Databa
se
Writer

Oracle Processes
23

Log
Writer

Archiv
er

What is Database Security ?

Oracle database security refers to the features that control how


a database is accessed and used.
Prevent unauthorized database access
Prevent unauthorized access to schema objects
Audit user actions

Types Of Database Security.

This is a mechanisms that controls the


access and use of the database at the
system level.

This is a mechanisms that controls the


access and use of the database at the
schema object level.

Example:

Example:

Using username/password for DB login.


Size of disk space allocated to a user's
schema objects.

By giving access for users to tables and


other schema objects.
Auditing users access to schema
objects.
Encrypting data to prevent unauthorized
access.

Security Mechanisms
Oracle database provides discretionary access control, which
is a means of restricting access to information based on
privileges.
Appropriate privilege should be assigned to users to access
schema objects.
Example: Tom can be given privilege to access Employee table
but Ron cant access it.
Privileged users can grant other users privileges at their
discretion. For this reason it is referred as discretionary.
Example: Tom can give privilege access for Ron to access
Employee table.
26

Security Mechanisms
Oracle manages security using the following mechanisms
Database Users & Schemas.
Privileges
Roles
Storage settings & Quotas
Profiles& Resource Limits.
User authentication
User Authorization
Auditing

27

What are Oracle Database Utilities?

Oracle database utilities are tools supplied as part of the


Oracle Software and need not have to be purchased or
downloaded separately.
They are used for,
Data access and maintenance.
Data Loading.
Database administration

28

Oracle Database Utilities

Used for high-speed


movement of data and
dictionary data from one
database to another.

29

Used for querying redo


log files through a SQL
interface.

Used for loading


database with data from
flat files. The description
of the data file will be
stored in a control file.

Introduction to PL/SQL
What is PL/SQL?
PL stands for Procedural Language and PL/SQL is the
procedural extension to SQL with design features of any
programming language.
Few details about PL/SQL:
PL/SQL allows to mix SQL statements with Procedural
Statements like IF statement, Looping structures etc.
PL/SQL allows DDL,DML,DQL,TCL and DCL Statements of
SQL to be part of the block structured unit of codes making
PL/SQL a powerful transaction DDL
processing language.
Can Contain
DML
PL/SQL
DQL
Loops, IF etc.

30

Introduction to PL/SQL (Cont)


PL/SQL extends SQL by adding constructs found in other
procedural languages like
1. Defining variables and types
2. Using control structures (IF-THEN-ELSE)
3. Defining procedures and functions
4. Defining Object types

31

Advantages of PL/SQL
These are the advantages of PL/SQL,
1. Reusable - Block Structures: PL/SQL consists of blocks of
code. Each block contains SQL statements which forms a
unit of a task or a logical module. PL/SQL Blocks can be
stored in the database and reused.
2. Easy to develop - Procedural Language Capability:
PL/SQL uses procedural language constructs such as
conditional statements (if else statements) and loops like
(FOR loops).
3. Better Performance: PL SQL engine processes multiple
SQL statements simultaneously as a single block within the
database engine, thereby reducing network traffic. Also, the
set of instructions are stored as database objects in a
compiled form, thus improving performance.
4.
32

Easy Error Handling: Easy to handle exceptions, PL/SQL

How PL/SQL runs?


Assume there is a procedure generate_Invoice in oracle database. Lets look at
the illustration how it executes?
Oracle Server
1. Client
Executes the
procedure

Database
Clients

33

SGA
generate_Invoice
Begin

END

3. PL/SQL engine executes the


procedural statement.

2. PL/SQL
engine loads
procedure in
SGA.

4. SQL
executor
executes SQL
statement in
the
procedure.

PL/SQL Engine
Procedural
statement
Executor`
SQL

PL/SQL
Executor

Test Your Understanding


Kindly provide answers to the following
questions about Oracle 10G
Which cache is used storing temporary updated data before
being persisted?
How many PGA will be associated to a Server process?
Which cache is used for recovering data in case of any
database crash?
Which Memory is shared across multiple users?
Can a server process access the PGA of another server
process?

34

Questions

35

Summary
Summarizing the topic in the below following:
Overview about Oracle.
Oracle's Physical and Logical Database
Structures.
Oracle Application Architecture.
How Oracle Works?
Oracle Memory Architecture
Oracle Process Architecture
Oracle Database Security
Overview of PL/SQL

36

Source

http://myacademy/catcms/course/view.php?id=548

Disclaimer: Parts of the content of this course is based on the materials available from the
Web sites and books listed above. The materials that can be accessed from linked sites are
not maintained by Cognizant Academy and we are not responsible for the contents thereof.
All trademarks, service marks, and trade names in this course are the marks of the
respective owner(s).
37

Oracle 10G Overview


You have successfully completed Oracle 10G Overview

Change Log

39

Version
Number

Changes made

V1.0

Initial Version

V1.1

Slide No.

Changed By

Effective
Date

Changes
Effected

S-ar putea să vă placă și