Introduction to Oracle RDBMS - Hawkeye Technology to Oracle RDBMS.pdf · Introduction to Oracle...

24
Introduction to Oracle RDBMS Presented by Ashok Kapur Hawkeye Technology, Inc.

Transcript of Introduction to Oracle RDBMS - Hawkeye Technology to Oracle RDBMS.pdf · Introduction to Oracle...

Introduction to Oracle RDBMS

Presented byAshok Kapur

Hawkeye Technology, Inc.

What’s a Relational Database?Data is represented as Entities and RelationshipsEntities

AttributesRelationships

One-to-OneOne-to-ManyMany-to-many

Logical Design

Logical Design Example

dept_noname

Departnemtemp_nonameaddresssoc_sec_no (AK)hire_dtsalaryhourly_ratedept_no (FK) (IE)

Employee

proj_no (FK)emp_no (FK)

emp_projectproj_noname (AK)

Project

dept_emp

proj_projemp

emp_emporoj

Physical Design

Database ObjectsTables

Rows and ColumnsConstraints

PK: Primary KeysUK: Unique Keys/Alternate KeysFK: Foreign KeysCK: check Constraints

Triggers Auto execution of code based on Table action (Insert, Update, Delete)

Database Objects (contd.)Indexes

UniqueNon-unique

ViewsLogical Views of data

Object TablesObject TypeStored Procedures/Functions

Server side code

Database Object PlacementTablespaces

SystemRollbackTemporaryApplication dataRedo Logs

Data FilesPhysical placement of tablespaces

Object Creation and Data Manipulation

Data ManipulationDDL – Data Definition Language

CREATE Table/Index/Procedure/Function/TriggerALTER Table/Index

DML – Data Manipulation LanguageINSERT,UPDATE,DELETESELECT

SELECT <select list>FROM <table list>WHERE <filters>ORDER BY <sort list>

Transaction ControlRollback Segments

Logs uncommitted changes, in case they need to be undone

Redo LogsLogs data block changes, in case of database recovery

CommitRollback

Database Access/SecuritySystem Privileges

Create session, create table, alter table, select any table, …

Object PrivilegesSelect, Insert, Update, Delete, Alter, …

Can group privs into rolesConnect, resource, DBA, …

Highest access level: internal or sysLowest access level: no privs

Oracle Configuration

Physical ConfigurationEnv variables:

ORACLE_BASEORACLE_HOMEORACLE_SIDPATH: $ORACLE_HOME/binLD_LIBRARY_PATH: $ORACLE_HOME/lib

Initialization parameters$ORACLE_HOME/dbs

Physical ConfigurationAdmin directory structure

$ORACLE_BASE/admin/<sid>/create, pfile, bdump, cdump, udumpalert_<sid>.log

/u*/oradata/<sid>/data files: <tablespace name>xx.dbfcontrol files: *.ctlredo logs: *.log

archive logs: arch*.log

Client/Server Communication

Client/Server Communication

Server:Listener.oraListener process

Client:Sqlnet.oraTnsnames.ora

Oracle Names

Data Transfer

Request

Sql*Net

TransportLayer

(TCP/IP)

Request

Sql*Net

TransportLayer

(TCP/IP)

CLIENT SERVER

Oracle Memory Structures

Memory Use

Shared MemoryData cacheSql stmt CacheData Dictionary Cache

Private MemoryHeapSort Area

Oracle Processes

Background ProcessesPmon (process monitor)Smon (system monitor)Dbwr (database writer)Ckpt (checkpoint)Lgwr (log writer)Reco (recovery)Pxx (parallel query)Snp (snapshot/job)Arch (archiver)

Other Processes

ListenerListens for connections and spawns server processes

Server ProcessesReceive client requests, process requests and serve resultsOne per connection (unless MTS)

Questions?