Oracle database overview. OpenLab Student lecture 13 July 2006 Eric Grancher

Similar documents
Oracle Architectural Components

1-2 Copyright Ó Oracle Corporation, All rights reserved.

Introduction. Assessment Test. Chapter 1 Introduction to Performance Tuning 1. Chapter 2 Sources of Tuning Information 33

Oracle Performance Tuning. Overview of performance tuning strategies

Course Contents of ORACLE 9i

The Oracle DBMS Architecture: A Technical Introduction

Implementation of Database Systems David Konopnicki Taub 715 Spring Sources

Oracle PL/SQL - 12c & 11g [Basic PL/SQL & Advanced PL/SQL]

Oracle Tuning. Ashok Kapur Hawkeye Technology, Inc.

Database Management Systems Introduction to DBMS

IT100: Oracle Administration

Exam: 1Z Title : Oracle9i: Performance Tuning. Ver :

Using Oracle STATSPACK to assist with Application Performance Tuning

1z Oracle9i Performance Tuning. Version 19.0

ORACLE 8 OBJECT ORIENTED TECHNOLOGY ORACLE SOFTWARE STRUCTURES SERVER SIDE BACKGROUND PROCESSES DATABASE SERVER AND DATABASE INSTANCE

RAC for Beginners. Arup Nanda Longtime Oracle DBA (and a beginner, always)

Oracle Notes Part-5. Two Types of Cursor : 1)Implicit Cursor

Oracle Technical Questions. 1. What are the components of Physical database structure of Oracle Database?.

Projects. Corporate Trainer s Profile. CMM (Capability Maturity Model) level Project Standard:- TECHNOLOGIES

IT Best Practices Audit TCS offers a wide range of IT Best Practices Audit content covering 15 subjects and over 2200 topics, including:

Oracle Database 11g: SQL Tuning Workshop

"Charting the Course... Oracle Database 12c: Architecture & Internals. Course Summary

Module 1 Oracle Architecture

Analyzing a Statspack Report

Rajiv GandhiCollegeof Engineering& Technology, Kirumampakkam.Page 1 of 10

Carlos Fernando Gamboa, BNL Andrew Wong, TRIUMF. WLCG Collaboration Workshop, CERN Geneva, April 2008.

Oracle Database 12c Administration I

Data Organization and Processing I

Developing SQL Databases (762)

Memory Management and Memory Structures

Oracle Database: SQL and PL/SQL Fundamentals

DB2 UDB: App Programming - Advanced

CHAPTER. Oracle Database 11g Architecture Options

ORACLE 11gR2 DBA. by Mr. Akal Singh ( Oracle Certified Master ) COURSE CONTENT. INTRODUCTION to ORACLE

Oracle Database 11g: SQL Fundamentals I

Oracle 9i Application Development and Tuning

RECO CKPT SMON ARCH PMON RMAN DBWR

Oracle9i Database: Advanced Instance Tuning

Internals of Active Dataguard. Saibabu Devabhaktuni

Techno India Batanagar Computer Science and Engineering. Model Questions. Subject Name: Database Management System Subject Code: CS 601

InnoDB: Status, Architecture, and Latest Enhancements

Oracle Database 10g The Self-Managing Database

Oracle and Toad Course Descriptions Instructor: Dan Hotka

Course Description. Audience. Prerequisites. At Course Completion. : Course 40074A : Microsoft SQL Server 2014 for Oracle DBAs

IT115: Oracle Database 12c Administration I

Anthony AWR report INTERPRETATION PART I

6232B: Implementing a Microsoft SQL Server 2008 R2 Database

Projects. Corporate Trainer s Profile. CMM (Capability Maturity Model) level Project Standard:- TECHNOLOGIES

Oracle 1Z Oracle 9i: New Features for Administrators. Download Full Version :

Oracle 1Z Oracle Database 11g: Administration I. Download Full Version :

Bipul Sinha, Amit Ganesh, Lilian Hobbs, Oracle Corp. Dingbo Zhou, Basavaraj Hubli, Manohar Malayanur, Fannie Mae

Oracle 9i release 1. Administration. Database Outsourcing Experts

Jyotheswar Kuricheti

SQL (Structured Query Language)

Oracle Database: Introduction to SQL/PLSQL Accelerated

ISV Migrating to Oracle9i/10g

Data Warehousing & Big Data at OpenWorld for your smartphone

