Introduction to Oracle

74
Introduction to Oracle Database Systems, 2008-2009 Presented by Rubi Boim (based on Jackie Assa’s Slides) 1

description

Introduction to Oracle. Database Systems, 2008-2009 Presented by Rubi Boim. (based on Jackie Assa’s Slides). Bureaucracy… Database architecture overview Buzzwords SSH Tunneling Intro to Oracle Comments on homework. Agenda. Please join the forum at: https://forums.cs.tau.ac.il/. - PowerPoint PPT Presentation

Transcript of Introduction to Oracle

Page 1: Introduction to Oracle

1

Introduction to Oracle

Database Systems, 2008-2009Presented by Rubi Boim

(based on Jackie Assa’s Slides)

Page 2: Introduction to Oracle

2

Agenda Bureaucracy…

Database architecture overview

Buzzwords

SSH Tunneling

Intro to Oracle

Comments on homework

Page 3: Introduction to Oracle

3

The Forum Please join the forum at:

https://forums.cs.tau.ac.il/

Page 4: Introduction to Oracle

4

Homework #1 Submission date is Dec 2. (No late arrivals will be

accepted) Work should be done in pairs Please, please, please, names and ID on the

submittals.

Page 5: Introduction to Oracle

5

Project Hard work, but real. Work in groups of 4 Project goal: to tackle and resolve real-life DB

related development issues One Two stages. Please use JAVA (SWT). (Check with me for other

programming languages) Thinking out of the box will be rewarded

Page 6: Introduction to Oracle

6

Agenda Bureaucracy…

Database architecture overview

Buzzwords

SSH Tunneling

Intro to Oracle

Comments on homework

Page 7: Introduction to Oracle

7

DB System from lecture #1

Data files

Database server(someone else’s

C program) Applications

connection(ODBC, JDBC)

“Two tier database system”

Page 8: Introduction to Oracle

8

1,2,3 tiers

Page 9: Introduction to Oracle

9

A core infrastructure

Page 10: Introduction to Oracle

10

Abstractly (DB) system layers may include

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

Page 11: Introduction to Oracle

11

Why?

DB programmer

App programmer

DBA

Gui designerTester

Page 12: Introduction to Oracle

12

Application layer Why should it actually use

database? Persistence layer Access data storage Interfacing between systems Large volumes Scalability Redundancy

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

Page 13: Introduction to Oracle

13

Infrastructure layer Goals:

Database “hiding” Schema abstraction Encapsulation of db mechanisms

How: (In two words)

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

Page 14: Introduction to Oracle

14

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

DB driver / bridge Used for:

API for database connectivity Protocol converter Performance improvements Transaction management

Examples: In a minute…

Page 15: Introduction to Oracle

15

Transport Mainly TCP but not only Secure Efficient Fast but not fast enough

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

Page 16: Introduction to Oracle

16

DB engine Total management of the DB

environment including Security Scalability (clustering) Maintenance Fault tolerant (disaster management) Monitoring Services

Large DB engines include Microsoft SQL Server, Oracle, SyBase, MySQL, etc.

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

Page 17: Introduction to Oracle

17

DB engine (2)DB engine management includes:

Databases/Tables/FieldsCreation/removal/modification/

optimization Connections/Users/RolesSecurity/monitoring/logging Jobs/Processes/ThreadsScheduling/balancing/managing

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

Page 18: Introduction to Oracle

18

Storage NAS/SAN, Raid and other stuff…

(sorry… not in this course)

Application

DB infrastructure

DB driver

DB engine

Storage

Transport

Page 19: Introduction to Oracle

19

Agenda Bureaucracy…

Database architecture overview

Buzzwords

SSH Tunneling

Intro to Oracle

Comments on homework

Page 20: Introduction to Oracle

20

Terms… ODBC ADO OLE-DB MDAC/UDA JDBC ORM

Page 21: Introduction to Oracle

21

ODBC, OLEDB and ADO Various standards have been developed for

accessing database servers. Some of the important standards are

ODBC (Open Database Connectivity) is the early standard for relational databases.

OLE DB is Microsoft’s object-oriented interface for relational and other databases.

ADO (Active Data Objects) is Microsoft’s standard providing easier access to OLE DB data for the non-object-oriented programmer.

Page 22: Introduction to Oracle

22

ODBC

Open Database Connectivity (ODBC) is a standard software API method for using database management systems (DBMS)

Maximum interoperability

Page 23: Introduction to Oracle

23

ODBCExamples of common tasks:

Selecting a data source and connecting to it.

Submitting an SQL statement for execution.

Retrieving results (if any). Processing errors. Committing or rolling back the transaction

enclosing the SQL statement. Disconnecting from the data source.

Page 24: Introduction to Oracle

24

MDAC… UDA UDA (Universal Data Access) and/or

MDAC (Microsoft Data Access Components) include (ADO), OLE DB, and (ODBC).

Page 25: Introduction to Oracle

25

JDBC Java DB connectivity API Similar to ODBC Why do you need it:

