Introduction to Oracle
description
Transcript of Introduction to Oracle
![Page 1: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/1.jpg)
![Page 2: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/2.jpg)
Introduction to Oracle 2
Introduction to OracleAnton Topurov IT-DB
23 April 2013
![Page 3: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/3.jpg)
Introduction to Oracle 3
What is a database?
23 April 2013
![Page 4: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/4.jpg)
Introduction to Oracle 4
Organized Collection of Data
23 April 2013
![Page 5: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/5.jpg)
Introduction to Oracle 5
IT manager
23 April 2013
![Page 6: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/6.jpg)
Introduction to Oracle 6
App Developer
23 April 2013
![Page 7: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/7.jpg)
Introduction to Oracle 7
Database Administrator
23 April 2013
![Page 8: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/8.jpg)
Introduction to Oracle 8
System Administrator
23 April 2013
![Page 9: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/9.jpg)
Introduction to Oracle 9
IT manager
23 April 2013
![Page 10: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/10.jpg)
Introduction to Oracle 10
What is
23 April 2013
Database?
![Page 11: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/11.jpg)
Introduction to Oracle 1123 April 2013
![Page 12: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/12.jpg)
Introduction to Oracle 12
![Page 13: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/13.jpg)
Introduction to Oracle 13
Ready to find out more?
23 April 2013
![Page 14: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/14.jpg)
Introduction to Oracle 14
Oracle Database Internals
23 April 2013
![Page 15: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/15.jpg)
Introduction to Oracle 1523 April 2013
Oracle Database
Oracle Instance
Real Application Clusters (RAC)
SQL statements processing
Working with Oracle Database
![Page 16: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/16.jpg)
Introduction to Oracle 1623 April 201323 April 2013 Introduction to Oracle 16
![Page 17: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/17.jpg)
Introduction to Oracle 17
Oracle Database Server
23 April 2013
![Page 18: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/18.jpg)
Introduction to Oracle 18
Simplified view
23 April 2013
System Global Area (SGA)
Background Processes
Data Files Control Files Online Redo Logs
Server Processes
PGA
![Page 19: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/19.jpg)
Introduction to Oracle 19
Database Physical Layout
23 April 2013
Data Files Control Files Online Redo Logs
![Page 20: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/20.jpg)
Introduction to Oracle 20
Physical to Logical
23 April 2013
Data Files
![Page 21: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/21.jpg)
Introduction to Oracle 21
Logical Layout
23 April 2013
Block• The smallest
logical unitof data storage
Extent• Continios set of
blocks
Segment• Type (table, index,..)
• Within a tablespace
Tablespace• Maps to one or more
datafiles
![Page 22: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/22.jpg)
Introduction to Oracle 2223 April 2013
Oracle Database
Oracle Instance
Real Application Clusters (RAC)
SQL statements processing
Working with Oracle Database
![Page 23: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/23.jpg)
Introduction to Oracle 23
Oracle Instance
23 April 2013
System Global Area (SGA)
Background Processes
Data Files Control Files Online Redo Logs
![Page 24: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/24.jpg)
Introduction to Oracle 24
SGA contents
23 April 2013
Buffer cache• holds copies of data blocks
• server processes manipulate data from buffer cache (not directly from data files)
• managed using LRU algorithm (Least Recently Used)
Shared pool• shared memory constructs
like shared SQL areas• most recently executed SQL
statements
• most recently used data definitions
![Page 25: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/25.jpg)
Introduction to Oracle 25
Backup
Background Processes
23 April 2013
System Monitor
Process Monitor
Diagnosability Process
Data Files Control Files Online Redo Logs
Database Writer
Archived Redo Logs
Redo Log ArchiverRedo Log WriterCheckpointer
Buffer Cache System Global Area (SGA)Redo Log
Buffer
![Page 26: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/26.jpg)
Introduction to Oracle 2623 April 2013
Oracle Database
Oracle Instance
Real Application Clusters (RAC)
SQL statements processing
Working with Oracle Database
![Page 27: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/27.jpg)
Introduction to Oracle 27
Real Application Clusters
23 April 2013
Data Files Control Files Online Redo Logs
SGA
PGA
SGA
PGA
Clusterware
SGA
PGA
Clusterware
![Page 28: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/28.jpg)
Introduction to Oracle 2823 April 2013
Oracle Database
Oracle Instance
Real Application Clusters (RAC)
SQL statements processing
Working with Oracle Database
![Page 29: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/29.jpg)
Introduction to Oracle 29
Database Account
• Database user • username/password to connect to database
• Privileges• System and object privileges / roles
• CREATE SESSION, CREATE TABLE, CREATE PROCEDURE, CREATE JOB,…
• EXECUTE ON DBMS_LOCK, SELECT ON HR.EMPLOYEES, …
• Profiles• CERN_DEV_PROFILE: 10 concurrent sessions
• CERN_APP_PROFILE: 400 concurrent sessions
• Space quota on tablespaces
23 April 2013
![Page 30: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/30.jpg)
Introduction to Oracle 30
Database vs Schema
A Schema?• Collection of objects• Owned by a database user and has the
same name as that user• Each user owns a single schema.• Good programming practice is to prefix
objects by schema name
23 April 2013
select name from hr.employees where id=7;
![Page 31: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/31.jpg)
Introduction to Oracle 31
Connecting to Oracle Database
23 April 2013
Listenerport 10121
sqlplus username@
’( DESCRIPTION=
(ADDRESS= (PROTOCOL=TCP)
(HOST=node1.cern.ch) (PORT=10121))
(CONNECT_DATA= (SID=DEVDB11)))’
SGA
Instance SID: DEVDB11
PGA
node1
Data Files Control Files Online Redo Logs
![Page 32: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/32.jpg)
Introduction to Oracle 32
node2-v
Connecting to RAC Database
23 April 2013
Data Files Control Files Online Redo Logs
SGA
PGA
sqlplus username@ ( DESCRIPTION=
(ADDRESS= (PROTOCOL=TCP) (HOST=node2-v.cern.ch) (PORT=10121))
(ADDRESS= (PROTOCOL=TCP) (HOST=node1-v.cern.ch) (PORT=10121)) (LOAD_BALANCE=off) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=CERN_SRV1.cern.ch) ))’
Listener
SGA
PGA
Listener
CERN_SRV1CERN_SRV3CERN_SRV2
node1.cern.ch node2.cern.ch
node1-v Clusterware Clusterware
![Page 33: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/33.jpg)
Introduction to Oracle 33
Local naming method
Based on tnsnames.ora
/afs/cern.ch/project/oracle/admin
\\cern.ch\dfs\Applications\Oracle\ADMIN
23 April 2013
( DESCRIPTION=
(ADDRESS= (PROTOCOL=TCP) (HOST=node2-v.cern.ch) (PORT=10121))
(ADDRESS= (PROTOCOL=TCP) (HOST=node1-v.cern.ch) (PORT=10121)) (LOAD_BALANCE=off) (CONNECT_DATA= (SERVER=DEDICATED) (SERVICE_NAME=CERN_SRV1.cern.ch) ))’
cerndb1 =
sqlplus username@
![Page 34: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/34.jpg)
Introduction to Oracle 3423 April 2013
Oracle Database
Oracle Instance
Real Application Clusters (RAC)
SQL statements processing
Working with Oracle Database
![Page 35: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/35.jpg)
Introduction to Oracle 35
SQL Statements Processing
23 April 2013
SQL Statement
Syntax Check
Semantic Check
Shared Pool Check
Optimization
Row Source Generation
Execution
Parsing
Soft Parse
Hard Parse
select * from hr.employees;
select * from hr.employees;sql_id = 8k3hpjw6yjup5
select name from hr.employees where id=:id_val;
![Page 36: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/36.jpg)
Introduction to Oracle 36
Summary
23 April 2013
![Page 37: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/37.jpg)
Introduction to Oracle 37
Documentation• Oracle Database Concepts
http://docs.oracle.com/cd/E11882_01/server.112/e25789/toc.htm
• Oracle 11g documentation• http://www.oracle.com/pls/db112/portal.all_books
• Architecture poster
23 April 2013
![Page 38: Introduction to Oracle](https://reader035.fdocuments.us/reader035/viewer/2022062517/56813a27550346895da20ad6/html5/thumbnails/38.jpg)
Introduction to Oracle 38
Thank you!
23 April 2013