Course 40045A: Microsoft SQL Server for Oracle DBAs

Oracle Database 11g: Self-Managing Database - The Next Generation

Department of Information Technology B.E/B.Tech : CSE/IT Regulation: 2013 Sub. Code / Sub. Name : CS6302 Database Management Systems

II B.Sc(IT) [ BATCH] IV SEMESTER CORE: RELATIONAL DATABASE MANAGEMENT SYSTEM - 412A Multiple Choice Questions.

Microsoft. [MS20762]: Developing SQL Databases

DumpsKing. Latest exam dumps & reliable dumps VCE & valid certification king

Oracle FLEXCUBE Private Banking May 2011

Configuring Database Systems

Oracle Database 11g for Experienced 9i Database Administrators

DATABASE SYSTEMS. Database programming in a web environment. Database System Course, 2016

COMP 3400 Mainframe Administration 1

Oracle 12C DBA Online Training. Course Modules of Oracle 12C DBA Online Training: 1 Oracle Database 12c: Introduction to SQL:

SQL Gone Wild: Taming Bad SQL the Easy Way (or the Hard Way) Sergey Koltakov Product Manager, Database Manageability

EMC Unisphere for VMAX Database Storage Analyzer

RDBMS Concepts 1. What is database? A database is a logically coherent collection of data with some inherent meaning,

Module 9: Managing Schema Objects

Introduction to the course

NonStop SQL/MX DBS. Concepts and Architecture. Frans Jongma, NonStop Advanced Technology Center

20762B: DEVELOPING SQL DATABASES

Introduction to SQL/PLSQL Accelerated Ed 2

Data about data is database Select correct option: True False Partially True None of the Above

Vijay Mahawar

Let s Tune Oracle8 for NT

MySQL Architecture and Components Guide

Oracle Hyperion Profitability and Cost Management

Querying Microsoft SQL Server (461)

Informatica Data Explorer Performance Tuning

Oracle Database 12c: RAC Administration Ed 1 LVC


Oracle Database 12c: RAC Administration Ed 1

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION. Ch. 1 :- Introduction Database Management System - 1

A Unit of SequelGate Innovative Technologies Pvt. Ltd. All Training Sessions are Completely Practical & Real-time

Course Details Duration: 3 days Starting time: 9.00 am Finishing time: 4.30 pm Lunch and refreshments are provided.

Database Management System 9

