Sei sulla pagina 1di 70

SAP Hana

...

Slide 2 2011 ALFATEC Group d.o.o.
SAP HANA

Slide 3 2011 ALFATEC Group d.o.o.
How did HANA evolve?








Slide 4 2011 ALFATEC Group d.o.o.
A Shift of Frontiers in Computer Science

Tape is Dead
Disk is Tape
Main Memory is Disk
CPU Cache is Main Memory




Slide 5 2011 ALFATEC Group d.o.o.
What is SAP HANA?

SAP HANA is an in-memory data platform, at its core, it is an innovative in-
memory relational database management system that makes full use of the
capabilities of current hardware to increase application performance.

SAP HANA runs on multi-core CPUs with fast communication between
processor cores, and containing terabytes of main memory.

With SAP HANA, all data is available in main memory, which avoids the
performance penalty of disk I/O.

Either disk or solid-state drives are still required for permanent persistency
in the event of a power failure or some other catastrophe.

This does not slow down performance, however, because the required
backup operations to disk can take place asynchronously as a background
task.

Slide 6 2011 ALFATEC Group d.o.o.
In-Memory Computing Engine and Surroundings

Slide 7 2011 ALFATEC Group d.o.o.
What is SAP HANA appliance?

SAP HANA appliance is a
flexible,
multi-purpose,
data-source agonistic in-memory appliance that combines SAP software
components optimized on hardware provided, and delivered, by SAPs leading
hardware partners such as
Dell,
Cisco,
IBM,
HP,
Fujitsu, and
Intel and
Alfatec Group .

It includes a number of integrated SAP software components including the
SAP HANA database,
real-time replication services,
data services,
data and
lifecycle management,
support for multiple interfaces based on industry standards and easy to use data
modeling tool called SAP HANA studio.

Slide 8 2011 ALFATEC Group d.o.o.
HANA Combines Software and Hardware




In-Memory Computing Engine (Software)





+



Pre-Installed Systems (Hardware)

Slide 9 2011 ALFATEC Group d.o.o.
What is SAP HANA?

Slide 10 2011 ALFATEC Group d.o.o.
SAP In-Memory Appliance (SAP HANA)

SAP HANA

In-Memory software +
hardware (HP, IBM, Fujitsu, Cisco, Dell)

Data Modeling and Data Management

Real-time Data Replication

SAP BusinessObjects Data Services
for ETL capabilities from
SAP Business Suite,
SAP NetWeaver Business Warehouse
(SAP NetWeaver BW),
and 3rd Party Systems

Slide 11 2011 ALFATEC Group d.o.o.
HANA on BOBJ - Across entire BI Suite
Business Objects is the only supported
BI tool certificated on HANA

4.0 fully supports HANA
including SAP Explorer on HANA
and SAP Analysis Clients

3.1 SP4 supports HANA as a
Universe source and direct
connections with Crystal Reports



Slide 12 2011 ALFATEC Group d.o.o.
SAP Analysis Office on HANA

Slide 13 2011 ALFATEC Group d.o.o.
SAP HANA System Landscape

Slide 14 2011 ALFATEC Group d.o.o.
SAP HANA Architecture

Slide 15 2011 ALFATEC Group d.o.o.
Business Intelligence Clients and SAP HANA

Slide 16 2011 ALFATEC Group d.o.o.
How do I acquire data into Hana?

SAP BusinessObjects Data Services and SAP HANA

LT Replication Concept: Trigger-Based Approach
Landscape Transformation - Replication Server for SAP HANA

Slide 17 2011 ALFATEC Group d.o.o.
SAP BusinessObjects Data Services and SAP HANA

Data Services is the engine to load all data into HANA

The HANA Modeler will generate initial loading jobs
Modeler will use Data Services to browse and import external metadata
Modeler will generate initial flows to load data into HANA tables
Further modifications to flows done via Data Services Designer

