• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Database Systems
 

Database Systems

on

  • 448 views

 

Statistics

Views

Total Views
448
Views on SlideShare
448
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Who I am and what we’ll do Course upcoming submittals
  • DB Server, Client App Driver Query Packets Firewall Tunneling client Ssh server
  • scenario sql*Plus invoking login select table_name from user_tables; describe countries; describe locations; select city,country_name from locations inner join countries on locations.country_id = countries.country_id; differences between databases sqlDev database connection database objects explain reports drag and drop format jdev connection editing schema new scema and generate eclipse? XE database login menus graphical queries Additional tools aqua smart draw

Database Systems Database Systems Presentation Transcript

  • Introduction To Oracle And Other Earthly Matters Lecture #3 - Feb 5, 2008, in database systems course, Tel Aviv University Presented by Jackie Assa
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • The Forum!
    • Please Join the Forum at:
    • http://www.cs.tau.ac.il/system/forums/
  • Homework #1
    • Submission date is 19 Feb. (No late arrivals will be accepted)
    • Work should be done in pairs
    • Please, please, please, names and ID on the submittals.
    • Details in the course forum
    • Simple SQL queries on our “hr” database
    • Submission will include an answers document and a SQL script with all the queries. Name of the script should be <yourname>.sql (sent as an attachment)
  • 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.
    • Most programming language are accepted (Check with me)
    • Thinking out of the box will be rewarded
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • DB System from lecture #1 Data files Database server (someone else’s C program) Applications “ Two tier database system” connection (ODBC, JDBC)
  • A core infrastructure
  • 1,2,3 tiers
  • Abstractly (DB) system layers may include Application DB infrastructure DB driver transport DB engine Storage
  • Why (at least 1 reason) DB programmer App programmer DBA Gui designer Tester
  • 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 transport DB engine Storage
  • Infrastructure layer
    • Goals:
      • Database “hiding”
      • Schema abstraction
      • Encapsulation of db mechanisms
      • Reuse
    • How: (In two words)
    Model Abstraction Application DB infrastructure DB driver transport DB engine Storage
  • DB driver / bridge
    • Used for:
      • API for database connectivity
      • Protocol converter
      • Performance improvements
      • Transaction management
    • Examples:
      • In a minute…
    Application DB infrastructure DB driver transport DB engine Storage
  • Transport
    • Mainly TCP but not only
    • Secure
    • Efficient
    • Fast but not fast enough
    Application DB infrastructure DB driver transport DB engine Storage
  • 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 transport DB engine Storage
  • DB engine (2)
    • DB engine management includes:
      • Databases/Tables/Fields
      • Creation/removal/modification/ optimization
      • Connections/Users/Roles
      • Security/monitoring/logging
      • Jobs/Processes/Threads
      • Scheduling/balancing/managing
  • Storage
    • NAS/SAN, Raid and other stuff… (sorry… not in this course)
    Application DB infrastructure DB driver transport DB engine Storage
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • Terms…
    • ODBC
    • ADO
    • OLE-DB
    • DAO
    • MDAC/UDA
    • JDBC
    • ORM
  • ODBC (Mainly Microsoft)
    • Open Database Connectivity (ODBC) is a widely accepted application “C” programming interface (API) for database access.
    • Maximum interoperability
    • Expose database capabilities, not supplement them, except:
      • File access data
      • Cursor lib
  • ODBC – Example architecture
  • ODBC
    • Examples 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.
  • OLE-DB (Microsoft)
    • General COM model describing how applications access data
    • Presents a single, consistent means of access to the application
    • Uses two models, rowset and binder
    OLE-DB Interface Consumer / Application Oracle DB Provider DBMS Exchange Excel Microsoft Windows COM My app
  • OLE-DB models
    • Rowset:
    • Binder
  • ADO (Microsoft)
    • ActiveX Data Objects (ADO) provides consistent, high-performance access to data.
    • COM based, provides ease of use, high speed, low memory overhead, and a small disk footprint.
    • Actually a simple interface to OLE DB.
    • Includes extensions such as: Multidimensional (ADO MD), Remote Data Service (RDS), etc.
    • Alas…. Ado.net
  • Two words about .Net and java
    • Virtual machine
  • MDAC… UDA
    • UDA (Universal Data Access) and/or MDAC (Microsoft Data Access Components) include (ADO), OLE DB, and (ODBC).
  • JDBC
    • Java DB connectivity API
    • Similar to ODBC
    • Why do you need it:
      • Pure Java
      • Simple API
      • Well….Multi-platform
  • JDBC
    • Supports n-Tier architectures
    • Tabular data handling
    • SQL but not only SQL
  • JDBC
    • API includes:
      • DriverManager, Connection, Statement, PreparedStatement, CallableStatement, ResultSet, SQLException, DataSource
    • JDBC 2.0 includes:
      • Transactions, improved connections, and more…
    • 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, use vendor independent Net-protocol to access a vendor independent remote listener. This listener converts vendor independent calls to vender dependent ones.
      • Type 4 - They are also written in 100% Java and are the most efficient among all driver types.
  • ORM
    • Object-Relational mapping is a programming technique for converting data between incompatible type systems in relational databases and object-oriented programming languages. (wikipedia)
    • For example: Hibernate, EJB3.0, JDO
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • Welcome to The travels of a query
  • SSH Application DB infrastructure Db bridge/driver Transport (TCP) DB engine Server Machine Client Machine Standard way Using Tunnel Application DB infrastructure Db bridge/driver DB engine Server Machine Client Machine Tunnel machine (SSH server) proxy Proxy Machine TCP SSH TCP
  • SSH in TAU Application DB infrastructure Db bridge/driver DB engine Tunnel machine (SSH server) proxy YOUR MACHINE (HOME/LAB) define DB at 127.0.0.1, port 1555 Nova.cs.tau.ac.il Ida.cs.tau.ac.il Port 1521 Tera Term Pro connects to nova and forward local port 1555 to ida port 1521 For more details: http://www.cs.tau.ac.il/faq/ssh_tunnelling.htm
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • Products we will be using
    • Oracle database – (express edition)
    • SQLDeveloper
    • JDeveloper
    • Free to download on oracle.com
    • More tutorials on http://www.tau.ac.il/~jackassa/db/
      • java programming.pdf
      • JDBC.pdf
      • program with PLSQL.pdf
      • SQL foundamentals I.pdf
      • SQL foundamentals II.pdf
      • SQL tuning.pdf
  •  
  •  
  •  
  • Things to contemplate on when connecting…
    • Host
    • Port
    • SID
    • Driver
    • Schema
    • User
    • password
    • localhost/plab-156
    • 1521
    • xe/taudb/other?
    • Thin oracle.jdbc.driver.OracleDriver
    • hr/user/system
    • ?
    http://www.tau.ac.il/~jackassa/db/cGuide.htm
  • SQL*plus demo
    • Invoking (TAU):
    • Sqlplus
    http://www.tau.ac.il/~jackassa/db/cGuide.htm
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  • SQLDeveloper demo Invoking (TAU): sqldeveloper
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  • Oracle JDeveloper demo Invoking (in TAU): jdev
  • Oracle Express Edition (XE) Installation only at home…
  • XE Database hands-on 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
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • Additional Notes
    • SQL functions and arithmetic conditions.
    • Usage of quotes
    • LIKE, SOUNDS LIKE
    • Use the Syntax help in Query browser
    • DESCRIBE
    • Joins
  • Agenda
    • Bureaucracy…
    • Database architecture overview
    • Buzzwords
    • SSH Tunneling
    • Intro to Oracle
    • Comments on homework
    • (If time permits) Intro to programming
  • Project Coding Tips
    • Layering
    • Encapsulation
    • Reuse
    • Configuration
    • Schema
    • Testing
  • Thank you
  • database server (Oracle on plab-156)
  • Client Application (your app)
  • Driver (Oracle)
  • Firewall
  • SSH client (Tera-term)
  • SSH Server (Nova)