Oracle Architecture

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 78

Oracle - OS (LC)

Oracle Architecture
Oracle Day 1
Objectives

 To Recall RDBMS concepts


 To introduce ORACLE and its products
 To introduce Oracle Client/Server Architecture
 To explain Oracle Physical structure-Data Files, Control Files,
Redo Files
 To explain Oracle Logical Structure- Tablespaces,
Segments, Extents, Blocks
 To introduce Schema objects-Tables, Sequences,
Synonyms, Views, Indexes and Clusters
 To explain Oracle Memory Structures and Background
Processes, Data Dictionary

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 3 Version No.2.0
RDBMS - Overview

• Why RDBMS?
• Keys
• SQL
• Embedded SQL
• Transaction processing

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 4 Version No.2.0
What is Oracle?
Oracle is a Relational Database Management System.

• It is a management system which uses the Relational Data


Model.
• In the Relational Data Model, data is seen by the users in
form of tables.

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 5 Version No.2.0
Oracle Products

Oracle broadly sells products in two categories

• Database Servers
• Application Development Tools

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 6 Version No.2.0
Database Servers
• Oracle 10g Database
• Oracle 9i Database
• Oracle 8i Database

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 7 Version No.2.0
Application Development Tools

• Oracle Developer (Includes Forms, Reports, Graphics etc.)


• Oracle Designer
• Oracle Discoverer
• PL/SQL (Technology)

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 8 Version No.2.0
Oracle Database Server
Oracle Database server:
– Is a database management system
that provides an open,
comprehensive, integrated approach
to information management Oracle Server
– Consists of
• An Oracle Instance and
• An Oracle Database

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 9 Version No.2.0
Oracle Database Server Architecture

Instance
User
process Shared Pool SGA

Library Redo Log


Database
Cache Buffer
Buffer Cache
Server Data Dictionary
process Cache Large Pool
PGA
PMON SMON DBWR LGWR CKPT Others

Archived
Datafiles Control files Redo Log
Parameter files Log files
file

Password
file
Database

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 10 Version No.2.0
Oracle Database

Oracle Database:
– Is a collection of data that is treated as a unit
– Consists of three file types

Oracle Database

Datafiles Control
files Redo
Log files

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 11 Version No.2.0
Oracle Instance

Oracle Instance:

• Is a means to access an Oracle database


• Always open one and only one database
• Consists of memory structures and background processes

Instance
Shared Pool SGA

Library Redo Log


Database
Cache Buffer Memory structures
Buffer Cache
Data Dictionary
Cache Large Pool

PMON SMON DBWR LGWR CKPT Others Background


Processes

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 12 Version No.2.0
Establishing a Connection
and Creating a Session
Connecting to an Oracle Instance:
– Establishing a user connection
– Creating a session

Server
Connection process
established Session created
User Oracle Server
process

Database user

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 13 Version No.2.0
Physical Structure
The physical structure includes three types of files:
• Control files, Data files, Redo log files.

Other key files:


• Parameter file
• Password file
• Archived redo log file

Oracle Database

Datafiles Control
Parameter files Redo Archived
file Log files Log files
Password
file

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 14 Version No.2.0
Memory Structure

• Oracle’s memory structure consists of two memory areas known as:


– System Global Area (SGA): Allocated at instance startup, and is a
fundamental component of an Oracle Instance
– Program Global Area (PGA): Allocated when the server process is
started

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 15 Version No.2.0
System Global Area

The SGA consists of several memory structures:


• Shared Pool
• Database Buffer Cache
• Redo Log Buffer
• Other structures (for example, lock and latch management, statistical data)
There are additional memory structures that can be configured within
the SGA:
• Large Pool

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 16 Version No.2.0
Shared Pool

– Used to store:
• Most recently executed SQL statements
• Most recently used data definitions
– It consists of two key performance-related memory structures:
• Library Cache
• Data Dictionary Cache
– Sized by the parameter SHARED_POOL_SIZE

Shared Pool
Library
Cache
Data
Dictionary
Cache

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 17 Version No.2.0
Library Cache