[Contents. Sharing. sqlplus. Storage 6. System Support Processes 15 Operating System Files 16. Synonyms. SQL*Developer

These copies should be placed on different disks, if possible. Disk 1 Disk 2 Disk 3

Oracle Database 10g: Administration I. Course Outline. Oracle Database 10g: Administration I. 20 Jul 2018

Developing SQL Databases

Presented By Chad Dimatulac Principal Database Architect United Airlines October 24, 2011

Managing an Oracle Instance

Optimizing Database I/O

Migrating to MySQL. Ted Wennmark, consultant and cluster specialist. Copyright 2014, Oracle and/or its its affiliates. All All rights reserved.

JSPM s Bhivarabai Sawant Institute of Technology & Research, Wagholi, Pune Department of Information Technology

Transcription:

Oracle database overview OpenLab Student lecture 13 July 2006 Eric Grancher

Outline Who am I? What is a database server? Key characteristics of Oracle database server Instrumentation Clustering Optimiser Usage at CERN

Who am I? Graduated from École Nationale Supérieure des Télécommunications and École Normale Supérieure de Lyon in 1996 (master parallel computing), France. Long term interest in (rather theoretical) computing. At CERN since 1996 in CN/IT department. Section leader for the Database Infrastructure Services section in IT / Database and Engineering Services group. OakTable network member (64 members worldwide Oracle scientist, who believes in better ways of administering and developing Oracle based systems ).

Database Organized collection of data. Schema: structural description of the objects and relationship among them. Several models: flat (see spreadsheet), hierarchical (see file system), network, relational, object (ODMG)

Relational model Model defined with predicate logic and set theory (see E.F.Codd paper 1970). Relation database implementations are an approximation of the relational model. Multiple tables, keys used to match up rows in different tables ( foreign key ). Unique key, primary key. Dimensional: specialized adaptation of the relational model used to represent data in data warehouses. Language = SQL (Structured Query Language).

Transactions and integrity ACID rules: Atomicity, Consistency, Isolation, Durability. Single logical operation is called a transaction (can span a full night!). Important implications! Locking (on reading?), several copies of the data, network: two phase commit

A database server Oracle instance = a set of processes that can receive (in SQL) statements, execute them to perform DDL, DML and queries (and administrative tasks). Oracle database = a set of files/devices that contain data, indexes, configuration data, metadata. Eventually several servers can run Oracle instances attached to the same Oracle database (=cluster, RAC). SQL SQL SQL

The Logical World Few slides thanks to Harvard cscie256 A Tablespace is a logical division of a database. Each tablespace is made up of one or more files, called datafiles. A datafile belongs to one tablespace A table is a logical structure, inside a tablespace

Internal Database Structures Table = The way to store data in a database Indexes = It is a partial copy of a table, used to help speed up accessing the data in the table Views = A method of looking at some of the data in a table or group of tables Procedures = Blocks of PL/SQL statements, called by applications. They do not return a value to the calling program Functions = Like a procedure, but can return a value to the calling program. Packages These hold procedures and functions in logical groups A package can have PUBLIC and PRIVATE elements Public, would be procedures for a USERS usage Private may be called by other procedures in the package Triggers Procedures that execute when a specific event occurs Used to augment referential integrity, enforce additional integrity Statement triggers Row triggers Sequences Sequential lists of unique numbers, important for concurrency in application Users Schemas Database Links Undo Segments (rollback segments)

SGA and processes

SGA structure PMON SMON Shared Pool Data Block Buffers Redo Log Buffers Library Cache Dictionary Cache 1 DBW0 LGWR ARCH 2 3 4 Datafiles Redo Log Files Archived Redo Log Files

System Global Area The Data Buffer Cache is the cache area where data blocks are read into from the data segments, such as tables, indexes, etc. Its size is controlled by the db_cache_size parameter in the init.ora file. This space is managed by a least recently used (LRU) algorithm If data is not in this area, it must be read from the datafile, so we have disk I/O.

System Global Area The Shared Pool stores the data dictionary cache and the library cache The Library Cache holds information about statements that have run against the database It allows the sharing of commonly used SQL statements It is also managed by an LRU algorithm Their sizes are set by the shared_pool_size parameter

System Global Area The Redo log buffer holds redo data on a transaction, before it gets written to the redo log Its size(in bytes) is controlled by the log_buffer parameter

Process architecture A process is a mechanism in an operating system that can run a series of steps. A process has its own private memory area An Oracle database server has User processes Oracle processes

Background Processes PMON cleans up failed user processes. It wake up periodically to check if it is needed. SMON checks to see if a database needs recovery, on startup. It also coalesces free space in tablespaces.

Background Processes DBWR manages the data block buffer cache and the dictionary cache. It handles the batch writes of changed blocks from the SGA to the datafiles. There can be multiple DBWR processes.

Background Processes LGWR manages the writing of the contents of the redo log buffer, to the online redo log files. It writes the log entries in batches. If the redo logs are mirrored sets, then both are written to simultaneously. There can be multiple LGWR processes

Background Processes ARCH performs the archiving of the redo log files. LGWR writes to the redo log files in a round robin fashion. When all are full, it over-writes the first one. However, if the database is in archive mode, Oracle takes a copy of this file and stores it on disk.

Interacting with a database server SQL is the typical language for interaction. (might be hidden). Reference interface is called Oracle Call Interface (C binding, all features exposed). Bindings exists for all third level languages (from C++ to Python). Specific generic interfaces like ODBC and JDBC. Oracle does not support all of these bindings.

The NULL logic Attributes in tables in database management systems can optionally be designated as NULL. This indicates that the actual value of the column is unknown or not applicable. In Oracle: A null can be assigned but it can not be equated with anything: Even itself! three-value logic.

Fun with NULL See null.gwf STUDENT_ID STUDENT_NAME STUDENT_FIRST ---------- ----------- ------------- 1 SMITH John 2 SMITH Bob 3 SMITH 4 SMITH 5 LUNDAHN Kalle Ubbe 6 RUDSHAUG Atle

Instrumentation Oracle database is fully instrumented. Timed wait interface is the key for all tuning exercises. select count(*) from v$event_name; -> 875 Classes of events can be used as first classification. Can be seen locally, globally or globally-diff. Example: live system, no debug mode.

tkprof UPDATE STUDENTS SET STUDENT_FIRST=UPPER(STUDENT_FIRST) call count cpu elapsed disk query current rows ------- ------ -------- ---------- ---------- ---------- ---------- ---------- Parse 0 0.00 0.00 0 0 0 0 Execute 10 0.01 8.81 0 39 149 60 Fetch 0 0.00 0.00 0 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- ---------- total 10 0.01 8.81 0 39 149 60 Misses in library cache during parse: 0 Optimizer mode: ALL_ROWS Parsing user id: 23 (GRANCHER) (recursive depth: 1) Rows Execution Plan ------- --------------------------------------------------- 0 UPDATE STATEMENT MODE: ALL_ROWS 0 UPDATE OF 'STUDENTS' 0 TABLE ACCESS MODE: ANALYZED (FULL) OF 'STUDENTS' (TABLE) Elapsed times include waiting on following events: Event waited on Times Max. Wait Total Waited ---------------------------------------- Waited ---------- ------------ enq: TX - row lock contention 12 0.98 8.68 latch: In memory undo latch 1 0.00 0.00 buffer busy waits 5 0.01 0.01

Trace file WAIT #8: nam='enq: TX - row lock contention' ela= 818431 name mode=1415053318 usn<<16 slot=196641 sequence=286494 obj#=2950721 tim=2541715479178 WAIT #8: nam='enq: TX - row lock contention' ela= 978719 name mode=1415053318 usn<<16 slot=786457 sequence=77545 obj#=2950721 tim=2541716467066 WAIT #8: nam='enq: TX - row lock contention' ela= 984360 name mode=1415053318 usn<<16 slot=393255 sequence=211919 obj#=2950721 tim=2541717451912 WAIT #8: nam='latch: In memory undo latch' ela= 9213 address=15830840048 number=192 tries=1 obj#=-1 tim=2541717468088 WAIT #8: nam='buffer busy waits' ela= 4 file#=21 block#=22962 class#=1 obj#=2950721 tim=2541717468387

Clustering Shared storage (FC, iscsi, NFS ), interconnects between the nodes. Disks Database servers Clients (interactive, batch)

Scaling with clustering Oracle clustering option is called Real Application Cluster but Making application scale with clustering is not trivial: Unless you are working on a trivially scaling application (read mostly) Schema design Interaction One of the key is to minimize block transfer between the RAC nodes.

RAC scalability example Important control application Oracle archiving Initially ~100 changes per second -- top event is : SQL*Net message from client -- change of insertion mechanism Then ~2000 changes per second -- no RAC scalability -- partitioning and unique insertion -- complete redesign Then ~150000 changes per second

Introduction to Cost Based Optimiser (simple version) All SQL statements are parsed and if no execution plan is already in the shared pool, the optimiser has to devise an execution plan. RBO used to rule the (Oracle) world CBO introduced with IO view only

Cost of a statement Cost (9i/10g)= ( #SRds*sreadtim + #MRds*mreadtim + #CPUCycles/cpuspeed ) / sreadtim Before 9i, mreadtim=sreadtim and CPUCycles=0 so the formula is number of reads. Cost (before 9i)= #SRds

System stats System stats are mandatory with CBO Otherwise the system can not figure difference between single block read and multi block read and has no idea about the CPU (automatic gathering as of 10g).

10g SQL optimisation Several phases in the optimiser process Logical optimisation View merging Sub-query un-nesting Join predicate transitivity Physical optimisation Access method to every table (full scan, index lookup) Join method for every join (HJ, SM, NL) Join order for the query tables (join(join(a,b),c)

On your own Oracle has released a free version Oracle Database 10g Express Edition with restrictions. XE will store up to 4GB of user data, use up to 1GB of memory, and use one CPU on the host machine. For Linux x86 (Debian, Mandriva, Novell, Red Hat and Ubuntu) and MS Windows. http://www.oracle.com/technology/products/database/xe/i ndex.html Also available free tools: JDeveloper, SQL Developer. Suggestion: install Oracle XE on a PC, redo the examples, use Application Express (automatically installed to create some database application: simple library).

References http://en.wikipedia.org/wiki/database http://www.acm.org/classics/nov95/toc.html E.F. Codd http://www.psoug.org/reference/null.html NULL http://courses.dce.harvard.edu/~cscie256/docs/ Technet http://www.oracle.com/technology/