SAP Business Objects Data Services (DS) is positioned for batch load-based data replication
from non-SAP sources and SAP sources (with complex ETL requirements)
-> Mainly recommended for batch type data replication business scenarios



Slide 18 2011 ALFATEC Group d.o.o.
SAP LT Replication Server for SAP HANA

The SAP Landscape Transformation (LT) Replication Server is the SAP technology
that allows you to load and replicate data in real-time from SAP source systems and
non-SAP source systems to an SAP HANA environment

The SAP LT Replication Server uses a trigger-based replication approach to pass
data from the source system to the target system.

The SAP LT Replication Server can be installed either as a separate SAP system, or
if the technical prerequisites permit, on an SAP source system.


Slide 19 2011 ALFATEC Group d.o.o.
LT Replication Concept: Trigger-Based Approach

Slide 20 2011 ALFATEC Group d.o.o.
In-Memory Relational Engines Data Storage
A database table is conceptually a two-dimensional data structure organized in rows
and columns. Computer memory, in contrast, is organized as a linear structure.

A table can be represented in row-order or column-order.

A row-oriented organization stores a table as a sequence of records.

Conversely, in column storage the entries of a column are stored in contiguous
memory locations.

SAP HANA supports both, but is particularly optimized for column-order storage.


Slide 21 2011 ALFATEC Group d.o.o.
In-Memory Relational Engines

Slide 22 2011 ALFATEC Group d.o.o.
Row Store

Row Store - One of the relational engines

Interfaced from calculation / execution layer
Pure in-memory store
Persistence managed in persistence layer


Slide 23 2011 ALFATEC Group d.o.o.
Indexes for Row Store Tables

Each row-store table has a primary index
Primary index maps ROW ID primary key of table
ROW ID: a number specifying for each record its memory segment
and page

Secondary indexes can be created if needed

Persistence of indexes in row store
Indexes in row store only exist in memory

No persistence of index data

Index definition stored with table metadata

Indexes filled on-the-fly when system loads tables into memory on
system start-up

Slide 24 2011 ALFATEC Group d.o.o.
Column Store

Column Store - One of the relational engines
Interfaced from calculation / execution layer
Pure in-memory store
Persistence managed in persistence layer

Optimized for high performance of read operation
Good performance of write operations
Efficient data compression

Slide 25 2011 ALFATEC Group d.o.o.
Column Store Delta Management

Delta Merge Operation
Purpose
To move changes in delta storage into the compressed and read optimized
main storage

Characteristics
Happens asynchronously

Even during merge operation the columnar table will be still available for read
and write operations

To fulfil this requirement, a second delta and main storage are used internally

Slide 26 2011 ALFATEC Group d.o.o.
Persistence Layer
Why Does An In-memory Database Need A Persistence Layer?
Main Memory is volatile. What happens upon
Database restart?
Power outage?
...
Data needs to be stored in a non-volatile way

Backup and restore

SAP in-memory computing engine offers one persistence layer which is
used by row store and column store

Regular savepoints
full persisted image of DB at time of savepoint

Logs capturing all DB transactions since last savepoint (redo logs and undo logs
written)
restore DB from latest savepoint onwards

Ability to create "snapshots
used for backups

Slide 27 2011 ALFATEC Group d.o.o.
Row Store vs. Column Store - When to Use Which Store
Modeling Only Possible For Column Tables
This answers the frequently asked question:
"Where should I put a table row store or column store?

Information Modeler only works with column tables
Replication server creates tables in column store per default
Data Services creates tables in column store per default
SQL to create column table: "CREATE COLUMN TABLE ...
Store can be changed with "ALTER TABLE

System Tables Are Created Where They Fit Best
Administrative tables in row store:
Schema SYS - caches, administrative tables of engine
Tables from statistics server

Administrative tables in column store:
Schema _SYS_BI - metadata of created views + master data for MDX
Schema _SYS_BIC - some generated tables for MDX
Schema _SYS_REPO - e.g. lists of active/modified versions of models