– Stores information about the most recently used SQL and PL/SQL
statements
– Enables the sharing of commonly used statements
– Is managed by a least recently used (LRU) algorithm
– Consists of two structures:
• Shared SQL area
• Shared PL/SQL area
– Size determined by the Shared Pool sizing

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 18 Version No.2.0
Data Dictionary Cache

– A collection of the most recently used definitions in the


database
– Includes information about database files, tables, indexes,
columns, users, privileges, and other database objects
– During the parse phase, the server process looks at the data
dictionary for information to resolve object names and validate
access
– Caching data dictionary information into memory improves
response time on queries and DML
– Size determined by the Shared Pool sizing

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 19 Version No.2.0
Database Buffer Cache

– Stores copies of data blocks that have been retrieved from the
datafiles
– Enables great performance gains when you obtain and update data
– Managed through the LRU algorithm
– DB_BLOCK_SIZE determines the block size

Database Buffer
Cache

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 20 Version No.2.0
Redo Log Buffer
– Records all changes made to the database data blocks
– Primary purpose is recovery
– Changes recorded within are called redo entries
– Redo entries contain information to reconstruct or redo changes
– Size defined by LOG_BUFFER

Redo Log
Buffer

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 21 Version No.2.0
Large Pool

– An optional area of memory in the SGA


– Relieves the burden placed on the Shared Pool
– Used for:
• Session memory (UGA) for the Shared Server
• I/O server processes
• Backup and restore operations or RMAN
– Does not use an LRU list
– Sized by LARGE_POOL_SIZE

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 22 Version No.2.0
Program Global Area

– Memory reserved for each user process


connecting to an Oracle database
– Allocated when a process is created
– Deallocated when the process is terminated PGA
– Used by only one process Server
process

User
process

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 23 Version No.2.0
Process Structure

Oracle takes advantage of various types of processes:


– User process: Started at the time a database user requests connection
to the Oracle server
– Server process: Connects to the Oracle Instance and is started when a
user establishes a session
– Background processes: Started when an Oracle Instance is started

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 24 Version No.2.0
User Process
– A program that requests interaction with the Oracle server
– Must first establish a connection
– Does not interact directly with the Oracle server

Server
process
User
process
Connection
established

Database user

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 25 Version No.2.0
Server Process
– A program that directly interacts with the Oracle server
– Fulfills calls generated and returns results
– Can be Dedicated or Shared Server

Server
Connection process
established Session created
User Oracle server
process

Database user

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 26 Version No.2.0
Background Processes

• Maintains and enforces relationships between physical and memory


structures
– Mandatory background processes:
• DBWR PMON CKPT
• LGWR SMON
– Optional background processes:
• ARCn RECO

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 27 Version No.2.0
Database Writer (DBWn)

Instance • DBWn writes when:


SGA – Checkpoint occurs
Database – Dirty buffers reach
Buffer threshold
Cache
– There are no free buffers
– Timeout occurs
DBWn – Tablespace OFFLINE
– Tablespace READ ONLY
– Table DROP or
TRUNCATE
Redo
Datafiles Control Log
files files

Database

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 28 Version No.2.0
Log Writer (LGWR)

Instance • LGWR writes:


SGA – At commit
Redo Log – When one-third full
Buffer – When there is 1 MB of
redo
– Every three seconds
DBWn LGWR – Before DBWn writes

Redo
Datafiles Control Log
files files

Database

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 29 Version No.2.0
System Monitor (SMON)

Instance • Responsibilities:
SGA – Instance recovery
• Rolls forward changes
in redo logs
• Opens database for
user access
SMON
• Rolls back
uncommitted
transactions
Redo – Coalesces free space
Datafiles Control Log
files files – Deallocates temporary
segments

Database

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 30 Version No.2.0
Process Monitor (PMON)

Instance • Cleans up after failed


SGA processes by:
– Rolling back the
transaction
– Releasing locks
– Releasing other resources
PMON
– Restarting dead
dispatchers

PGA area

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 31 Version No.2.0
Checkpoint (CKPT)

Instance • Responsible for:


SGA – Signaling DBWn at
checkpoints
– Updating datafile headers
with checkpoint
information
– Updating control files with
DBWn LGWR CKPT
checkpoint information

Redo
Datafiles Control Log
files files

Database

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 32 Version No.2.0
Archiver (ARCn)
– Optional background process
– Automatically archives online redo logs when ARCHIVELOG mode is set
– Preserves the record of all changes made to the database

Redo ARCn
Datafiles Control Log
files files Archived Redo
Log files

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 33 Version No.2.0
Control File

– A small binary file


– Defines current state of physical database
– Maintains integrity of database
– Required:
• At MOUNT state during database startup
• To operate the database
– Linked to a single database
– Loss may require recovery
– Sized initially by
CREATE DATABASE
Database

Control
files

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 34 Version No.2.0
Control File Contents

• A control file contains the following entries:


– Database name and identifier
– Time stamp of database creation
– Tablespace names
– Names and locations of datafiles and redo log files
– Current redo log file sequence number
– Checkpoint information
– Begin and end of undo segments
– Redo log archive information
– Backup information

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 35 Version No.2.0
Redo Log Files

Redo log files have the following characteristics:


– Record all changes made to data
– Provide a recovery mechanism
– Can be organized into groups
– At least two groups required

Redo
Log
files

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 36 Version No.2.0
Structure of Redo Log Files

Group 1 Group 2 Group 3


Disk 1

Member Member Member

Member Member Member Disk 2

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 37 Version No.2.0
How Redo Log Files Work

– Redo log files are used in a cyclic fashion.


– When a redo log file is full, LGWR will move to the next log group.
• Called a log switch
• Checkpoint operation also occurs
• Information written to the control file

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 38 Version No.2.0
Archived Redo Log Files

– Filled online redo log files can be archived.


– There are two advantages in running the database in ARCHIVELOG
mode and archiving redo log files:
• Recovery: A database backup together with online and archived
redo log files can guarantee recovery of all committed
transactions.
• Backup: This can be performed while the database is open.
– By default, database is created in NOARCHIVELOG mode.

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 39 Version No.2.0
Archived Redo Log Files

– Accomplished automatically by ARCn


– Accomplished manually through SQL statements
– When successfully archived:
• An entry in the control file is made
• Records: archive log name, log sequence number, and high
and low system change number (SCN)
• Filled redo log file cannot be reused until:
– A checkpoint has taken place
– File has been archived by ARCn
– Can be multiplexed
– Maintained by the DBA

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 40 Version No.2.0
Logical Structure
– Dictates how the physical space of a database is used
– Hierarchy consisting of tablespaces, segments, extents, and blocks

Tablespace

Datafile
Segment Segment

Extent Blocks

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 41 Version No.2.0
Tablespaces and Datafiles

• Oracle stores data logically in tablespaces and physically in datafiles.


– Tablespaces:
• Can belong to only one database at a time
• Consist of one or more datafiles
• Are further divided into logical units of storage
– Datafiles:
• Can belong to only one
tablespace and one database
• Are a repository for schema
object data
Database

Tablespace

Datafiles

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 42 Version No.2.0
Types of Tablespaces

– SYSTEM tablespace
• Created with the database
• Contains the data dictionary
• Contains the SYSTEM undo segment
– Non-SYSTEM tablespace
• Separate segments
• Eases space administration
• Controls amount of space allocated to a user

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 43 Version No.2.0
Creating Tablespaces
• A tablespace is created using the command:
• CREATE TABLESPACE

CREATE TABLESPACE userdata


DATAFILE '/ora/data01.dbf' SIZE 50M
AUTOEXTEND ON NEXT 5M MAXSIZE 200M;

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 44 Version No.2.0
Dropping Tablespaces

– Cannot drop a tablespace if it:


• Is the SYSTEM tablespace
• Has active segments
– INCLUDING CONTENTS drops the segments
– INCLUDING CONTENTS AND DATAFILES deletes datafiles
– CASCADE CONSTRAINTS drops all referential integrity constraints

DROP TABLESPACE userdata


