232255230-SAP-HANA

70
SAP Hana ...

description

232255230-SAP-HANA

Transcript of 232255230-SAP-HANA

Page 1: 232255230-SAP-HANA

SAP Hana

...

Page 2: 232255230-SAP-HANA

Slide 2 © 2011 ALFATEC Group d.o.o.

SAP HANA

Page 3: 232255230-SAP-HANA

Slide 3 © 2011 ALFATEC Group d.o.o.

How did HANA evolve?

Page 4: 232255230-SAP-HANA

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

Page 5: 232255230-SAP-HANA

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.

Page 6: 232255230-SAP-HANA

Slide 6 © 2011 ALFATEC Group d.o.o.

In-Memory Computing Engine and Surroundings

Page 7: 232255230-SAP-HANA

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 SAP’s 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.

Page 8: 232255230-SAP-HANA

Slide 8 © 2011 ALFATEC Group d.o.o.

HANA Combines Software and Hardware

In-Memory Computing Engine (Software)

+

Pre-Installed Systems (Hardware)

Page 9: 232255230-SAP-HANA

Slide 9 © 2011 ALFATEC Group d.o.o.

What is SAP HANA?

Page 10: 232255230-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

Page 11: 232255230-SAP-HANA

Slide 11 © 2011 ALFATEC Group d.o.o.

HANA on BOBJ - Across entire BI SuiteBusiness 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

Page 12: 232255230-SAP-HANA

Slide 12 © 2011 ALFATEC Group d.o.o.

SAP Analysis Office on HANA

Page 13: 232255230-SAP-HANA

Slide 13 © 2011 ALFATEC Group d.o.o.

SAP HANA System Landscape

Page 14: 232255230-SAP-HANA

Slide 14 © 2011 ALFATEC Group d.o.o.

SAP HANA Architecture

Page 15: 232255230-SAP-HANA

Slide 15 © 2011 ALFATEC Group d.o.o.

Business Intelligence Clients and SAP HANA

Page 16: 232255230-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 ApproachLandscape Transformation - Replication Server for SAP HANA

Page 17: 232255230-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

Page 18: 232255230-SAP-HANA

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.

Page 19: 232255230-SAP-HANA

Slide 19 © 2011 ALFATEC Group d.o.o.

LT Replication Concept: Trigger-Based Approach

Page 20: 232255230-SAP-HANA

Slide 20 © 2011 ALFATEC Group d.o.o.

In-Memory Relational Engines – Data StorageA 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.

Page 21: 232255230-SAP-HANA

Slide 21 © 2011 ALFATEC Group d.o.o.

In-Memory Relational Engines

Page 22: 232255230-SAP-HANA

Slide 22 © 2011 ALFATEC Group d.o.o.

Row Store

Row Store - One of the relational engines

Interfaced from calculation / execution layerPure in-memory storePersistence managed in persistence layer

Page 23: 232255230-SAP-HANA

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 storeIndexes 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

Page 24: 232255230-SAP-HANA

Slide 24 © 2011 ALFATEC Group d.o.o.

Column Store

Column Store - One of the relational engines Interfaced from calculation / execution layerPure in-memory storePersistence managed in persistence layer

Optimized for high performance of read operationGood performance of write operationsEfficient data compression

Page 25: 232255230-SAP-HANA

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

CharacteristicsHappens 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

Page 26: 232255230-SAP-HANA

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

Page 27: 232255230-SAP-HANA

Slide 27 © 2011 ALFATEC Group d.o.o.

Row Store vs. Column Store - When to Use Which Store

Modeling Only Possible For Column TablesThis answers the frequently asked question: "Where should I put a table – row store or column store?”

Information Modeler only works with column tablesReplication server creates tables in column store per defaultData Services creates tables in column store per defaultSQL to create column table: "CREATE COLUMN TABLE ...”Store can be changed with "ALTER TABLE …“

System Tables Are Created Where They Fit BestAdministrative tables in row store:

Schema SYS - caches, administrative tables of engineTables from statistics server

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

Page 28: 232255230-SAP-HANA

Slide 28 © 2011 ALFATEC Group d.o.o.

SAP HANA Studio

Page 29: 232255230-SAP-HANA

Slide 29 © 2011 ALFATEC Group d.o.o.

Information Modeler Terminology

DataAttributes – descriptive data (known as Characteristics SAP BW

terminology)Measures – data that can be quantified and calculated (known as key

figures in SAP BW)

ViewsAttribute Views – i.e. DimensionsAnalytic Views – i.e. CubesCalculation Views – similar to virtual provider with services concept in BW

HierarchiesLeveled – based on multiple attributesParent-child hierarchy

Analytic Privilege – security object

Page 30: 232255230-SAP-HANA

Slide 30 © 2011 ALFATEC Group d.o.o.

SAP HANA Modeling Fundementals

Page 31: 232255230-SAP-HANA

Slide 31 © 2011 ALFATEC Group d.o.o.

SAP HANA Modeling Best Practices

Page 32: 232255230-SAP-HANA

Slide 32 © 2011 ALFATEC Group d.o.o.

SAP HANA Studio

