Initial system setup

Suppose we need to make initial system settings to run one user who will have one role. The user will work on one compute pool inside one circuit.

In order for the actions described below to be possible, they must be performed either by an administrator or by a user with privileges to create other users, roles and compute pools.
  1. Create the analyst role:

    CREATE ROLE analyst;
  2. Create the compute_s compute pool and set the size of the S computes for it:

    CREATE WORKER POOL compute_s WORKER SIZE S;
  3. Create user tengri_demo_user, set its password for identification and assign the default compute pool compute_s to it:

    CREATE USER tengri_demo_user
        IDENTIFIED BY PASSWORD '***'
        DEFAULT WORKER POOL compute_s;
  4. Assign the tengri_demo_user user the analyst role:

    GRANT ROLE analyst TO tengri_demo_user;
  5. Grant the analyst role the USAGE and MONITOR privileges on the compute_s compute pool:

    GRANT USAGE, MONITOR ON WORKER POOL compute_s TO ROLE analyst;

    Next:

    1. if the system already has an analytical_sandbox schema and our user will only work in it, then grant him the privilege to work with all tables within that schema, both existing and those to be created in the future:

      GRANT ALL ON SCHEMA analytical_sandbox TO ROLE analyst;
    2. if the user will be working in a new schema, then create this analytical_sandbox_new schema and grant him the privilege to work with all tables within this schema:

      CREATE SCHEMA analytical_sandbox_new;
      
      GRANT ALL ON SCHEMA analytical_sandbox_new TO ROLE analyst;
  6. If the user tengri_demo_user is expected to create new schemas, then grant him the privilege to create a schema within the catalogue:

    GRANT CREATE SCHEMA ON CATALOG TO ROLE analyst;

The tengri_demo_user user will then be able to:

  • Create tables within the analytical_sandbox (or analytical_sandbox_new) schema

  • Read tables inside the analytical_sandbox (or analytical_sandbox_new) schema

With these settings the user tengri_demo_user will be able to:

  • Delete tables within a analytical_sandbox (or analytical_sandbox_new) schema

  • Delete the analytical_sandbox (or analytical_sandbox_new) schema