INCLUDING CONTENTS AND DATAFILES;

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 45 Version No.2.0
Obtaining Tablespace Information

• Obtaining tablespace and datafile information can be obtained by


querying the following:
– Tablespaces:
• DBA_TABLESPACES
– Datafile information:
• DBA_DATA_FILES

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 46 Version No.2.0
Types of Segments

– Data Segment
– Index Segment
– Rollback Segment
– Temporary Segment

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 47 Version No.2.0
Rollback Segment

Old image

Table

New image

Rollback segment

Update transaction

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 48 Version No.2.0
Rollback Segments: Purpose

Transaction rollback

Read consistency
Transaction recovery
Rollback segment

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 49 Version No.2.0
Read Consistency

SELECT *
Table FROM table

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 50 Version No.2.0
Types of Rollback Segments

– SYSTEM: Used for objects in the SYSTEM tablespace


– Non-SYSTEM: Used for objects in other tablespaces:

– Private: Acquired by a single instance


– Public: Acquired by any instance
– Deferred: Used when tablespaces are taken offline immediate,
temporary, or for recovery

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 51 Version No.2.0
Extent Allocation and Deallocation

– An extent is a chunk of space used by a segment within a


tablespace.
– An extent is allocated when the segment is:
• Created
• Extended
• Altered
– An extent is deallocated when the segment is:
• Dropped
• Altered
• Truncated

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 52 Version No.2.0
Manually Allocating Extents

ALTER TABLE hr.employees


ALLOCATE EXTENT(SIZE 500K
DATAFILE ‘/DISK3/DATA01.DBF’);

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 53 Version No.2.0
Database Block

– Minimum unit of I/O


– Consists of one or more operating system blocks
– Set at database creation
– DB_BLOCK_SIZE is the block size

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 54 Version No.2.0
Database Block Contents

Header

Free space

Data

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 55 Version No.2.0
Block Space
Utilization Parameters

PCTFREE

PCTUSED

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 56 Version No.2.0
Row Migration and Chaining

Before update After update

Pointer

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 57 Version No.2.0
Database and Instance Startup
• Start database [reads Parameter file before this]
– allocate & create SGA, Background processes
• Mount database
– Associate database with previously started instance
– Close database
– Find and open control file
– Read Redo /data file names from this file and confirm existence
• Open database
– Open online log files and data files
– Automatically perform instance recovery(SMON)
– Acquire one/more rollback segments

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 58 Version No.2.0
Database and Instance Shutdown
• Close database
– Write all buffer data to disk
– Close Online redo files and data files
– Close database
• Dismount database
– Close control files
– Dissociate database from Instance
• Shut down instance
– Remove SGA from memory
– Terminate background processes

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 59 Version No.2.0
Database Schema

• A schema is a named collection Schema Objects


of objects. Tables
• A user is created, and a Triggers
corresponding schema is
Constraints
created.
Indexes
• A user can be associated only
with one schema. Views
• Username and schema are Sequences
often used interchangeably. Stored program units
Synonyms
User-defined data types
Database links

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 60 Version No.2.0
Built-In Database Objects
• Other objects created with the database:
– Data Dictionary
– Performance tables
– PL/SQL packages
– Database event triggers

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 61 Version No.2.0
Data Dictionary

– Central to every Oracle database


– Describes the database and its objects
– Contains read-only tables and views
– Stored in the SYSTEM tablespace
– Owned by the user SYS
– Maintained by the Oracle server
– Accessed with SELECT

Control Redo
Data files Log
files files Database

Data Dictionary
tables

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 62 Version No.2.0
Base Tables and Data Dictionary Views
• The data dictionary contains two parts:
– Base tables
• Stores description of the database
• Created with CREATE DATABASE
– Data dictionary views
• Used to simplify the base table information
• Accessed through public synonyms
• Created with the catalog.sql script

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 63 Version No.2.0
Data Dictionary Contents
The data dictionary provides information about:
– Logical and physical database structures
– Definitions and space allocations of objects
– Integrity constraints
– Users
– Roles
– Privileges
– Auditing

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 64 Version No.2.0
How the Data Dictionary is Used
• Primary uses:
– Oracle server uses it to find information about:
• Users
• Schema objects
• Storage structures
– Oracle server modifies it when a DDL statement is executed.
– Users and DBAs use it as a read-only reference for information about the
database.

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 65 Version No.2.0
Data Dictionary View Categories
– Three sets of static views
– Distinguished by their scope:
 DBA: In all the schemas
 ALL: What the user can access
 USER: In the user’s schema