Pure Java Simple API Well….Multi-platform

Page 26: Introduction to Oracle

26

JDBC API includes:

DriverManager, Connection, Statement, PreparedStatement, CallableStatement, ResultSet, SQLException, DataSource

JDBC Type Driver: Type 1 - (JDBC-ODBC Bridge) drivers. Type 2 - native API for data access which provide Java

wrapper classes Type 3 - 100% Java, makes use of a middle-tier between the

calling program and the database.. Type 4 - They are also written in 100% Java and are the

most efficient among all driver types. Calls directly into the vendor-specific database protocol.

Page 27: Introduction to Oracle

27

JDBC Types

Type 1 Type 2 Type 3 Type 4

Page 28: Introduction to Oracle

28

ORM Object-Relational mapping is a

programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages.

For example: Hibernate, EJB3.0, JDO

Page 29: Introduction to Oracle

29

Agenda Bureaucracy…

Database architecture overview

Buzzwords

SSH Tunneling

Intro to Oracle

Comments on homework

Page 30: Introduction to Oracle

30

Welcome to

Page 31: Introduction to Oracle

31

SSH

Application

DB infrastructure

DB bridge/driver

Transport (TCP)

DB engine ServerMachine

ClientMachine

Standard way Using Tunnel

Application

DB infrastructure

DB bridge/driver

DB engine ServerMachine

ClientMachine

Tunnel machine(SSH server)

proxy

ProxyMachineTCP

SSH

TCP

Page 32: Introduction to Oracle

32

SSH in TAUApplication

DB infrastructure

Db bridge/driver

DB engine

Tunnel machine(SSH server)

proxy

YOUR MACHINEdefine DB at localhost, port 1555

Nova.cs.tau.ac.il

orasrv port 1521

Putty connects to nova andforward local port 1555 to orasrv port 1521

Page 33: Introduction to Oracle

33

SSH in TAU

Page 34: Introduction to Oracle

34

Agenda Bureaucracy…

Database architecture overview

Buzzwords

SSH Tunneling

Intro to Oracle

Comments on homework

Page 35: Introduction to Oracle

35

Products we will be using Oracle database – (at home express edition) SQLDeveloper

Free to download on oracle.comMore tutorials on the course slides page

Page 36: Introduction to Oracle

36

Server settings.. Host: localhost/orasrv Port: 1521 SID: xe/csodb/other? Schema hr/user/system

Use the connection guide (link on the course slides page) for instruction on how to create a DB user:

TAU HR user / password: hr_readonly / hrro

Page 37: Introduction to Oracle

37

SQL*plus demoInvoking (TAU):Sqlplus

http://www.cs.tau.ac.il/~boim/courses/databases2009/slides/moreinfo/03-connection-guide.htm

Page 38: Introduction to Oracle

38

Page 39: Introduction to Oracle

39

Page 40: Introduction to Oracle

40

Page 41: Introduction to Oracle

41

Page 42: Introduction to Oracle

42

Page 43: Introduction to Oracle

43

Page 44: Introduction to Oracle

44

Page 45: Introduction to Oracle

45

Page 46: Introduction to Oracle

46

Page 47: Introduction to Oracle

47

Page 48: Introduction to Oracle

48

Page 49: Introduction to Oracle

49

SQLDeveloper demo

Invoking (TAU):sqldeveloper

Page 50: Introduction to Oracle

50

Page 51: Introduction to Oracle

51

Page 52: Introduction to Oracle

52

Page 53: Introduction to Oracle

53

Page 54: Introduction to Oracle

54

Page 55: Introduction to Oracle

55

Page 56: Introduction to Oracle

56

Page 57: Introduction to Oracle

57

Page 58: Introduction to Oracle

58

Page 59: Introduction to Oracle

59

Page 60: Introduction to Oracle

60

Page 61: Introduction to Oracle

61

Page 62: Introduction to Oracle

62

Page 63: Introduction to Oracle

63

Page 64: Introduction to Oracle

64

Page 65: Introduction to Oracle

65

Page 66: Introduction to Oracle

66

Page 67: Introduction to Oracle

67

Page 68: Introduction to Oracle

68

Page 69: Introduction to Oracle

69

Page 70: Introduction to Oracle

70

Oracle Express Edition (XE)

Installation only at home…

Page 71: Introduction to Oracle

71

XE Database demo

Installation Create a user Run a script Query Other database objects Administration tasks

Similar tutorial can be found in http://st-curriculum.oracle.com/tutorial/DBXETutorial/index.htm

Page 72: Introduction to Oracle

72

Agenda Bureaucracy…

Database architecture overview

Buzzwords

SSH Tunneling

Intro to Oracle

Comments on homework

Page 73: Introduction to Oracle

73

Homework Notes SQL functions and arithmetic conditions. Usage of quotes (‘ and “) LIKE, LOWER Use the Syntax help in Query browser MAX, MIN IN

Page 74: Introduction to Oracle

74

Thank you