It is obvious that for bulk data processing performance is the key factor. It often means balancing well structured, maintainable, reusable and high-performance code.
Even though there are more features and optimizations that support bulk processing with each release of PL/SQL, the "Pure SQL" approach often leads to better performance.
Best practices, tips and tricks. How do I develop a complex SQL? How can Subquery Factoring help to increase readability? How does this help to test complex SQLs? What is a Row Generator? How do I change the cardinality of the original data set?
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Yury Velikanov
The document provides instructions for setting up a two-node Oracle 12c RAC environment within Oracle VirtualBox on a Windows laptop. The main steps include:
1. Configuring VirtualBox with a host-only network and installing Oracle Linux 6 on the first virtual machine.
2. Creating shared virtual disks for the ASM storage and installing Oracle Grid Infrastructure.
3. Cloning the first virtual machine to create the second node, and installing the Oracle 12c database software.
This allows users to test an Oracle 12c RAC sandbox environment locally without requiring additional physical hardware.
Die Open-Source-Bibliothek Pandas ist das Schweizer Taschenmesser im Bereich Datenanalyse in Python ohne die Performance Nachteile interpretierter Sprachen. Sie punktet mit:
* Hochperformance-Verarbeitungen großer Datenmengen dank Numpy,
* Verarbeitung gängiger Datenformate (CSV, Excel, HDF, SQL, JSON, HTML ...), und
* direktem Zugriff auf Visualisierung, Aggregationen und Statistikfunktionen.
Der Talk gibt eine Einführung in Pandas insbesondere mit Blick auf DataSeries, DataFrames, Zeitreihenanalyse und zeigt anhand von Beispielen, wie man effizient und schnell mit Pandas tiefen Einblick in seine Daten bekommen kann.
It is obvious that for bulk data processing performance is the key factor. It often means balancing well structured, maintainable, reusable and high-performance code.
Even though there are more features and optimizations that support bulk processing with each release of PL/SQL, the "Pure SQL" approach often leads to better performance.
Best practices, tips and tricks. How do I develop a complex SQL? How can Subquery Factoring help to increase readability? How does this help to test complex SQLs? What is a Row Generator? How do I change the cardinality of the original data set?
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0Yury Velikanov
The document provides instructions for setting up a two-node Oracle 12c RAC environment within Oracle VirtualBox on a Windows laptop. The main steps include:
1. Configuring VirtualBox with a host-only network and installing Oracle Linux 6 on the first virtual machine.
2. Creating shared virtual disks for the ASM storage and installing Oracle Grid Infrastructure.
3. Cloning the first virtual machine to create the second node, and installing the Oracle 12c database software.
This allows users to test an Oracle 12c RAC sandbox environment locally without requiring additional physical hardware.
Die Open-Source-Bibliothek Pandas ist das Schweizer Taschenmesser im Bereich Datenanalyse in Python ohne die Performance Nachteile interpretierter Sprachen. Sie punktet mit:
* Hochperformance-Verarbeitungen großer Datenmengen dank Numpy,
* Verarbeitung gängiger Datenformate (CSV, Excel, HDF, SQL, JSON, HTML ...), und
* direktem Zugriff auf Visualisierung, Aggregationen und Statistikfunktionen.
Der Talk gibt eine Einführung in Pandas insbesondere mit Blick auf DataSeries, DataFrames, Zeitreihenanalyse und zeigt anhand von Beispielen, wie man effizient und schnell mit Pandas tiefen Einblick in seine Daten bekommen kann.
http://www.opitz-consulting.com
Nicht immer stehen einem DBA GUI-basierte (und oftmals teure) Tools zur Verfügung, um ein Performance-Problem in der Datenbank zu analysieren. Mit den vorhandenen "Bordmitteln" der Datenbank kann man jedoch auch eine gute Diagnose stellen. Dieser Vortrag widmet sich einer Auswahl dieser Werkzeuge und legt einen Schwerpunkt auf die Möglichkeiten, die einem in der Standard Edition und ohne Tuning Pack zur Verfügung stehen.
Unser Experte Uwe Küchler hat beim DOAG Community Webcast am 8.4.2016 eine Auswahl von Werkzeugen vorgestellt.
--
Über uns:
Als führender Projektspezialist für ganzheitliche IT-Lösungen tragen wir zur Wertsteigerung der Organisationen unserer Kunden bei und bringen IT und Business in Einklang. Mit OPITZ CONSULTING als zuverlässigem Partner können sich unsere Kunden auf ihr Kerngeschäft konzentrieren und ihre Wettbewerbsvorteile nachhaltig absichern und ausbauen.
Besuchen Sie unsere Homepage: http://www.opitz-consulting.com
Angelika Gallwitz – IT-Tage 2015 – Statistische Auswertungen in Oracle mit S...Informatik Aktuell
Auch in Oracle12c werden Statspack und AWR Reports herangezogen, um Performance Engpässe zu erkennen und Maßnahmen zu ergreifen. Der ADDM liefert seinen Beitrag. Wie erzeuge und interpretiere ich einen Statistik-Report? Wie verändere ich Snap Level und Threshold? Anhand der Wait Events und Wait Classes wird eine Zuordnung zu den Problembereichen vorgenommen und konkrete Empfehlungen zu Tuning-Maßnahmen gegeben.
Analytics meets Big Data – R/Python auf der Hadoop/Spark-PlattformRising Media Ltd.
Big Data verändert nicht nur die Unternehmens-IT fundamental, sondern auch die Arbeit des Analysten. Die klassischen Analysten sehen sich im Zuge des Wandels zu einer datengetriebenen Unternehmenskultur mit neuen Anforderungen und ungewohnten technologischen Plattformen konfrontiert. Sie müssen als Data Scientist fachliche Fragestellungen unter dem Aspekt der Big Data-Technologien umsetzen, visualisieren und aus den Daten Werte generieren. Anhand eines konkreten Use Cases, der Programmierung eines Recommender-Systems, zeigen wir Ansätze, wie sich die gewohnten Vorgehensweisen und Werkzeuge eines Analysten (namentlich R und Python) mit einer Big Data-Technologie (Spark) kombinieren lassen. Ziel ist es, dem Analysten den Einstieg in die Big Data-Welt zu erleichtern. Wir demonstrieren die Arbeit mit diesem Toolset an anschaulichen Beispielen in einem interaktiven Workshop-Format und laden zur Diskussion und Nachahmung dieser Vorgehensweise ein. Der Workshop richtet sich an Teilnehmer mit Grundkenntnissen aus den Bereichen analytische Methoden und Machine Learning sowie R oder Python. Der Workshop wird auf der Spark-Plattform durchgeführt. Zu Spark werden keine Kenntnisse vorausgesetzt.
Mit Performance-Modellierung Test- und Betriebskosten senkenDynatrace
In diesem Webinar, zeigt Herr Andreas Brunnert, Performance Consultant bei RETIT, in einer Live-Demo und anhand von vier Kundenszenarien wie Performance Modellierung erfolgreich in der Praxis eingesetzt werden.
CDI (Context Dependency Injection) ermöglicht es dem Entwickler skalierbare und flexible Architekturen aufzubauen die auf einem Java(EE) Server als auch auf dem Desktop laufen. Wie aber sollten DesignPattern aufgebaut werden unter Verwendung von CDI? Was für einen Einfluss hat Java 8 auf die DesignPattern, wie wird es mit der neuen Streams API kombiniert?
Höhepunkt ist die Kombination von klassischen Reflection-Einsatzgebieten wie z.B. dynamic Proxies mit CDI und Cross-Language Injections.
Einige ausgewählte Oracle PL/SQL Packages aus Version 11g und 12c werden kurz beschrieben und illustriert an Beispielen. In Teil 3 handelt es sich dabei um:
DBMS_XPLAN
DBMS_ASSERT
DBMS_RESUMABLE
DBMS_UTILITY
Forms and Reports 12c - Processes and Automation in Development and OperationsTorsten Kleiber
The current target architecture of IKB's credit and loan management is based on Oracle ADF and SOA and of course the database. But how can you protect in this time your Oracle Forms & Reports longtime investments, can you support their Development Lifecycle by Automation?
Many supporting technologies from the Java environment, such as branching models, automated build and deploy procedures or code review were established with the Oracle technologies and in the course of the regulatory process.
But there is still a large part of the Oracle Forms & Reports that have grown over 25 years and have not yet been replaced. Actually, we hoped that we would no longer need a version higher than 11g. Forms & Reports had been running very stably for years. A bug brought the migration to 12c back into focus to further run supported versions. The regulatory environment did the rest to revise the current processes and, where possible, to automate them.
So how do supporting technologies and automation fit in here?
I will show you a selection of these processes from IKB's development and operations life cycle:
* Installation of application server
* Regular patching
* Packaging of the local development environment
* Requirements documentation
* Branching
* Development
* Code Review
* Merge
* Deployment
* Traceability for Regulatory Purposes
The following tools are used, among others
* Jenkins
* Scripting with Bash and Powershell
* Git
* Bitbucket
* JIRA
* FormsAPI Master
racle 11g verspricht interessante Neuerungen. Rund vierhundert neue Features haben die Entwickler aus Redwood Shores im neuesten Release implementiert.
Der Hersteller hebt Erleichterungen für Datenbankadministratoren und Verbesserungen der Datenverwaltung hervor. So lassen sich Aktualisierungen der Serversoftware im laufenden Betrieb einspielen. Hochverfügbare Standby-Systeme können nun standardmäßig für ein Reporting genutzt werden. Automatic Storage Management, eine Art integrierter Volume Manager, unterstützt bei der Datenspeicherung. Nicht zu vergessen: Flashback Data Archive erlaubt eine automatische Historisierung von Daten - und das ohne Aufwände für zusätzliche Eigenentwicklungen. Der "Partition Advisor" schlägt geeignete Partitionen für Datentabellen vor; wahlweise kann er diese Zerlegungen auch automatisch durchführen. Mit Real Application Testing können Transaktionen aufgezeichnet und für Lasttests genutzt werden.
Die Liste ließe sich nahezu endlos fortführen. Doch welche der Neuerungen sind tatsächlich sinnvoll und nützlich? Lohnt sich der Wechsel? Welche Migrationspfade gibt es?
Übersicht der wichtigsten Neuerungen in Oracle DB 11g
Was bringen die "New Features" wirklich?
Wie stabil ist das neueste Release?
Welche Migrationspfade gibt es?
In Oracle 18c, SQL and PL/SQL work even more closely together. A good example are the Polymorphic Table Functions (PTF). With PTF, which are part of the ANSI SQL 2016 standard, you get a powerful and flexible tool to extend existing analytical capabilities of SQL. The basics of the new functionality is discussed as well as the implementation details shown by concrete examples.
Oracle Stream Explorer is a platform that allows business users to analyze streaming data sources and gain real-time insights without needing expertise in stream processing or related technologies. It connects to various data sources, enriches data using static references, and allows users to build interactive explorations using visual tools for filtering, correlating, aggregating and detecting patterns in streaming data. Pre-built patterns address common business scenarios through simplified interfaces. The platform is part of Oracle's IoT Cloud Service and roadmap includes expanded machine learning and rule engine capabilities.
Raising the fetch size good or bad Sigrid KeydanaDésirée Pfister
The document discusses the results of a study on the effects of exercise on memory and thinking abilities in older adults. The study found that regular exercise can help reduce the decline in thinking abilities that often occurs with age. Older adults who exercised regularly performed better on cognitive tests and brain scans showed they had greater activity in important areas for memory and learning compared to less active peers.
Weitere ähnliche Inhalte
Ähnlich wie 12c SQL Pattern Matching wann werde ich das benutzen Andrej Pashchenko
http://www.opitz-consulting.com
Nicht immer stehen einem DBA GUI-basierte (und oftmals teure) Tools zur Verfügung, um ein Performance-Problem in der Datenbank zu analysieren. Mit den vorhandenen "Bordmitteln" der Datenbank kann man jedoch auch eine gute Diagnose stellen. Dieser Vortrag widmet sich einer Auswahl dieser Werkzeuge und legt einen Schwerpunkt auf die Möglichkeiten, die einem in der Standard Edition und ohne Tuning Pack zur Verfügung stehen.
Unser Experte Uwe Küchler hat beim DOAG Community Webcast am 8.4.2016 eine Auswahl von Werkzeugen vorgestellt.
--
Über uns:
Als führender Projektspezialist für ganzheitliche IT-Lösungen tragen wir zur Wertsteigerung der Organisationen unserer Kunden bei und bringen IT und Business in Einklang. Mit OPITZ CONSULTING als zuverlässigem Partner können sich unsere Kunden auf ihr Kerngeschäft konzentrieren und ihre Wettbewerbsvorteile nachhaltig absichern und ausbauen.
Besuchen Sie unsere Homepage: http://www.opitz-consulting.com
Angelika Gallwitz – IT-Tage 2015 – Statistische Auswertungen in Oracle mit S...Informatik Aktuell
Auch in Oracle12c werden Statspack und AWR Reports herangezogen, um Performance Engpässe zu erkennen und Maßnahmen zu ergreifen. Der ADDM liefert seinen Beitrag. Wie erzeuge und interpretiere ich einen Statistik-Report? Wie verändere ich Snap Level und Threshold? Anhand der Wait Events und Wait Classes wird eine Zuordnung zu den Problembereichen vorgenommen und konkrete Empfehlungen zu Tuning-Maßnahmen gegeben.
Analytics meets Big Data – R/Python auf der Hadoop/Spark-PlattformRising Media Ltd.
Big Data verändert nicht nur die Unternehmens-IT fundamental, sondern auch die Arbeit des Analysten. Die klassischen Analysten sehen sich im Zuge des Wandels zu einer datengetriebenen Unternehmenskultur mit neuen Anforderungen und ungewohnten technologischen Plattformen konfrontiert. Sie müssen als Data Scientist fachliche Fragestellungen unter dem Aspekt der Big Data-Technologien umsetzen, visualisieren und aus den Daten Werte generieren. Anhand eines konkreten Use Cases, der Programmierung eines Recommender-Systems, zeigen wir Ansätze, wie sich die gewohnten Vorgehensweisen und Werkzeuge eines Analysten (namentlich R und Python) mit einer Big Data-Technologie (Spark) kombinieren lassen. Ziel ist es, dem Analysten den Einstieg in die Big Data-Welt zu erleichtern. Wir demonstrieren die Arbeit mit diesem Toolset an anschaulichen Beispielen in einem interaktiven Workshop-Format und laden zur Diskussion und Nachahmung dieser Vorgehensweise ein. Der Workshop richtet sich an Teilnehmer mit Grundkenntnissen aus den Bereichen analytische Methoden und Machine Learning sowie R oder Python. Der Workshop wird auf der Spark-Plattform durchgeführt. Zu Spark werden keine Kenntnisse vorausgesetzt.
Mit Performance-Modellierung Test- und Betriebskosten senkenDynatrace
In diesem Webinar, zeigt Herr Andreas Brunnert, Performance Consultant bei RETIT, in einer Live-Demo und anhand von vier Kundenszenarien wie Performance Modellierung erfolgreich in der Praxis eingesetzt werden.
CDI (Context Dependency Injection) ermöglicht es dem Entwickler skalierbare und flexible Architekturen aufzubauen die auf einem Java(EE) Server als auch auf dem Desktop laufen. Wie aber sollten DesignPattern aufgebaut werden unter Verwendung von CDI? Was für einen Einfluss hat Java 8 auf die DesignPattern, wie wird es mit der neuen Streams API kombiniert?
Höhepunkt ist die Kombination von klassischen Reflection-Einsatzgebieten wie z.B. dynamic Proxies mit CDI und Cross-Language Injections.
Einige ausgewählte Oracle PL/SQL Packages aus Version 11g und 12c werden kurz beschrieben und illustriert an Beispielen. In Teil 3 handelt es sich dabei um:
DBMS_XPLAN
DBMS_ASSERT
DBMS_RESUMABLE
DBMS_UTILITY
Forms and Reports 12c - Processes and Automation in Development and OperationsTorsten Kleiber
The current target architecture of IKB's credit and loan management is based on Oracle ADF and SOA and of course the database. But how can you protect in this time your Oracle Forms & Reports longtime investments, can you support their Development Lifecycle by Automation?
Many supporting technologies from the Java environment, such as branching models, automated build and deploy procedures or code review were established with the Oracle technologies and in the course of the regulatory process.
But there is still a large part of the Oracle Forms & Reports that have grown over 25 years and have not yet been replaced. Actually, we hoped that we would no longer need a version higher than 11g. Forms & Reports had been running very stably for years. A bug brought the migration to 12c back into focus to further run supported versions. The regulatory environment did the rest to revise the current processes and, where possible, to automate them.
So how do supporting technologies and automation fit in here?
I will show you a selection of these processes from IKB's development and operations life cycle:
* Installation of application server
* Regular patching
* Packaging of the local development environment
* Requirements documentation
* Branching
* Development
* Code Review
* Merge
* Deployment
* Traceability for Regulatory Purposes
The following tools are used, among others
* Jenkins
* Scripting with Bash and Powershell
* Git
* Bitbucket
* JIRA
* FormsAPI Master
racle 11g verspricht interessante Neuerungen. Rund vierhundert neue Features haben die Entwickler aus Redwood Shores im neuesten Release implementiert.
Der Hersteller hebt Erleichterungen für Datenbankadministratoren und Verbesserungen der Datenverwaltung hervor. So lassen sich Aktualisierungen der Serversoftware im laufenden Betrieb einspielen. Hochverfügbare Standby-Systeme können nun standardmäßig für ein Reporting genutzt werden. Automatic Storage Management, eine Art integrierter Volume Manager, unterstützt bei der Datenspeicherung. Nicht zu vergessen: Flashback Data Archive erlaubt eine automatische Historisierung von Daten - und das ohne Aufwände für zusätzliche Eigenentwicklungen. Der "Partition Advisor" schlägt geeignete Partitionen für Datentabellen vor; wahlweise kann er diese Zerlegungen auch automatisch durchführen. Mit Real Application Testing können Transaktionen aufgezeichnet und für Lasttests genutzt werden.
Die Liste ließe sich nahezu endlos fortführen. Doch welche der Neuerungen sind tatsächlich sinnvoll und nützlich? Lohnt sich der Wechsel? Welche Migrationspfade gibt es?
Übersicht der wichtigsten Neuerungen in Oracle DB 11g
Was bringen die "New Features" wirklich?
Wie stabil ist das neueste Release?
Welche Migrationspfade gibt es?
In Oracle 18c, SQL and PL/SQL work even more closely together. A good example are the Polymorphic Table Functions (PTF). With PTF, which are part of the ANSI SQL 2016 standard, you get a powerful and flexible tool to extend existing analytical capabilities of SQL. The basics of the new functionality is discussed as well as the implementation details shown by concrete examples.
Oracle Stream Explorer is a platform that allows business users to analyze streaming data sources and gain real-time insights without needing expertise in stream processing or related technologies. It connects to various data sources, enriches data using static references, and allows users to build interactive explorations using visual tools for filtering, correlating, aggregating and detecting patterns in streaming data. Pre-built patterns address common business scenarios through simplified interfaces. The platform is part of Oracle's IoT Cloud Service and roadmap includes expanded machine learning and rule engine capabilities.
Raising the fetch size good or bad Sigrid KeydanaDésirée Pfister
The document discusses the results of a study on the effects of exercise on memory and thinking abilities in older adults. The study found that regular exercise can help reduce the decline in thinking abilities that often occurs with age. Older adults who exercised regularly performed better on cognitive tests and brain scans showed they had greater activity in important areas for memory and learning compared to less active peers.
Oracle Database In_Memory Christian AntogniniDésirée Pfister
Christian Antognini presented on Oracle Database In-Memory at the 2015 DOAG conference in Nuremberg, Germany. He is a senior principal consultant, trainer, and partner at Trivadis, where he focuses on getting the most out of Oracle Database through logical and physical design, query optimization, and application performance management. The presentation provided an overview of Oracle Database In-Memory architecture, demonstrated its performance improvements through various scripts and videos, and noted that while speed ups can be significant, some scenarios may see reduced performance and there are limiting factors to consider.
This document provides an overview of key considerations for configuring and optimizing an Oracle SOA and OSB environment. It discusses recommendations for installing patches, configuring WebLogic domains, setting up OSB and SOA clusters, tuning SOA schemas, and other best practices to ensure high performance and scalability. Specific topics covered include JVM tuning, connection pooling, caching strategies, load balancing, and database purging techniques.
The document discusses traditional architectures for IoT solutions and whether they are sufficient. It tells a story of a customer who needed to add notification capabilities to their existing system but found it did not fit well with their legacy technologies. Several integration approaches are described, with the conclusion being that events should be treated as first-class citizens accessible via an event bus or hub. This better addresses the challenges of connecting devices, analyzing IoT data, and integrating IoT with other systems. The document also outlines key components of an IoT architecture including connectivity, analytics, and integration points.
Zero Data Loss Recovery Appliance a good investment! Konrad HäfeliDésirée Pfister
This document discusses the Zero Data Loss Recovery Appliance (ZDLRA) from Oracle. It begins with an introduction to Trivadis, the company presenting on the ZDLRA. It then provides an overview of the ZDLRA's functionality including eliminating data loss through real-time redo transport, database-level recoverability, minimal impact backups, and scale-out architecture. The document also discusses configuration, implementation, pricing and licensing, and answers common evaluation questions about when the ZDLRA makes sense compared to other data protection solutions from Oracle.
Haben Sie Ihre Web Logic Umgebung im Griff Daniel JorayDésirée Pfister
Trivadis is a leading IT consulting firm in Switzerland and Germany with over 600 employees. The document discusses monitoring a WebLogic application environment, focusing on key metrics for the main components: JVM memory and threads, JDBC data sources, JMS, applications, and log files. Monitoring is important to ensure components are running properly and applications perform optimally.
The document discusses database locks from a theoretical and practical perspective. It begins with an overview of relational database concepts like referential integrity, consistency and concurrency. It then describes different types of locks used in databases like row locks, table locks, DDL locks, and system locks. It provides examples of how each lock type works and what operations they allow. The document also discusses how locks relate to foreign key constraints and how to analyze lock situations using Oracle data dictionary views. It emphasizes that locks are needed to maintain database functionality and consistency.
12c SQL Pattern Matching wann werde ich das benutzen Andrej Pashchenko
1. BASEL BERN BRUGG DÜSSELDORF FRANKFURT A.M. FREIBURG I.BR. GENF
HAMBURG KOPENHAGEN LAUSANNE MÜNCHEN STUTTGART WIEN ZÜRICH
12c SQL Pattern Matching –
wann werde ich das benutzen?
Andrej Pashchenko
Senior Consultant
Trivadis GmbH
2. Unser Unternehmen.
12c SQL Pattern Matching – wann werde ich das benutzen?2 19.11.2015
Trivadis ist führend bei der IT-Beratung, der Systemintegration, dem Solution
Engineering und der Erbringung von IT-Services mit Fokussierung auf -
und -Technologien in der Schweiz, Deutschland, Österreich und
Dänemark. Trivadis erbringt ihre Leistungen aus den strategischen Geschäftsfeldern:
Trivadis Services übernimmt den korrespondierenden Betrieb Ihrer IT Systeme.
B E T R I E B
3. Unser Unternehmen.
12c SQL Pattern Matching – wann werde ich das benutzen?2 19.11.2015
Trivadis ist führend bei der IT-Beratung, der Systemintegration, dem Solution
Engineering und der Erbringung von IT-Services mit Fokussierung auf -
und -Technologien in der Schweiz, Deutschland, Österreich und
Dänemark. Trivadis erbringt ihre Leistungen aus den strategischen Geschäftsfeldern:
Trivadis Services übernimmt den korrespondierenden Betrieb Ihrer IT Systeme.
B E T R I E B
4. Unser Unternehmen.
12c SQL Pattern Matching – wann werde ich das benutzen?2 19.11.2015
Trivadis ist führend bei der IT-Beratung, der Systemintegration, dem Solution
Engineering und der Erbringung von IT-Services mit Fokussierung auf -
und -Technologien in der Schweiz, Deutschland, Österreich und
Dänemark. Trivadis erbringt ihre Leistungen aus den strategischen Geschäftsfeldern:
Trivadis Services übernimmt den korrespondierenden Betrieb Ihrer IT Systeme.
B E T R I E B
5. Unser Unternehmen.
12c SQL Pattern Matching – wann werde ich das benutzen?2 19.11.2015
Trivadis ist führend bei der IT-Beratung, der Systemintegration, dem Solution
Engineering und der Erbringung von IT-Services mit Fokussierung auf -
und -Technologien in der Schweiz, Deutschland, Österreich und
Dänemark. Trivadis erbringt ihre Leistungen aus den strategischen Geschäftsfeldern:
Trivadis Services übernimmt den korrespondierenden Betrieb Ihrer IT Systeme.
B E T R I E B
6. 12c SQL Pattern Matching – wann werde ich das benutzen?6 19.11.2015
Introduction
7. Introduction
12c SQL Pattern Matching – wann werde ich das benutzen?7 19.11.2015
Analytic
functions
Analytic
functions
enhancements
SQL Model
Clause
LISTAGG
NTH_VALUE
PIVOT/UNPIVOT
clause
Pattern
Matching
Top-N
8. Introduction
Oracle 12c database supports SQL Pattern Matching with the new
clause - MATCH_RECOGNIZE
pattern matching in a sequences of rows
nothing to do with string patterns (PL/SQL REGEXP_...
functions)
it‘s a clause, not a function
after the table name in FROM clause
patterns are expressed with regular expression syntax over
pattern variables
pattern variables are defined as SQL expressions
19.11.2015 12c SQL Pattern Matching – wann werde ich das benutzen?8
9. Introduction
19.11.2015 12c SQL Pattern Matching – wann werde ich das benutzen?9
MATCH_RECOGNIZE
( [ PARTITION BY <cols> ]
[ ORDER BY <cols> ]
[ MEASURES <cols> ]
[ ONE ROW PER MATCH | ALL ROWS PER MATCH ]
[ SKIP_TO <option> ]
PATTERN ( <row pattern> )
[ SUBSET <subset list> ]
DEFINE <definition list> )
10. Introduction
Example: Find Mappings in the ETL logging table, which were
increasingly faster over a period of four days. Output: start and end dates
of the period, elapsed time at the beginning and the end of the period,
average elapsed time.
19.11.2015 12c SQL Pattern Matching – wann werde ich das benutzen?10
12. Introduction
12c SQL Pattern Matching – wann werde ich das benutzen?12
SELECT *
FROM dwh_etl_runs MATCH_RECOGNIZE (
PARTITION BY mapping_name
ORDER BY etl_date
MEASURES FIRST (etl_date) AS start_date
, LAST (etl_date) AS end_date
, FIRST (elapsed) AS first_elapsed
, LAST (elapsed) AS last_elapsed
, AVG(elapsed) AS avg_elapsed
PATTERN (STRT DOWN{3})
DEFINE DOWN AS elapsed < PREV(elapsed) )
As for analytic functions:
partition and order
Define measures, which are
accessible in the main query
Define search pattern with
regular expression over boolean
pattern variables
Define pattern variables
Navigation operators:
PREV, NEXT – physical offset
FIRST, LAST – logical offset
19.11.2015
13. Introduction
12c SQL Pattern Matching – wann werde ich das benutzen?13
PATTERN: Subset of Perl syntax for regular expressions
– * — 0 or more iterations
– + — 1 or more iterations
– ? — 0 or 1 iterations
– {n} — n iterations (n > 0)
– {n,} — n or more iterations (n >= 0)
– {n,m} — between n and m (inclusive) iterations (0 <= n <= m, 0 < m)
– {,m} — between 0 and m (inclusive) iterations (m > 0)
– ( ) – Grouping
– | – Alternation
– {- … -} – Exclusion
– ^ - before the first row in the Partition
– $ - after the last row in the partition
– ? – “reluctant” vs. “greedy”
– ….
19.11.2015
14. Introduction
12c SQL Pattern Matching – wann werde ich das benutzen?14
Patterns are everywhere
Financial
Telcos
Retail Traffic
Automotive
Transport /
Logistics
Fraud Detection
Quality of Service
Trouble Ticketing
Price Trends
Buying Patterns
Stock Market Money
Laundering
Money
Laundering
Sensor Data
Network Activity
Advertising
Campaigns
Sessionization
Frequent Flyer
Programms
Process Chain
CRM
19.11.2015
15. Introduction
12c SQL Pattern Matching – wann werde ich das benutzen?15
SQL had no efficient way to handle such questions
pre 12c solutions
self-joins, subqueries (NOT) IN, (NOT) EXISTS
switch to PL/SQL - „Do it yourself“, often multiple SQL queries
transfer some logic to pipelined functions and integrate them in
the main query
analytic (window) functions
– ORA-30483: window functions are not allowed here
– not possible to use in WHERE clause
– not possible to nest them
– unable to access the output of analytic functions in other rows
– often leads to nesting queries, self-joins, etc.
19.11.2015
16. Agenda
12c SQL Pattern Matching – wann werde ich das benutzen?16 19.11.2015
1. Introduction
2. Find consecutive ranges and gaps
3. Trouble Ticket roundtrip
4. Grouping on fuzzy criteria
5. Merge temporal intervals
17. 12c SQL Pattern Matching – wann werde ich das benutzen?17 19.11.2015
Find consecutive ranges and gaps
18. Find Consecutive Ranges / Gaps
12c SQL Pattern Matching – wann werde ich das benutzen?18
SLA, QoS: find the longest period without outage
Table T_GAPS
Find consecutive ranges in the values of column ID
Output: Start- and End-ID of consecutive range
ID
1
2
3
5
6
10
11
12
14
20
21
…
mr_consecutive.sql
Start of Range End of Range
1 3
5 6
10 12
19.11.2015
19. Find Consecutive Ranges / Gaps
12c SQL Pattern Matching – wann werde ich das benutzen?19
Pre 12c solution using analytic functionsID
1
2
3
5
6
10
11
12
14
20
21
…
WITH groups_marked AS (
SELECT id
, CASE
WHEN id != LAG(id,1,id) OVER(ORDER BY id) + 1 THEN 1
ELSE 0
END new_grp
FROM t_gaps)
, sum_grp AS (
SELECT id, SUM(new_grp) OVER(ORDER BY id) grp_sum
FROM groups_marked )
SELECT MIN(id) start_of_range
, MAX(id) end_of_range
FROM sum_grp
GROUP BY grp_sum
ORDER BY grp_sum;
mr_consecutive.sql
19.11.2015
20. Find Consecutive Ranges / Gaps
12c SQL Pattern Matching – wann werde ich das benutzen?20
„Tabibitosan“- method*
* - https://community.oracle.com/message/3991177#3991177
ID
1
2
3
5
6
10
11
12
14
20
21
…
SELECT MIN(id) start_of_range
, MAX(id) end_of_range
FROM (SELECT id
, id - ROW_NUMBER() OVER(ORDER BY id) distance
FROM t_gaps)
GROUP BY distance
ORDER BY distance;
mr_consecutive.sql
19.11.2015
21. Find Consecutive Ranges / Gaps
12c SQL Pattern Matching – wann werde ich das benutzen?21
12c solution with MATCH_RECOGINZEID
1
2
3
5
6
10
11
12
14
20
21
…
SELECT *
FROM t_gaps MATCH_RECOGNIZE (
ORDER BY id
MEASURES FIRST(id) start_of_range
, LAST(id) end_of_range
, COUNT(*) cnt
ONE ROW PER MATCH
PATTERN (strt cont*)
DEFINE cont AS id = PREV(id)+1
);
mr_consecutive.sql
19.11.2015
22. Find Consecutive Ranges / Gaps
12c SQL Pattern Matching – wann werde ich das benutzen?22
Table T_GAPS, numeric column ID with gaps
Find the gaps in the values of column ID
Output: start- and end-ID of the gap
ID
1
2
3
5
6
10
11
12
14
20
21
…
mr_gaps.sql
Start of Gap End of Gap
4 4
7 9
13 13
15 19
19.11.2015
23. Find Consecutive Ranges / Gaps
12c SQL Pattern Matching – wann werde ich das benutzen?23
Solution with analytic functions
„Tabibitosan“-method*
* - https://community.oracle.com/message/3991177#3991177
ID
1
2
3
5
6
10
11
12
14
20
21
…
mr_gaps.sql
SELECT start_of_gap, end_of_gap
FROM ( SELECT id + 1 start_of_gap
, LEAD(id) OVER(ORDER BY id) - 1 end_of_gap
, CASE
WHEN id + 1 != LEAD(id) OVER(ORDER BY id) THEN 1
ELSE 0
END is_gap
FROM t_gaps)
WHERE is_gap = 1;
SELECT MAX(id) + 1 start_of_gap
, LEAD(MIN(id)) OVER (ORDER BY distance) -1 end_of_gap
FROM (SELECT id
, id - ROW_NUMBER() OVER(ORDER BY id) distance
FROM t_gaps)
GROUP BY distance;
19.11.2015
24. Find Consecutive Ranges / Gaps
12c SQL Pattern Matching – wann werde ich das benutzen?24
12c solution with MATCH_RECOGINZEID
1
2
3
5
6
10
11
12
14
20
21
…
mr_gaps.sql
SELECT *
FROM t_gaps MATCH_RECOGNIZE (
ORDER BY id
MEASURES PREV(gap.id)+1 start_of_gap
, gap.id - 1 end_of_gap
ONE ROW PER MATCH
PATTERN (strt gap+)
DEFINE gap AS id != PREV(id)+1
);
19.11.2015
25. Agenda
12c SQL Pattern Matching – wann werde ich das benutzen?25 19.11.2015
1. Introduction
2. Find consecutive ranges and gaps
3. Trouble Ticket roundtrip
4. Grouping on fuzzy criteria
5. Merge temporal intervals
26. 12c SQL Pattern Matching – wann werde ich das benutzen?26 19.11.2015
Trouble Ticket roundtrip
27. Trouble Ticket Roundtrip
12c SQL Pattern Matching – wann werde ich das benutzen?27
SCOTT
ADAMS
KING
ID Assignee Datum
1 SCOTT 01.02.2015
1 SCOTT 02.02.2015
1 ADAMS 03.02.2015
1 SCOTT 04.02.2015
2 ADAMS 01.02.2015
2 ADAMS 02.02.2015
2 SCOTT 03.02.2015
3 KING 01.02.2015
3 ADAMS 02.02.2015
3 ADAMS 03.02.2015
3 KING 04.02.2015
3 ADAMS 05.02.2015
4 KING 01.02.2015
4 ADAMS 02.02.2015
4 SCOTT 03.02.2015
4 KING 05.02.2015
Find the tickets, which went
again to the same assignee
19.11.2015
28. KOPENHAGEN
MÜNCHEN
LAUSANNE
BERN
ZÜRICH
BRUGG
GENF
HAMBURG
DÜSSELDORF
FRANKFURT
STUTTGART
FREIBURG
BASEL
WIEN
Mit über 600 IT- und Fachexperten bei Ihnen vor Ort.
12c SQL Pattern Matching – wann werde ich das benutzen?3 19.11.2015
14 Trivadis Niederlassungen mit
über 600 Mitarbeitenden.
Über 200 Service Level Agreements.
Mehr als 4'000 Trainingsteilnehmer.
Forschungs- und Entwicklungsbudget:
CHF 5.0 Mio.
Finanziell unabhängig und
nachhaltig profitabel.
Erfahrung aus mehr als 1'900 Projekten
pro Jahr bei über 800 Kunden.
29. KOPENHAGEN
MÜNCHEN
LAUSANNE
BERN
ZÜRICH
BRUGG
GENF
HAMBURG
DÜSSELDORF
FRANKFURT
STUTTGART
FREIBURG
BASEL
WIEN
Mit über 600 IT- und Fachexperten bei Ihnen vor Ort.
12c SQL Pattern Matching – wann werde ich das benutzen?3 19.11.2015
14 Trivadis Niederlassungen mit
über 600 Mitarbeitenden.
Über 200 Service Level Agreements.
Mehr als 4'000 Trainingsteilnehmer.
Forschungs- und Entwicklungsbudget:
CHF 5.0 Mio.
Finanziell unabhängig und
nachhaltig profitabel.
Erfahrung aus mehr als 1'900 Projekten
pro Jahr bei über 800 Kunden.
30. Agenda
12c SQL Pattern Matching – wann werde ich das benutzen?30 19.11.2015
1. Introduction
2. Find consecutive ranges and gaps
3. Trouble Ticket roundtrip
4. Grouping on fuzzy criteria
5. Merge temporal intervals
31. 12c SQL Pattern Matching – wann werde ich das benutzen?31 19.11.2015
Grouping on fuzzy criteria
32. Grouping over fuzzy criteria
12c SQL Pattern Matching – wann werde ich das benutzen?32
„Sessionization“
– Group rows together where the gap between the timestamps is less
than defined
...
PATTERN (STRT SESS+)
DEFINE SESS AS SESS.ins_date – PREV(SESS.ins_date)<= 10/24/60
– Group rows together that are within a defined interval relatively to the
first row, otherwise start next group
https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID
:13946369553642#3478381500346951056
...
PATTERN (A+)
DEFINE A AS ins_date < FIRST(ins_date) + 6/24
Group over running totals
– Split the data into the groups of defined capacity
19.11.2015
33. Grouping over fuzzy criteria
12c SQL Pattern Matching – wann werde ich das benutzen?33
Example-Schema SH (Sales History)
Task: split the data into the group of fixed
capacity
Fit all customers ordered by age into
groups providing that total sales in every
group < 200 000$
19.11.2015
34. Grouping over fuzzy criteria
12c SQL Pattern Matching – wann werde ich das benutzen?34
12c solution with MATCH_RECOGINZE clause
mr_group_running_total.sql
WITH q AS (SELECT c.cust_id, c.cust_year_of_birth
, SUM(s.amount_sold) cust_amount_sold
FROM customers c JOIN sales s ON s.cust_id = c.cust_id
GROUP BY c.cust_id, c.cust_year_of_birth
)
SELECT *
FROM q
MATCH_RECOGNIZE(
ORDER BY cust_year_of_birth
MEASURES MATCH_NUMBER() gruppe
, SUM(cust_amount_sold) running_sum
, FINAL SUM(cust_amount_sold) final_sum
ALL ROWS PER MATCH
PATTERN (gr*)
DEFINE gr AS SUM(cust_amount_sold)<=200000
);
We need all matches
Aggregate function in
pattern variable‘s condition
function returns the macth
number
Aggregates in MEASURES:
Running vs. Final
19.11.2015
35. Agenda
12c SQL Pattern Matching – wann werde ich das benutzen?35 19.11.2015
1. Introduction
2. Find consecutive ranges and gaps
3. Trouble Ticket roundtrip
4. Grouping on fuzzy criteria
5. Merge temporal intervals
36. 12c SQL Pattern Matching – wann werde ich das benutzen?36 19.11.2015
Merge temporal intervals
37. Merge temporal intervals
12c SQL Pattern Matching – wann werde ich das benutzen?37
Temporal version of SCOTT-Schema: the data in EMP, DEPT and
JOB have temporal validity (VALID_FROM - VALID_TO)
19.11.2015
38. Merge temporal intervals
12c SQL Pattern Matching – wann werde ich das benutzen?38
Task: Query the data for one employee joining four tables with
respect of temporal validity:
19.11.2015
39. Merge temporal intervals
12c SQL Pattern Matching – wann werde ich das benutzen?39
WITH joined AS (
SELECT e.empno,
g.valid_from,
LEAST( e.valid_to, d.valid_to, j.valid_to,
NVL(m.valid_to, e.valid_to),
LEAD(g.valid_from - 1, 1, e.valid_to) OVER(
PARTITION BY e.empno ORDER BY g.valid_from )
) AS valid_to,
e.ename, j.job, e.mgr, m.ename AS mgr_ename, e.hiredate,
e.sal, e.comm, e.deptno, d.dname
FROM empv e
INNER JOIN (SELECT valid_from FROM empv
UNION
SELECT valid_from FROM deptv
UNION
SELECT valid_from FROM jobv
UNION
SELECT valid_to + 1 FROM empv
WHERE valid_to != DATE '9999-12-31'
UNION
SELECT valid_to + 1 FROM deptv
WHERE valid_to != DATE '9999-12-31'
UNION
SELECT valid_to + 1 FROM jobv
WHERE valid_to != DATE '9999-12-31') g
ON g.valid_from BETWEEN e.valid_from AND e.valid_to
INNER JOIN deptv d
ON d.deptno = e.deptno AND g.valid_from BETWEEN d.valid_from AND d.valid_to
INNER JOIN jobv j
ON j.jobno = e.jobno AND g.valid_from BETWEEN j.valid_from AND j.valid_to
LEFT JOIN empv m
ON m.empno = e.mgr AND g.valid_from BETWEEN m.valid_from AND m.valid_to )
...
Quelle: Philipp Salvisberg:
http://www.salvis.com/blog/2012/12/28/joining-temporal-intervals-part-2/
19.11.2015
40. Merge temporal intervals
12c SQL Pattern Matching – wann werde ich das benutzen?40
...
SELECT empno, valid_from, valid_to, ename, job, mgr,
mgr_ename, hiredate, sal, comm, deptno, dname
FROM joined
MATCH_RECOGNIZE (
PARTITION BY empno, ename, job, mgr,
mgr_ename, hiredate, sal, comm,
deptno, dname
ORDER BY valid_from
MEASURES FIRST(valid_from) valid_from,
LAST(valid_to) valid_to
PATTERN ( strt nxt* )
DEFINE nxt as valid_from = prev(valid_to) + 1
)
WHERE empno = 7788;
19.11.2015
41. Conclusion
12c SQL Pattern Matching – wann werde ich das benutzen?41
Very powerful feature
Significantly simplifies a lot of queries (self-joins, semi-, anti-joins, nested queries),
mostly with performance benefit
Since 2007 a proposal for ANSI-SQL
Requires thinking in patterns
Complicated syntax (at first sight )
But in many cases the code looks like the requirement in „plain English“
19.11.2015
42. Further information...
12c SQL Pattern Matching – wann werde ich das benutzen?42
Database Data Warehousing Guide - SQL for Pattern Matching -
http://docs.oracle.com/database/121/DWHSG/pattern.htm#DWHSG8956
Stewart Ashton‘s Blog - https://stewashton.wordpress.com
Oracle Whitepaper - Patterns everywhere - Find them Fast! -
http://www.oracle.com/ocom/groups/public/@otn/documents/webcontent/1965433.pdf
19.11.2015
43. 12c SQL Pattern Matching – wann werde ich das benutzen?43 19.11.2015
Trivadis an der DOAG 2015
Ebene 3 - gleich neben der Rolltreppe
Wir freuen uns auf Ihren Besuch.
Denn mit Trivadis gewinnen Sie immer.