DBA_xxx All of the objects in the database

ALL_xxx Objects accessible by the current user

USER_xxx Objects owned by the current user

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 66 Version No.2.0
Classification of Indexes

– Logical
• Single column or concatenated
• Unique or nonunique
• Function-based
• Domain
– Physical
• Partitioned or nonpartitioned
• B-tree
– Normal or reverse key
• Bitmap

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 67 Version No.2.0
Comparing B-Tree and
Bitmap Indexes

B-tree Bitmap
•Suitable for high-cardinality •Suitable for low-cardinality
columns columns
•Updates on keys relatively •Updates to key columns very
inexpensive expensive
•Inefficient for queries •Efficient for queries
using OR predicates using OR predicates

Useful for OLTP Useful for data warehousing

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 68 Version No.2.0
Creating Indexes

CREATE INDEX empl_last_name_idx


ON empl(last_name);

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 69 Version No.2.0
Creating Indexes: Guidelines

– Balance query and DML needs


– Place in separate tablespace
– Use uniform extent sizes: Multiples of five blocks or MINIMUM
EXTENT size for tablespace
– Consider NOLOGGING for large indexes
– INITRANS should generally be higher on indexes than on the
corresponding tables.

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 70 Version No.2.0
Dropping Indexes

– Drop and recreate an index before bulk loads.


– Drop indexes that are infrequently needed and build them when
necessary.
– Drop and recreate invalid indexes.

DROP INDEX index1;

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 71 Version No.2.0
Obtaining Index Information

• Information about indexes can be obtained by querying the following


views:
– USER_INDEXES: Provides information on the indexes
– USER_IND_COLUMNS: Provides information on the columns indexed

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 72 Version No.2.0
SEQUENCES
• Generation of Sequence numbers
• Sequence object stored in database
• Example
– CREATE SEQUENCE SEQ_TRIAL INCREMENT BY 1 START
WITH 1
– insert into employees values (seq_trial.nextval, 'Test', 1, 2);
– use sequence.currval for current value of sequence

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 73 Version No.2.0
Database Administrator Users

Users SYS and SYSTEM are created automatically during


database creation and granted the DBA role

• SYS
– Password: change_on_install
– Owner of the database data dictionary
• SYSTEM
– Password: manager
– Owner of additional internal tables and views used by Oracle
tools

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 74 Version No.2.0
Creating Users

CREATE USER swetalina


IDENTIFIED BY mamuni
DEFAULT TABLESPACE usr01
TEMPORARY TABLESPACE temp01
QUOTA 10M ON usr01;

Granting Privileges

GRANT <role-name> TO swetalina;

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 75 Version No.2.0
Dropping a User

– Use the CASCADE clause to drop all objects in the schema if the
schema contains objects.

DROP USER swetalina;

– Users who are currently connected to the Oracle server cannot be


dropped.

DROP USER swetalina CASCADE;

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 76 Version No.2.0
Summary

We have discussed the following:

– Introduced ORACLE products


–  Recalled RDBMS concepts
– Introduced Oracle Client Server Architecture
–  Explained Oracle Physical structure-Data Files, Control Files, Redo
Files.
–  Explained Oracle Logical Structure- Tablespaces, Segments, Extents,
Blocks
–  Introduced Schema objects-Tables, Sequences, Synonyms, Views,
Indexes and Clusters
–  Explained Oracle Memory Structures and Background Processes, Data
Dictionary

Copyright © 2005, Infosys ER/CORP/CRS/DB25/003


Technologies Ltd 77 Version No.2.0
Thank You!
JAGDEEP SINGH RAJAWAT
M.Sc IT, M.C.A.

You might also like