Slide 28 2011 ALFATEC Group d.o.o.
SAP HANA Studio

Slide 29 2011 ALFATEC Group d.o.o.
Information Modeler Terminology
Data
Attributes descriptive data (known as Characteristics SAP BW terminology)
Measures data that can be quantified and calculated (known as key
figures in SAP BW)

Views
Attribute Views i.e. Dimensions
Analytic Views i.e. Cubes
Calculation Views similar to virtual provider with services concept in BW

Hierarchies
Leveled based on multiple attributes
Parent-child hierarchy

Analytic Privilege security object

Slide 30 2011 ALFATEC Group d.o.o.
SAP HANA Modeling Fundementals

Slide 31 2011 ALFATEC Group d.o.o.
SAP HANA Modeling Best Practices

Slide 32 2011 ALFATEC Group d.o.o.
SAP HANA Studio
Navigator View - Default Catalog

Slide 33 2011 ALFATEC Group d.o.o.
SAP HANA Studio
Navigator View - Information Models

Slide 34 2011 ALFATEC Group d.o.o.
Attribute Views

Attribute View
What is an Attribute View?
Attributes add context to data.
Attributes are modeled using Attribute Views.
Can be regarded as Master Data tables
Can be linked to fact tables in Analytical Views
A measure e.g. weight can be defined as an attribute.

Table Joins and Properties
Join Types
leftOuter, rightOuter,
fullOuter, textTable

Cardinality
1:1
N:1
1:N
Language Column

Slide 35 2011 ALFATEC Group d.o.o.
Create Attribute view
From Package:
To Create attribute view, right click on the package and choose New and then attribute view

Slide 36 2011 ALFATEC Group d.o.o.
Create Attribute view
From Quick Launch,
choose Attribute view, and then click Create button( choose the correct Package)

Slide 37 2011 ALFATEC Group d.o.o.
Create Attribute view
Choose the correct type of Attribute view required.
STANDARD : Give you empty attribute view
COPY FROM : One can easily copy from an existing attribute view
TIME will create both view and data for time attributes data month etc.
DERIVED :will create new attribute view with the existing one , but with same definition and an new name

Slide 38 2011 ALFATEC Group d.o.o.
Create Attribute view
Attribute view created. But still there is no data

Slide 39 2011 ALFATEC Group d.o.o.
Create Attribute view
Drag and Drop the fields in the DATA FOUNDATION in the Scenario TAB

Slide 40 2011 ALFATEC Group d.o.o.
Create Attribute view
Creating table joins

Slide 41 2011 ALFATEC Group d.o.o.
Create Attribute view
Creating table joins

Slide 42 2011 ALFATEC Group d.o.o.
Create Attribute view
Saving and Activating View

Slide 43 2011 ALFATEC Group d.o.o.
Analytical Views

Analytical View
An Analytical View can be regarded as a cube.

Analytical Views does not store any data.

The data is stored in column store or table
view based on the Analytical View Structure.

Star schema consist of one fact table
containing the key figures
Dimensions describe the key figures and
enrich the data
Slicing and dicing is a feature whereby users
can take out (slicing) a specific set of data
and view (dicing) the slices from different
viewpoints
Cardinality in star schemas is generally
N:1 fact to dimension
Joins in star schemas are generally
Left Outer Joins
Analytical models are highly optimized
for aggregating mass data

Slide 44 2011 ALFATEC Group d.o.o.
Analytical View: Data Preview

There are three main views one can select from when previewing data.
Raw Data table format of data
Distinct Values graphical and text format identifying unique values
Analysis select fields (attributes and measures) to display in graphical format.

Slide 45 2011 ALFATEC Group d.o.o.
Create Analytical View
Directly click on 'Analytic View' in 'Quick Launch' screen or
Right click on your package --> New ---> Analytic View.


Slide 46 2011 ALFATEC Group d.o.o.
Create Analytical View
Create an Information View

