Vous êtes sur la page 1sur 56

SAP HANA

- Sudha Paluru
Agenda
 Introduction
 Evolution and Architecture
 ABAP Meets SAP HANA
 Persistence Storage
 Deployment options
 Code-to-data paradigm
 Performance guidelines for ABAP Development in SAP HANA
 Open SQL enhancements
 Considerations for Custom ABAP Code During a Migration to SAP HANA
 Required and Recommended Adaptions

 Tools and Prerequisites


 FAQs
Introduction

 SAP HANA is a combination of HANA Database, Data Modelling, HANA Administration and Data Provisioning in single suite.

 HANA - High-Performance Analytic Appliance or Hasso’s New Architecture.

 SAP HANA is an in-memory, column-oriented, relational database management system developed by SAP...

 SAP HANA can be used for the purpose of OLAP (On-line Analytical) and OLTP (On-Line Transaction) on a single database.
Contd.,

• It is a combination of hardware and software made to process massive real time data using In-Memory computing.

• It combines row-based, column-based database technology.

• Data now resides in main-memory (RAM) and no longer on a hard disk.

• It’s best suited for performing real-time analytics, and developing and deploying real-time applications.

Fig.: In-memory computing security applications


Evolution and Architecture
SAP HANA Ambitions
Evolution and Architecture
Hardware Technology Innovations
Evolution and Architecture
Software Technology Innovations
Contd..
ABAP Meets SAP HANA
Evolution of ABAP for SAP HANA
Scenarios

• Main car scenario - It means removing


existing DB & replacing with HANA DB & it’s
done by using DMO (Data Migration Option)

Fig. Replacing existing DB with HANA DB

• Side car scenario - Existing Application


would be there and parallel we can use
new application

Fig. HANA DB along with existing DB


ABAP Meets SAP HANA
Highlights of SAP NetWeaver Application Server ABAP 7.4 – Overview
ABAP Meets SAP HANA: What Need to Know -
Outline

 Row Store vs. Column Store


 ABAP Dictionary Enhancements
 Data Type Systems: ABAP & SAP HANA
 Database Schemas
ABAP Meets SAP HANA: What Need to Know – Row
store
ABAP Meets SAP HANA: What Need to Know –
Column store
ABAP Meets SAP HANA: What Need to Know –
When to use Column storage?

Columnar storage is best for tables


 that are subject to column operations
on a large number of rows
 that have a large number of columns,
more unused
 that are subject to aggregations and
intensive search operations
ABAP Meets SAP HANA: What Need to Know –
When to use Row storage?

Row storage is best for tables


 that contain mainly distinct values low
compression rate
 in which most/all columns are relevant
 that are not subject to aggregation or
search operations on non-indexed columns
 that are fully buffered
 that have a small number of records
Row Vs Column store
Contd..
Contd..

Merits
• Data compression
• Aggregations, Computations, calculations.. can be done easily
• Avoid creation of Secondary index
• Avoid buffering
Demerits
• Insertion of a new record is not easier
Persistent Storage

• SAP HANA has an in-memory computing engine and access the data straightaway without any backup.

• Since it is a volatile memory, still need to use disk, here comes the concept of Persistent Storage

Fig. Detail explanation of Persistent storage


Contd..

• To avoid the risk of losing data since it a volatile, persistence layer comes as a savior and stores all the data in the hard
drive which is not volatile.

• Data is automatically saved from memory  disk at regular intervals.

Fig. Concept of Persistent storage


Deployment options

Deployment options

• On-Premise  Its completely application on ECC


• Releases – 1501, 1503, 1511 & 1610

• Cloud  On cloud platform not in ECC


• Releases – 1605 & 1702

Note:
• In release SAP HANA 1511: 15  year and 11  month
Code-to-Data paradigm
Outline

 Avoid (unnecessary) movement of larger data volume

 The Code to Data paradigm is also known as Code Pushdown.

 Only transfer Results


 Perform data-intensive calculations in the database

Classical Approach

Code to Data

Data to code

HANA Approach
Contd.,

• Code-to-data by means of

• OpenSQL & ABAP Dictionary views

• Advanced view definition

• ABAP Managed Database Procedures

• Native SQL
 Performance improvements
Code-to-Data paradigm
Performance Improvement vs. Code Adjustments
Performance guidelines for ABAP Development in SAP HANA
Contd..

Some of the basic standards to be followed are:


 SELECT * should be replaced with select with specific field names ->this was however applicable earlier for performance
tuning, but now with the column based structure, this becomes more apparent.
 While selecting data, maximum filtering of data should be done in the where clause. Earlier NE (inequality) was avoided,
but now NE filtering is also advised.
 With the columnar database, all the columns act as an index, hence no secondary index creation is required to minimize
execution time.
 Cursor statement is also not required.
 Delete after select also becomes redundant since almost all types of filtering can be done at one go.
 The SELECT statement with ‘CHECK’ should be avoided -> this was however, applicable earlier, but now more apparent.
Open SQL enhancements

OpenSQL aspires to
 Enable the application of code-to-data paradigm
 Provide (more) standard SQL features
• SELECT list enhancements
- Conditional expressions
• Expressions in
- GROUP BY clause
- HAVING clause
• JOIN statements
 Enable the consumption of SAP HANA specific features

Introduction of new features


Reduction of existing limitations
Contd..

Open SQL enhancements


 Syntax enhancements:
–> Escaping of host variables
– > Comma-separated select list
 SELECT list enhancements:
– > Arithmetical expressions
– > Literal values (next slide)
– > String expression(next slide)
– > Aggregation functions
– > Conditional Expressions
Arithmetic Expressions
• SUM, SUB, DIV, AVG,DIV, MOD, ABS,
FLOOR, CEIL
Contd..

Literal values String Expressions


• Concatenate character columns with the &&
• Can now be used in the SELECT list
operator
• Allow for a generic implementation of an existence check
Contd..

CASE Expression
Contd..
Contd..

Using vivid mathematical operators in SELECT


Contd..

Using COALESCE and Logical operators like GE / GT/ LE / LT etc in JOIN which was originally not available
Contd..

Using JOIN and COUNT / DISTINCT functions in SELECT


Contd..

Open SQL Enhancements


 Now available: RIGHT OUTER JOIN
 -ve expressions are not bad any more
 New functionality in ON conditions of JOIN statements like:
– Necessary requirement of a field of the right table in the ON
condition is dropped
– Operators like BETWEEN or “>” can be used for
comparisons
– Possibility to use fields of the right table in the WHERE
clause of LEFT OUTER JOINs
 Restriction of maximum number of tables in JOINs has been
increased to 50
Considerations for Custom ABAP Code During Migration to SAP HANA

Existing Code: Is It Still Valid?


 Detect
 Functional correctness
 Performance optimization potential
 Optimize
 Database-oriented programming
 Explore
 Use SAP HANA-specific features
 Rethink & innovate
Contd..
Required and Recommended Adaptions

Migration to SAP HANA is “just” a database migration ?


 Everything works as before, except...
– Native SQL
– Non Unicode
– DB-specific hints
– Implicit DB-specific behavior
Database migration related adaptations
• Usage of native SQL (via EXEC SQL or ADBC)
• Usage of database hints
• Access to physical table pools/clusters
• Checking for existence of indices
• perform a Unicode migration(SAP HANA only supports Unicode installations )
Considerations for Custom ABAP Code During Migration to SAP HANA

Tools and Prerequisites


Tools and Prerequisites – SQL Monitor

1. SQL Monitor
 Activate/deactivate SQL Monitor via transaction
SQLM
 SQL Monitor can be activated either for all
application servers or just selected ones
Different views on results:
 System-oriented view - analysis of the entire
system
 Request-oriented view - analysis focuses on single
request entry points (eg: SQL profile for a
transaction XYZ look like?)
Contd..

Tools SQL and Prerequisites


1. SQL Monitor - Overview
 The statistical data is aggregated using the following keys:
 Process type (e.g. transaction, report ,RFC module, HTTP request)
 Entry point (e.g. transaction VA01)
 ABAP source code location of the statement (i.e. program, include, line)
 Database table names(e.g. MARA)
 For each entry, the following statistics are available:
 Number of executions
 Execution time (maximum, minimum, average, standard deviation)
 Fetched/changed rows (maximum, minimum, average, standard deviation) Number of internal sessions that triggered the
respective SQL statement
Contd..

Scenario 1: Get an Overview of Main SQL-driven Request


Contd..

Scenario 2: Identify the Most Frequently Executed Database Accesses in (By Source code Position)

Detect the SQL statements reading or writing most of the database data in the system
Contd..

Scenario 3: Analyze individual requests for optimization(By Request)


Contd..

Working with Snapshots


Creating SQL Snapshots
• File Import, upload the monitor

recordings that have been


collected in productive system and
then exported to a local file.
• Local System as the Data Source,

the latest monitoring data of the


current system will be stored in
the snapshot.

To reduce data volume, basic filter criteria can be applied before snapshot creation
Contd..

Working with Snapshots


Selecting a Snapshot as Data Source
Tools and Prerequisites - ATC

ABAP Test Cockpit and Code Inspector in Context of HANA Migration


Possible adaptations of and corrections to ABAP custom code can generally be divided into two main areas:
1. Functional adaptations
2. SQL performance optimizations

FUNCTIONAL_DB
 Native SQL, Database (DB) hints, Finding ADBC Usages
 Finding usages of special DDIC function modules that check or return
the existence or technical properties of certain DB indexes.
Note: On SAP HANA, most DB indexes are not in use and therefore
these checks are generally obsolete.
 Finding accesses of a pool/cluster table
 Finding non-robust ABAP code w/o ORDER BY

Note: In the course of an SAP HANA migration, most pool and cluster tables are converted into transparent tables of the same name.
After this step, access to these technical pools/clusters that are no longer used does not serve any purpose.
Contd..

Not mandatory but recommended

FUNCTIONAL_DB_ADDITION
 Checking SQL Operations without a WHERE Clause,
 Checking initial table is not empty before using FOR ALL ENTRIES
PERFORMANCE_DB
 The variant contains all the essential static SQL performance checks.
 The essential tool for an overall view of the custom code with regard to performance optimization is the new SQL Monitor.
Tools and Prerequisites - SWLT

Combination of Code Check Results

The SQL Performance Tuning Worklist (transaction code SWLT) is a tool Combining the result of a code analysis with relevant
runtime data. e.g. from a productive system.
Contd..

SQL Performance Tuning Worklist o/p:


Contd..

Recommended Procedure
Frequently Asked Questions
Contd..
Other Information/Links

• https://www.sap.com/products/hana/features.html#pdf-asset=ac1e84d4-697c-0010-82c7-eda71af511fa&pdf-page=1
• http://saphanatutorial.com/sap-hana-basic-course-1-1/
• http://www.sapyard.com/sap-hana-from-space-level/
• http://www.sapyard.com/abap-on-sap-hana-part-xvi-hanatization/
• http://www.sapyard.com/abap-for-sap-hana-points-to-remember/

Vous aimerez peut-être aussi