Skip to Content

Getting Started with Predictive Analytics

This tutorial series will cover two approaches to a sample project utilizing the predictive analytics capabilities of SAP HANA, express edition. This tutorial will show you how to configure your installation for the sample projects by creating a tenant database and a new user to manage that database.
You will learn
  • How to prepare your SAP HANA, express edition installation for Predictive Analytics
aplata-sapAdrian PlataOctober 28, 2020
Created by
aplata-sap
June 22, 2017
Contributors
aplata-sap
  • Step 1

    Log in to your system database and select your database. Click on the Administration icon

    Administration Icon
    and under the Overview tab, next to Installed Plug-ins check that AFL is installed.

    Overview Tab

    Open an SQL command line to your database and check again that AFL PAL Functions are installed.

    bash
    Copy
    SELECT * FROM SYS.AFL_FUNCTIONS WHERE PACKAGE_NAME='PAL';
    

    If a list of AFL functions is generated, AFL PAL Functions are installed.

  • Step 2

    Through your SQL command line, create a new tenant database.

    bash
    Copy
    CREATE DATABASE <DATABASE_NAME> SYSTEM USER PASSWORD <password>;
    

    Example:

    CREATE DATABASE AFL_TEST SYSTEM USER PASSWORD Password1;
    

    Activate script server on your new tenant database.

    bash
    Copy
    ALTER DATABASE <DATABASE_NAME> ADD 'scriptserver';
    
  • Step 3

    Click on the Add System… icon

    Add System
    .

    Add the Host Name, Instance Number, Mode, and Description for your tenant database.

    • The Host Name and Instance Number are the same as your System database.

    • For Mode, when you select Multiple containers select Tenant database and enter the name of your tenant database.

    • Click Next >.

    Choose Authentication by database user and add the SYSTEM user with your tenant SYSTEM user password.

    Click Finish.

  • Step 4

    Open your preferred web browser and visit the SAP HANA Academy GitHub page and download the PAL21.zip file. Extract the PAL21.zip onto your local machine.

    On SAP HANA Studio, select File > Import…

    Under the SAP HANA folder, select Catalog Objects. Click Next >.

    Import PAL20

    Select your tenant database.

    Select Import catalog objects from current client and select the directory where you extracted PAL21.zip. It will read PAL21.

    Import Location

    For Select Catalog Objects for Import, select and Add all of the objects from the PAL21 directory.

    Click Next >.

    Click Finish to begin your upload.

    Importing the data will take some time.

    Note:
    You can check if the upload was successful by logging into your tenant database and cascading down from Catalog -> PAL -> Tables. You will see a series of tables.

    PAL Tables

  • Step 5

    Open an SQL command line to your tenant database.

    Create a new user:

    bash
    Copy
    CREATE USER <NEW_USER> PASSWORD <password>;
    

    Example:

    CREATE USER DEVUSER PASSWORD Password1;
    

    Note:
    The script in the following tutorial assumes your new username is DEVUSER. Consider naming your new user DEVUSER to avoid additional steps.

    Authorize creation, removal, and execution of PAL Procedures:

    bash
    Copy
    GRANT AFLPM_CREATOR_ERASER_EXECUTE, AFL__SYS_AFL_AFLPAL_EXECUTE TO <NEW_USER>;
    

    Enable modeling:

    bash
    Copy
    GRANT MODELING TO <NEW_USER>;
    

    Enable Native Development:

    bash
    Copy
    GRANT EXECUTE ON REPOSITORY_REST TO <NEW_USER>;
    GRANT REPO.READ, REPO.EDIT_NATIVE_OBJECTS, REPO.ACTIVATE_NATIVE_OBJECTS, REPO.MAINTAIN_NATIVE_PACKAGES ON ".REPO_PACKAGE_ROOT" TO <NEW_USER>;
    

    Grant access to the sample data:

    bash
    Copy
    GRANT SELECT ON SCHEMA PAL TO <NEW_USER>;
    GRANT SELECT ON SCHEMA PAL TO _SYS_REPO;
    
  • Step 6

    Right-click on your tenant database. Select Add System with Different User….

    Add New User

    Add your new user and input its password.

    Add User Info

    Click Finish.

    Note
    You may be asked to give your new user a new password.

  • Step 7

    Open an SQL command line to your tenant database through your new user and enter the following:

    bash
    Copy
    GRANT SELECT, INSERT, DELETE ON SCHEMA <NEW_USER> TO _SYS_REPO;
    
Back to top