Slide 47 2011 ALFATEC Group d.o.o.
Create Analytical View
Add Tables

Slide 48 2011 ALFATEC Group d.o.o.
Create Analytical View
Add Joins

Slide 49 2011 ALFATEC Group d.o.o.
Create Analytical View
Add Output Columns

Slide 50 2011 ALFATEC Group d.o.o.
Create Analytical View
Semantics view

Slide 51 2011 ALFATEC Group d.o.o.
Create Analytical View
Dimensions, measures and aggregates

Slide 52 2011 ALFATEC Group d.o.o.
Create Analytical View
Save and validate, Save and Activate

Slide 53 2011 ALFATEC Group d.o.o.
Create Analytical View
Data preview Raw Data

Slide 54 2011 ALFATEC Group d.o.o.
Create Analytical View
Generated SQL

Slide 55 2011 ALFATEC Group d.o.o.


Slide 56 2011 ALFATEC Group d.o.o.
Calculation View

Several options available
Use the Graphical Modeler
Write SQL Script and use CE Functions
Write SQL Script and using SQL

Suggested option
= Graphical Modeler
No SQL or SQL Script knowledge
required
Built-in Union Constant support

Graphical &
SQL Script + CE Functions
Result in similar performance gains
(e.g. Field pruning, Parallelization,
join ommision)

Standard SQL
Does not provide field pruning and can
be less optimized.
Useful for POCs and rapid prototyping

Slide 57 2011 ALFATEC Group d.o.o.
Calculation View SQL vs CE Functions
Calculation Engine (CE) Functions
Preferred over SQL
Improved performance,
can be optimized by the engine (i.e. field pruning & parallelized)

Slide 58 2011 ALFATEC Group d.o.o.
Create Graphical Calculation View
New Calculation View

Slide 59 2011 ALFATEC Group d.o.o.
Create Graphical Calculation View
Select objects for Calculation

Slide 60 2011 ALFATEC Group d.o.o.
Create Graphical Calculation View
Tools

Slide 61 2011 ALFATEC Group d.o.o.
Create Graphical Calculation View
Tools - Union

Slide 62 2011 ALFATEC Group d.o.o.
Create Graphical Calculation View
Attributes, measures, hierarchies, etc ...

Slide 63 2011 ALFATEC Group d.o.o.

Slide 64 2011 ALFATEC Group d.o.o.
Application libraries


SAP HANA In-Memory Computing Engine offers various algorithms for in-
memory computing.

It provides several application libraries for developers, partners, and
customers who develop applications that run on SAP HANA.

The libraries are linked dynamically to the SAP HANA database kernel.

Slide 65 2011 ALFATEC Group d.o.o.
Business Function Library (BFL)

The Business Function Library (BFL) is one of these application libraries.

It contains pre-built parameter-driven functions in the financial area.

The functions are implemented by C++.

This library helps you develop compound business algorithms that are fully
compliant with the SAP HANA calculation engine.


Slide 66 2011 ALFATEC Group d.o.o.
Business Function Library (BFL)

The following lists some functions in the Business Function Library.


Function Description
Discounted Cash Flow Converts a future stream of cash flow to constant prices. It calculates the inflated value of today's
money.
Forecast Combines actual and forecast data to produce a rolling forecast. Eliminates scripting of feeds.
Future Calculates the closing balance of an account given the start balance and the conditions under
which the account runs.
Inflated Cash Flow Calculates the amount of cash you must receive in a future period to compensate for inflation.
... ...
... ...

Slide 67 2011 ALFATEC Group d.o.o.
Business Function Library (BFL)
Inflated Cash Flow

In order to compensate inflation, this function calculates the cash amount in a specific future period that you
need to receive.

Formula
Where, r = discount rate expressed as a decimal fraction, n = number of periods into the future

Input tables











Output tables



