Presentation of Oracle database products

Preview:

Citation preview

SQL vs NoSQL Databases

Algiers Tech Meetup #11

<Insert Picture Here>

Presentation of Oracle database products for Beginners

AGUEDAL YazidSenior Database administration consultantIT Synergy General Manageraguedal@itsynergy-dz.com

Agenda

• History and evolution of Oracle Database products

• Fundamental concepts of Oracle Database

• Some Advanced features

• The Cloud and Oracle 12c

• Q&A

The History of Oracle

• Founded in August 1977 by Larry Ellison, Bob Miner, Ed Oates and Bruce Scott, Oracle was initially named after "Project Oracle" a project for one of their clients, the C.I.A, and the company that developed Oracle was dubbed "Systems Development Labs", or SDL.   Although they may not have realized it at the time, these four men would change the history of database management forever.

• In 1978 SDL was renamed Relational Software Inc (RSI) to market their new database. 

• 1977: Larry Ellison and friends founded Software Development Laboratories (SDL).

• 1978: Oracle Version 1, written in assembly language, runs on PDP-11 under RSX, in 128K of memory. Implementation separates Oracle code and user code. Oracle V1 is never officially released.

• 1979: SDL changed its company-name to "Relational Software, Inc." (RSI) and introduced its product Oracle V2 as an early relational database system - often cited[ as the first commercially sold RDBMS.The version did not support transactions, but implemented the basic SQL functionality of queries and joins. (RSI never released a version 1 - instead calling the first version version 2 as a marketing gimmick.)

• 1982: RSI in its turn changed its name, becoming known as "Oracle Corporation",[ to align itself more closely with its flagship product.

• 1983: The company released Oracle version 3, which it had re-written using the C programming language, and which supported COMMIT and ROLLBACK functionality for transactions. Version 3 extended platform support from the existing Digital VAX/VMS systems to include Unix environments.

• 1984: Oracle Corporation released Oracle version 4, which supported read-consistency. In October it also released the first Oracle for the IBM PC.

• 1985: Oracle Corporation released Oracle version 5, which supported the client–server model—a sign of networks becoming more widely available in the mid-1980s.

• 1986: Oracle version 5.1 started supporting distributed queries.• 1988: Oracle RDBMS version 6 came out with support for 

PL/SQL embedded within Oracle Forms v3 (version 6 could not store PL/SQL in the database proper), row-levellocking and hot backups.

• 1989: Oracle Corporation entered the application-products market and developed its ERP product, (later to become part of the Oracle E-Business Suite), based on the Oracle relational database.

• 1990: the release of Oracle Applications release 8

• 1992: Oracle version 7 appeared with support for referential integrity, stored procedures and triggers.

• 1997: Oracle Corporation released version 8, which supported object-oriented development and multimedia applications.

• 1999: The release of Oracle8i aimed to provide a database inter-operating better with the Internet (the i in the name stands for "Internet"). The Oracle8i database incorporated a native Java virtual machine (Oracle JVM, also known as "Aurora").

• 2000: Oracle E-Business Suite 11i pioneers integrated enterprise application software

• 2001: Oracle9i went into release with 400 new features, including the ability to read and write XML documents. 9i also provided an option for Oracle RAC, or "Real Application Clusters", a computer-cluster database, as a replacement for the Oracle Parallel Server (OPS) option.

• 2002: the release of Oracle 9i Database Release 2 (9.2.0)• 2003: Oracle Corporation released Oracle Database 10g, which

supported regular expressions. (The g stands for "grid"; emphasizing a marketing thrust of presenting 10g as "grid computing ready".)

• 2005: Oracle Database 10.2.0.1—also known as Oracle Database 10g Release 2 (10gR2)—appeared.

• 2006: Oracle Corporation announces Unbreakable Linux and acquires i-flex

• 2007: Oracle Database 10g release 2 sets a new world record TPC-H 3000 GB benchmark result

• 2007: Oracle Corporation released Oracle Database 11g for Linux and for Microsoft Windows.

• 2008: Oracle Corporation acquires BEA Systems.• 2010: Oracle Corporation acquires Sun Microsystems.

• 2011: Oracle Corporation acquires web content management system FatWire Software.

• 2011: On 18 October, Oracle Corporation acquires Endeca Technologies Inc. faceted search engine software vendor.

• 2013: Oracle Corporation released Oracle Database 12c

for Linux, Solaris and Windows. (The c stands for "cloud")• 2016: Oracle Corporation released Oracle Database 12

c Release 2

DatabaseData files

Online redo log files

Control files

Oracle Database Architecture: Overview

Databasebuffercache

Shared pool

Data dictionarycache

Librarycache

PMONSMON Others

Serverprocess

PGA

Archived log filesUser

process

Instance

RECO

ARCn

SGA

DBWn

Redo logbuffer

LGWRCKPT

Database

Oracle Database Server Structures

PMONSMON Others

Data filesOnline redo

log filesControl

files

Instance

RECOARCn DBWn LGWRCKPT

Storage structures

Userprocess

Serverprocess

Memory structures

Processes

Databasebuffercache

Shared pool

Data dictionarycache

Librarycache

SGA

Redo logbuffer

Oracle Database Memory Structures

DB structures Memory - Process - Storage

SGA

Database buffercache

Redo log buffer

Java pool

Streams pool

Shared pool

Large pool

PGA PGA PGA Backgroundprocess

Serverprocess 1

Serverprocess 2

Shared SQL area

Library cache

Data dictionary cache

Other

I/O buffer

Response queue

Request queue

Free memory

Process Architecture

• User process• Is started when a database user or a batch process

connects to Oracle Database• Database processes

• Server process: Connects to the Oracle instance and is started when a user establishes a session

• Background processes: Are started when an Oracle instance is started

DB structures - Memory Process - Storage

PMONSMON Others

Instance

RECOARCn DBWn LGWRCKPT

PGA

Userprocess

Serverprocess Background processes

Databasebuffercache

Shared pool

Data dictionarycache

Librarycache

SGA

Redo logbuffer

Database Storage Architecture

Online redo log files

Password file

Parameter file Archived redo log files

Control files Data files

Alert log and trace files

Backup files

DB structures - Memory - Process Storage

D E M O

Utiliser le langage SQL pour interrogerune base de données

• Le langage SQL (Structured Query Language) est : • le langage normalisé par l'ANSI pour la gestion

des bases de données relationnelles • efficace, facile à apprendre et simple d'utilisation • complet sur le plan fonctionnel (il permet de définir, d'extraire et

de manipuler des données dans les tables)

SELECT department_name FROM departments;

Serveur Oracle

Instructions SQL • • SELECT • INSERT • UPDATE • DELETE • MERGE •

• • CREATE • ALTER • DROP • RENAME • TRUNCATE • COMMENT • • GRANT • REVOKE • • • COMMIT • ROLLBACK • SAVEPOINT • •

Langage de manipulation de données (LMD)

Langage de définition de données (LDD)

Contrôle des transactions

Langage de contrôle de données (LCD)

Environnements de développementpour le langage SQL

• Dans le cadre de ce cours : • Utilisez en priorité Oracle SQL Developer version 1.2 • Utilisez SQL*Plus :

• si vous n'avez pas accès à Oracle SQL Developer • ou si une commande ne fonctionne pas dans Oracle SQL

Developer

SQL Developer SQL *Plus

Oracle SQL Developer : Présentation • Oracle SQL Developer est un outil graphique améliorant

la productivité et simplifiant les tâches de développement liées aux bases de données.

• Vous pouvez vous connecter à n'importe quel schéma de base de données Oracle cible à l'aide de l'authentification de base de données Oracle standard.

SQL Developer

Oracle SQL Developer : Caractéristiques

• Développé en langage Java • Prend en charge les plates-formes Windows,

Linux et Mac OS X • Connectivité par défaut à l'aide du pilote JDBC thin • Ne requiert aucun installeur

• Décompressez le kit Oracle SQL Developer téléchargé et cliquez deux fois sur sqldeveloper.exe pour lancer Oracle SQL Developer.

• Se connecte à n'importe quelle base de données Oracle de version 9.2.0.1 ou ultérieure

• Téléchargement gratuit à partir du lien suivant : • http://www.oracle.com/technology/products/database/

sql_developer/index.html • Nécessite l'installation sur votre système du kit JDK 1.5,

qui peut être téléchargé à partir du lien suivant : • http://java.sun.com/javase/downloads/index_jdk5.jsp

Interface d'Oracle SQL Developer

Pour pouvoir utiliser SQL Developer afin

d'exécuter des interrogations SQL sur un schéma de base de données, vous devez d'abord définir une

connexion.

Créer une connexion de base de données • Pour utiliser Oracle SQL Developer, vous devez disposer d'au

moins une connexion de base de données. • Vous pouvez créer et tester des connexions pour :

• plusieurs bases de données • plusieurs schémas

• Oracle SQL Developer importe automatiquement toutes les connexions définies dans le fichier tnsnames.ora de votre système.

• Vous pouvez exporter des connexions vers un fichier XML. • Chaque nouvelle connexion de base de données créée est

répertoriée dans la hiérarchie du navigateur de connexions.

Créer une connexion de base de données 1

2

3

Consulter les objets de base de données

• Utilisez le navigateur de connexions pour : • naviguer dans la liste des objets d'un schéma

de base de données • consulter d'un coup d'oeil les définitions des objets

Utiliser SQL Worksheet

• Utilisez SQL Worksheet pour entrer et exécuter des instructions SQL, PL/SQL et SQL*Plus.

• Indiquez les actions qui peuvent être traitées par la connexion de base de données associée à SQL Worksheet.

Entrez des instructions SQL.

Les résultats sont affichés ici.

Utiliser SQL Worksheet

1 2

3

4

5

6

7

8 9

Exécuter des instructions SQL

• Entrez une ou plusieurs instructions SQL dans la zone Enter SQL Statement.

F9 F5

F9F5

Formater le code SQL

Avant formatage

Après formatage

Enregistrer des instructions SQL

1

2

3

Exécuter des fichiers script

1

2

3

Instructions SQL dans SQL*Plus

• Dans Oracle Database 11g, SQL*Plus est une interface de ligne de commande.

I - 35

Coder PL/SQL dans Oracle SQL Developer • Oracle SQL Developer est un outil graphique gratuit qui

augmente la productivité et simplifie les tâches de développement de base de données.

• Vous pouvez vous connecter à n'importe quel schéma de base de données Oracle cible en utilisant l'authentification de base de données Oracle standard.

• Dans ce cours, vous allez utiliser SQL Developer.

SQL Developer

I - 36

Exécuter du code PL/SQL dans SQL*Plus

I - 37

Générer du code PL/SQL dans Oracle JDeveloper

Editer

Exécuter

I - 38

Démarrer SQL Developer et créer une connexion de base de données

1 - 39

A propos du langage PL/SQL

• Le langage PL/SQL : • signifie "Procedural Language extension to SQL"

(extension procédurale du langage SQL) • est le langage standard d'accès aux données d'Oracle

Corporation pour les bases de données relationnelles • intègre de manière transparente les structures procédurales au

langage SQL

1 - 40

A propos du langage PL/SQL

• Caractéristiques du langage PL/SQL : • Il offre une structure de bloc pour les unités de code

exécutables. Cette structure bien définie facilite la maintenance du code.

• Il fournit des structures procédurales : • Variables, constantes et types de données • Structures de contrôle, telles que les instructions

conditionnelles et les boucles • Programmes réutilisables qui peuvent être exécutés

plusieurs fois

1 - 41

Environnement PL/SQL

Moteur PL/SQL

Serveur de base de données Oracle

Programme d'exécution des instructions SQL

Programmed'exécution

des instructions

procédurales

instruction procédurale

SQL

BlocPL/SQL

1 - 42

Avantages liés à l'utilisation du langage PL/SQL

• Intégration de structures procédurales au langage SQL • Amélioration des performances

SQL IF...THEN

SQL ELSE SQL

END IF; SQL

SQL 1

SQL 2 …

1 - 43

Avantages liés à l'utilisation du langage PL/SQL

• Développement de programme modulaire • Intégration aux outils Oracle • Portabilité • Traitement des exceptions

1 - 44

Structure d'un bloc PL/SQL

• DECLARE (facultatif) • Variables, curseurs, exceptions définies par l'utilisateur

• BEGIN (obligatoire) • Instructions SQL • Instructions PL/SQL

• EXCEPTION (facultatif) • Actions à effectuer lorsque

des erreurs se produisent • END; (obligatoire)

1 - 45

Types de bloc

• Bloc anonyme Procédure Fonction

[DECLARE]

BEGIN --statements

[EXCEPTION]

END;

PROCEDURE name IS

BEGIN --statements

[EXCEPTION]

END;

FUNCTION name RETURN datatype

IS BEGIN

--statements RETURN value; [EXCEPTION]

END;

1 - 46

Créer un bloc anonyme

• Entrez le bloc anonyme dans l'espace de travail SQL Developer :

1 - 47

Exécuter un bloc anonyme

• Cliquez sur le bouton Run Script pour exécuter le bloc anonyme :

Run Script

VLDB Manageability andPerformance Constraints• Table availability:

• It is too costly to have a large table inaccessible for hours because of recovery.

• Large tables can be more vulnerable to disk failure.• Large-table manageability:

• They take too long to be loaded.• Indexes take too long to be built.• Partial deletes take hours, and even days.

• Performance considerations:• Large-table and large-index scans are costly.• Scanning a subset improves performance.

Manual Partitions Versus Partitioning

SALES_10 SALES_11

SALES_12

SALES (view)

P11P10 P12

Manual partitions (tables)

UNION ALL

SALES (partitioned table)

Partitioned Tables and Indexes

• Large tables and indexes can be partitioned into smaller, more manageable pieces. Each piece is a segment.

Table T1 Index I1

Table T1 Index I1

Table Versus Index Partitioning

A nonpartitioned table can have partitioned or

nonpartitioned indexes.

•A partitioned table can have partitioned or

nonpartitioned indexes.

Table T1

Index I1 Index I2

Table T2

Index I3 Index I4

Partitioning Strategies:Single-Level Partitioning• Range partitioning: Maps data to partitions based on ranges

of partition key values for each partition• Hash partitioning: Maps data to partitions by using a

hashing algorithm applied to a partitioning key • List partitioning: Maps data to partitions by using a list of

discrete values for the partitioning column• Interval partitioning: Maps data to partitions of ranges that

are automatically created by the database following a specified interval

• System partitioning: Enables the application to explicitly map rows to arbitrary partitions

Partitioning Strategies:Composite Partitioning• Top-level strategies: RANGE, INTERVAL, HASH, LIST• Bottom-level strategies: RANGE, HASH, LIST• All combinations are

supported, such as thefollowing examples:• RANGE-LIST• HASH-HASH

SP1a

SP2a

SP3a

SP4a

RANGE, HASH, LIST

SP1b SP1c SP1y SP1z

SP2b SP2c SP2y SP2z

SP3b SP3c SP3y SP3z

SP4b SP4c SP4y SP4z

RANGE, INTERVAL, HASH, LIST,

Oracle Partitioning History

Core Functionality Performance Manageability

Oracle 8.0 Range partitioningGlobal range indexes

Static partition pruning Basic maintenance:ADD,DROP,EXCHANGE

Oracle 8i Hash partitioningRange-hash partitioning

Partition-wise joinsDynamic pruning

Expanded maintenance:MERGE

Oracle 9i List partitioning Global index maintenance

Oracle 9i R2 Range-list partitioning Fast partition SPLIT

Oracle 10g Global hash indexes Local index maintenance

Oracle 10g R2 1M partitions per table Multidimensional pruning Fast DROP TABLE

Oracle 11g Virtual column based partitioningMore composite choicesREF partitioning

Interval partitioningPartition AdvisorIncremental stats management

Oracle 11g R2 Hash-hash partitioning “AND” pruning Multibranch executionSegment creation on demand*

Oracle et la haute disponibilité

• Real Application Cluster RAC

• Data Guard

ORACLE RAC

Le Cloud: L’avenir pour Oracle

Le cloud: l’avenir pour Oracle

• Oracle Database 12c / Amazon Redshift

• MYSQL / Aurora

SQL Server on Linux

•https://www.microsoft.com/en-us/cloud-platform/sql-

server-on-linux

Microsoft défie Oracle avec SQL Server 2016 for Linux

• Redmond contre Redwood

• Cette décision reste logique. Les serveurs Linux gagnent en effet du terrain en entreprise. En particulier dans les infrastructures Cloud.

• De plus, si SQL Server reste devant la plupart de ses concurrents, ses parts de marché en entreprise sont moitiés moindres que celles d’Oracle Database, le leader du secteur.

Source: http://www.techrepublic.com/article/nosql-databases-eat-into-the-relational-database-market/

Oracle aussi ….. offre du NoSQL

• Oracle NoSQL Database• Horizontally Scaled, Key-Value Database for Web

Services and Cloud• Oracle NoSQL Database provides a powerful and

flexible transaction model that greatly simplifies the process of developing a NoSQL-based application. It scales horizontally with high availability and transparent load balancing even when dynamically adding new capacity.

http://www.oracle.com/database/nosql/index.html

AQ&

Recommended