Getting Started with Predictive Analytics
- How to prepare your SAP HANA, express edition installation for Predictive Analytics
- Step 1
Log in to your system database and select your database. Click on the Administration icon
and under the Overview tab, next to Installed Plug-ins check that AFL is installed.Open an SQL command line to your database and check again that AFL PAL Functions are installed.
bashCopySELECT * 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.
bashCopyCREATE DATABASE <DATABASE_NAME> SYSTEM USER PASSWORD <password>;
Example:
CREATE DATABASE AFL_TEST SYSTEM USER PASSWORD Password1;
Activate script server on your new tenant database.
bashCopyALTER DATABASE <DATABASE_NAME> ADD 'scriptserver';
- Step 3
Click on the Add System… icon
.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 thePAL21.zip
onto your local machine.On SAP HANA Studio, select File > Import…
Under the SAP HANA folder, select Catalog Objects. Click Next >.
Select your tenant database.
Select Import catalog objects from current client and select the directory where you extracted
PAL21.zip
. It will read PAL21.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. - Step 5
Open an SQL command line to your tenant database.
Create a new user:
bashCopyCREATE 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:
bashCopyGRANT AFLPM_CREATOR_ERASER_EXECUTE, AFL__SYS_AFL_AFLPAL_EXECUTE TO <NEW_USER>;
Enable modeling:
bashCopyGRANT MODELING TO <NEW_USER>;
Enable Native Development:
bashCopyGRANT 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:
bashCopyGRANT 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 your new user and input its password.
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:
bashCopyGRANT SELECT, INSERT, DELETE ON SCHEMA <NEW_USER> TO _SYS_REPO;
- Ensure AFL is Installed
- Create a Tenant Database and Activate the Script Server
- Connect to Your Tenant Database
- Download and Import the PAL Schema Sample Data
- Add a New User and Grant Proper Permissions for the Tenant Database
- Log in to the Tenant Database with the New User
- Grant Access to New User Schema