Name Direction Number of
Columns
Column Type Column Name Description
Prime Input Table 1 Double PRIME Prime/base value
Time Input Table 1 String TIME The periods to be calculated
Rate Input Table 1 Double RATE Discount rate
APR Input Table 1 Double APR =annual % by default = annual rate (rate=%/100)
= Periodic % = Periodic rate
Switchover Input Table 1 Double SWITCHOVER The switchover date defines the last historic
period
Switchover date Input Table 1 String SWITCOVERDATE Specify the switchover date
Name Direction Number of Columns Column Type Column Name Description
Result Output Table 1 DOUBLE RESULT Constant value

Slide 68 2011 ALFATEC Group d.o.o.
Business Function Library (BFL)
Inflated Cash Flow

Example

SET SCHEMA BFL_TEST;

DROP TABLE BFL_ICF_PRIME_TBL;
CREATE COLUMN TABLE BFL_ICF_PRIME_TBL( "PRIME" DOUBLE ) ; -- CREATE COLUMN TABLE !!!
INSERT INTO BFL_ICF_PRIME_TBL VALUES (1000) ;

DROP TABLE BFL_ICF_TIME_TBL;
CREATE COLUMN TABLE BFL_ICF_TIME_TBL( "TIME" VARCHAR(255)) ; -- CREATE COLUMN TABLE !!!
INSERT INTO BFL_ICF_TIME_TBL VALUES ('20120101') ;
INSERT INTO BFL_ICF_TIME_TBL VALUES ('20130101') ;
INSERT INTO BFL_ICF_TIME_TBL VALUES ('20140101') ;
INSERT INTO BFL_ICF_TIME_TBL VALUES ('20150101') ;

DROP TABLE BFL_ICF_RATE_TBL;
CREATE COLUMN TABLE BFL_ICF_RATE_TBL( "RATE" DOUBLE ) ;
INSERT INTO BFL_ICF_RATE_TBL VALUES (0.1) ;

DROP TABLE BFL_ICF_RESULTS_TBL ;
CREATE COLUMN TABLE BFL_ICF_RESULTS_TBL ( "RESULT" DOUBLE);

CALL _SYS_AFL.AFLBFL_INFLATEDCASHFLOW_PROC(
BFL_ICF_PRIME_TBL, BFL_ICF_TIME_TBL, BFL_ICF_RATE_TBL, BFL_ICF_APR_TBL,
BFL_ICF_SWITCHOVER_TBL, BFL_ICF_SWITCHOVERDATE_TBL,
BFL_ICF_RESULTS_TBL) WITH OVERVIEW;

SELECT * FROM BFL_ICF_RESULTS_TBL;


Slide 69 2011 ALFATEC Group d.o.o.
Predictive Analysis Library

The Predictive Analysis Library (PAL) defines functions that can be called from
within SQLScript procedures to perform analytic algorithms

This release of PAL includes classic and universal predictive analysis algorithms in seven
data-mining categories:

Clustering
Classification
Association
Time Series
Preprocessing
Social Network Analysis
Miscellaneous


The algorithms in PAL were carefully selected based on the following criteria:

The algorithms are needed for SAP HANA applications.
The algorithms are the most commonly used based on market surveys (e.g. Rexer Analytics and KDnuggets polls).
The algorithms are generally available in other database products.

Application functions are like database procedures written in C++ and called from outside to perform data intensive and
complex operations

Slide 70 2011 ALFATEC Group d.o.o.
R - statistical computing and graphics

R is an open source programming language and software environment for statistical
computing and graphics.

The R language has become very popular among statisticians and data miners for
developing statistical software and is widely used for advanced data analysis.

The goal of the integration of the SAP HANA database with R is to enable the embedding of R
code in the SAP HANA database context.

That is, the SAP HANA database allows R code to be processed in-line as part of the overall
query execution plan.

SAP does not ship the R environment with the SAP HANA database, as R is open source and is
available under the General Public License.

SAP does not provide support for R. In order to use the SAP HANA integration with R, you need
to download R from the open-source community and configure it.