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 iconand 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.bashCopy
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.bashCopy
CREATE DATABASE <DATABASE_NAME> SYSTEM USER PASSWORD <password>;
CREATE DATABASE AFL_TEST SYSTEM USER PASSWORD Password1;
Activate script server on your new tenant database.bashCopy
ALTER 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.
- Step 4
Open your preferred web browser and visit the SAP HANA Academy GitHub page and download the
PAL21.zipfile. Extract the
PAL21.ziponto 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.
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:bashCopy
CREATE USER <NEW_USER> PASSWORD <password>;
CREATE USER DEVUSER PASSWORD Password1;
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:bashCopy
GRANT AFLPM_CREATOR_ERASER_EXECUTE, AFL__SYS_AFL_AFLPAL_EXECUTE TO <NEW_USER>;
GRANT MODELING TO <NEW_USER>;
Enable Native Development:bashCopy
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:bashCopy
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 your new user and input its password.
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:bashCopy
GRANT SELECT, INSERT, DELETE ON SCHEMA <NEW_USER> TO _SYS_REPO;