Navigator View - Default Catalog

Page 33: 232255230-SAP-HANA

Slide 33 © 2011 ALFATEC Group d.o.o.

SAP HANA Studio

Navigator View - Information Models

Page 34: 232255230-SAP-HANA

Slide 34 © 2011 ALFATEC Group d.o.o.

Attribute Views

Attribute ViewWhat is an Attribute View?

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

Table Joins and PropertiesJoin Types

leftOuter, rightOuter, fullOuter, textTable

Cardinality1:1N:11:NLanguage Column

Page 35: 232255230-SAP-HANA

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

Page 36: 232255230-SAP-HANA

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)

Page 37: 232255230-SAP-HANA

Slide 37 © 2011 ALFATEC Group d.o.o.

Create Attribute view Choose the correct type of Attribute view required.STANDARD : Give you empty attribute viewCOPY FROM : One can easily copy from an existing attribute viewTIME 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

Page 38: 232255230-SAP-HANA

Slide 38 © 2011 ALFATEC Group d.o.o.

Create Attribute view Attribute view created. But still there is no data

Page 39: 232255230-SAP-HANA

Slide 39 © 2011 ALFATEC Group d.o.o.

Create Attribute view Drag and Drop the fields in the DATA FOUNDATION in the Scenario TAB

Page 40: 232255230-SAP-HANA

Slide 40 © 2011 ALFATEC Group d.o.o.

Create Attribute view Creating table joins

Page 41: 232255230-SAP-HANA

Slide 41 © 2011 ALFATEC Group d.o.o.

Create Attribute view Creating table joins

Page 42: 232255230-SAP-HANA

Slide 42 © 2011 ALFATEC Group d.o.o.

Create Attribute view Saving and Activating View

Page 43: 232255230-SAP-HANA

Slide 43 © 2011 ALFATEC Group d.o.o.

Analytical Views

Analytical ViewAn 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 figuresDimensions describe the key figures and enrich the dataSlicing and dicing is a feature whereby users can take out (slicing) a specific set of data and view (dicing) the slices from different viewpointsCardinality in star schemas is generally N:1 fact to dimensionJoins in star schemas are generally Left Outer Joins Analytical models are highly optimized for aggregating mass data

Page 44: 232255230-SAP-HANA

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 dataDistinct Values – graphical and text format identifying unique values Analysis – select fields (attributes and measures) to display in graphical format.

Page 45: 232255230-SAP-HANA

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.

Page 46: 232255230-SAP-HANA

Slide 46 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Create an Information View

Page 47: 232255230-SAP-HANA

Slide 47 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Add Tables

Page 48: 232255230-SAP-HANA

Slide 48 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Add Joins

Page 49: 232255230-SAP-HANA

Slide 49 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Add Output Columns

Page 50: 232255230-SAP-HANA

Slide 50 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Semantics view

Page 51: 232255230-SAP-HANA

Slide 51 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Dimensions, measures and aggregates

Page 52: 232255230-SAP-HANA

Slide 52 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Save and validate, Save and Activate

Page 53: 232255230-SAP-HANA

Slide 53 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Data preview – Raw Data

Page 54: 232255230-SAP-HANA

Slide 54 © 2011 ALFATEC Group d.o.o.

Create Analytical View

Generated SQL

Page 55: 232255230-SAP-HANA

Slide 55 © 2011 ALFATEC Group d.o.o.

Page 56: 232255230-SAP-HANA

Slide 56 © 2011 ALFATEC Group d.o.o.

Calculation View

Several options availableUse the Graphical ModelerWrite SQL Script and use CE FunctionsWrite SQL Script and using SQL

Suggested option = Graphical Modeler

No SQL or SQL Script knowledge requiredBuilt-in Union Constant support

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

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

Page 57: 232255230-SAP-HANA

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)

Page 58: 232255230-SAP-HANA

Slide 58 © 2011 ALFATEC Group d.o.o.

Create Graphical Calculation View

New Calculation View

Page 59: 232255230-SAP-HANA

Slide 59 © 2011 ALFATEC Group d.o.o.

Create Graphical Calculation View

Select objects for Calculation

Page 60: 232255230-SAP-HANA

Slide 60 © 2011 ALFATEC Group d.o.o.

Create Graphical Calculation View

Tools

Page 61: 232255230-SAP-HANA

Slide 61 © 2011 ALFATEC Group d.o.o.

Create Graphical Calculation View

Tools - Union

Page 62: 232255230-SAP-HANA

Slide 62 © 2011 ALFATEC Group d.o.o.

Create Graphical Calculation View

Attributes, measures, hierarchies, etc ...

Page 63: 232255230-SAP-HANA

Slide 63 © 2011 ALFATEC Group d.o.o.

Page 64: 232255230-SAP-HANA

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.

Page 65: 232255230-SAP-HANA

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.

Page 66: 232255230-SAP-HANA

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.

... ...

... ...

Page 67: 232255230-SAP-HANA

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.

FormulaWhere, 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

Page 68: 232255230-SAP-HANA

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;

Page 69: 232255230-SAP-HANA

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

Page 70: 232255230-SAP-HANA

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.