Setting Up SAP HANA as the In-Memory Database

Install and configure SAP HANA for use as the in-memory database for Sybase RAP.

Prerequisites
Install the SAP HANA Client. For more information, see the SAP HANA Client Installation Guide.
Task
  1. Open up a new command prompt. Do not reuse a command prompt from the installation of another RAP component.
  2. Install revision 1.00.37 or higher of the SAP HANA database server.
  3. Copy the RAP enablement package to the SAP HANA server machine, and extract it into a directory of your choice. This is referred to as the RAP enablement installation directory throughout the rest of this guide.
  4. Run the configure.sh shell script from the RAP enablement installation directory.
    This file prepares the SAP HANA script files for execution.
  5. Use the hdbsql tool to create a RAP_USER in the SAP HANA database.
    1. Run hdbsql in interactive mode as the administrative user: hdbsql -n <server name>:<port> -u <username> where <username> corresponds to an SAP HANA account with user administrative permissions and grantable import permissions.
      You are asked for this user's password when you run the first SQL command in this tool.
    2. In the interactive terminal, run: CREATE USER RAP_USER PASSWORD <new password>
      The password you set here is only temporary. You are required to change your password after your first log onto the SAP HANA server as RAP_USER.
    3. In the interactive terminal, run: GRANT IMPORT TO RAP_USER
    4. Type quit to leave the interactive terminal.
  6. Use the hdbsql tool to set up the RAP schema and sample data.
    1. Run hdbsql in interactive mode as the user (RAP_USER) created in the previous step: hdbsql -n <server name>:<port> -u RAP_USER .
      You are prompted for RAP_USER's password after you run the first SQL command in this tool.
    2. In the interactive terminal, run: ALTER USER RAP_USER PASSWORD <new password> where <new password> is the new and permanent password for RAP_USER.
    3. Create the RAP tables in the SAP HANA database. Before loading the database schema, decide whether the RAP system will need to support multibyte character sets for string data.
      1. If the RAP system requires support for multibyte character sets, load the multibyte RAP schema. In the interactive terminal, run: \I <RAP enablement installation directory>/databases/hana/scripts/mbcs/create_tables_mbcs.sql where <RAP enablement installation directory> is replaced by the absolute path to the RAP enablement installation directory.
      2. Otherwise, load the single-byte RAP schema. In the interactive terminal, run: \I <RAP enablement installation directory>/databases/hana/scripts/create_tables.sql where <RAP enablement installation directory> is replaced by the absolute path to the RAP enablement installation directory.
    4. Load the sample supporting data into the newly created tables in the SAP HANA database. The sample supporting schema is required to use the RAP sample project.

      If you installed the multibyte schema in the previous step, you can choose to load the default sample supporting data for English (single-byte characters) or for Japanese (multibyte characters). If you install the Japanese sample supporting data, use the Japanese sample input files when you run the RAP project.

      Sample Supporting Data Required Steps

      English

      1. In the interactive terminal, run: \I <RAP enablement installation directory>/databases/hana/scripts/load_tables.sql

      Japanese (multibyte schemas only)

      1. Change directories to <RAP enablement installation directory>/databases/hana/data/supportingdata.
      2. To keep a copy of the English sample supporting data for future use, rename the files INSTRUMENT.csv to INSTRUMENT.csv.en, and MARKET_INDEX.csv to MARKET_INDEX.csv.en.
      3. Copy the INSTRUMENT.csv.jp to INSTRUMENT.csv, and MARKET_INDEX.csv.jp to MARKET_INDEX.csv.
      4. In the interactive terminal, run: \I <RAP enablement installation directory>/databases/hana/scripts/load_tables.sql
    5. (Optional) Load sample data (STOCK_QUOTE and STOCK_TRADE) into the RAP database. In the interactive terminal, run: \I <RAP enablement installation directory>/databases/hana/scripts/load_TAQ_tables.sql
    6. Type quit to leave the interactive terminal.