ERPClimb logoERPClimb

BTP · Intermediate · Configuration

How to configure an isolated schema and least-privilege reader role in SAP HANA Cloud

Create a tiny synthetic dataset in a dedicated schema and demonstrate least-privilege access by granting only SELECT on a single table to a test role.

APPLICABILITY
SAP HANA Cloud with database explorer and an existing authorized sandbox database instance. This SQL-based learning exercise is for a manually managed schema, not HDI-container deployment. Do not create an instance or incur charges as part of the lab.
TOOLS / TRANSACTIONS
SAP HANA Database Explorer · SQL Console · SQL privileges

Your project assignment

A hypothetical analytics team must prove that a reporting identity can read a synthetic inventory table without getting write or schema-wide permissions. A schema owner creates an isolated table and the security administrator assigns a narrowly scoped role to a distinct test identity.

Where to start: URLs and transactions

Console
SAP HANA Database Explorer from your provisioned instance
Connection
Approved sandbox database, not production

Prerequisites

  • An existing sandbox HANA database and a connection in Database Explorer.
  • An approved schema owner and a distinct test user created by the administrator.
  • Permission to create the dedicated training schema, table and role; approval to delete them afterward.

Configuration workflow

Least-privilege access to a HANA Cloud table

All steps visible. Play or advance one stage at a time.

Least-privilege access to a HANA Cloud tableSchema owner: Create isolated training objects → Training table: Single synthetic inventory row → Reader role: SELECT on one table → Separate test user: Verify query and effective privileges. If it works: One row visible, Table SELECT only. If it fails: Access mismatch, Inspect role grants and identity1Schema ownerCreate isolated training objects2Training tableSingle synthetic inventory row3Reader roleSELECT on one table4Separate test userVerify query and effective privilegesWORKSOne row visibleTable SELECT onlyFAILSAccess mismatchInspect role grantsand identity
No database administrator privileges are needed by the reader. ERPClimb original instructional diagram · not a live SAP screenshot.

Hands-on implementation — step by step

Follow the screen navigation, replace example values with approved project values, and mark each step after checking its result. The screens below are original teaching aids, not live SAP screenshots. Progress is local to this visit.

0/6 completed
  1. 1

    Database Explorer → select instance

    Open the SQL console on the designated sandbox and confirm the connected database and schema-owner identity before creating any objects.

    Database Explorer → select instanceERPClimb · illustrative screen
    Connection
    Approved training database
    Identity
    Authorized schema owner
    Check
    SELECT CURRENT_USER FROM DUMMY;

    Expected result: The identity and sandbox connection match the approved request.

    Why this matters: Running DDL against an unintended instance can create or change objects in the wrong environment.

  2. 2

    SQL Console → create schema

    Check that the chosen training schema name is unused, then create it using the approved owner. Use a unique name when multiple trainees share a database.

    SQL Console → create schemaERPClimb · illustrative screen
    Schema
    ZTRAIN_STOCK (hypothetical)
    SQL
    CREATE SCHEMA ZTRAIN_STOCK;

    Expected result: The new isolated schema is visible in the catalog.

    Why this matters: A dedicated schema makes the exercise easier to authorize and clean up.

  3. 3

    SQL Console → create and populate test table

    Create a small table in the training schema and insert one invented stock quantity. Confirm the row as the owner and commit if required by the session.

    SQL Console → create and populate test tableERPClimb · illustrative screen
    DDL
    CREATE COLUMN TABLE ZTRAIN_STOCK.ITEMS (ID INTEGER PRIMARY KEY, QTY INTEGER);
    DML
    INSERT INTO ZTRAIN_STOCK.ITEMS VALUES (1, 10);
    Check
    SELECT ID, QTY FROM ZTRAIN_STOCK.ITEMS;

    Expected result: The owner sees the single synthetic row.

    Why this matters: A small known fixture makes the read authorization test deterministic.

  4. 4

    Security administration → create restricted role

    Ask the authorized administrator or object grantor to create the test role and grant only SELECT on the training table. Do not grant general schema privileges.

    Security administration → create restricted roleERPClimb · illustrative screen
    Role
    ZTRAIN_STOCK_READER (hypothetical)
    SQL
    CREATE ROLE ZTRAIN_STOCK_READER;
    Grant
    GRANT SELECT ON ZTRAIN_STOCK.ITEMS TO ZTRAIN_STOCK_READER;

    Expected result: The role contains a table-level SELECT privilege.

    Why this matters: The object-specific grant limits the reader to the intended dataset.

  5. 5

    Administrator → assign role to test user

    Assign the reader role to the designated isolated identity, checking that it has no other broad grants or schema ownership.

    Administrator → assign role to test userERPClimb · illustrative screen
    User
    ZTRAIN_READER (hypothetical; pre-created)
    SQL
    GRANT ZTRAIN_STOCK_READER TO ZTRAIN_READER;

    Expected result: The test user receives the approved role.

    Why this matters: Testing as a database administrator would mask missing or excessive privileges.

  6. 6

    Separate connection → verify and clean up

    Connect as the test reader. Verify the SELECT works and review effective privileges to confirm no write grant. After the review, have the owner and administrator remove the training role and objects using approved cleanup.

    Separate connection → verify and clean upERPClimb · illustrative screen
    Read check
    SELECT ID, QTY FROM ZTRAIN_STOCK.ITEMS;
    Expected
    ID 1, QTY 10
    Cleanup
    Revoke dedicated role; drop test objects after approval

    Expected result: The isolated reader sees only the intended fixture and no write grant is present.

    Why this matters: A separate identity and explicit cleanup establish the actual access boundary and avoid abandoned objects.

Project acceptance checklist

Use this checklist to prepare evidence for your project lead.

0 of 4 checks marked. This does not certify the SAP configuration.

Validate your configuration

  • A reader using a separate connection can retrieve the synthetic table row.
  • Effective privileges show the intended SELECT grant and no unexpected write privileges.

Common errors and what to check

  • schema creation denied.

    Check: Confirm owner privileges; do not switch to a production admin account.

  • object already exists.

    Check: Choose a unique training identifier rather than dropping an unfamiliar object.

  • reader cannot query.

    Check: Verify the qualified table name and assigned role.

  • reader has extra access.

    Check: Review inherited roles and grants with the database administrator.

HANA Cloud reader troubleshooting: check table name and SELECT role for denied reads; inspect effective and inherited grants for excess access.
HANA Cloud reader troubleshooting: check table name and SELECT role for denied reads; inspect effective and inherited grants for excess access. ERPClimb original illustration.

More in the SAP Library

Need help with a configuration error? Open ERPClimb Copilot.

Technical references & further reading

Official documentation for technical verification, release compatibility and further study.