Grant SELECT privilege TO _SYS_REPO - Why?

If objects (tables/views) of a schema (say SCHEMA_ABC) are used to build modeling views then it’s necessary to grant _SYS_REPO the SELECT WITH GRANT privilege on this schema.

The following SQL statement must be executed before activating any such modeling views.

GRANT SELECT ON SCHEMA SCHEMA_ABC TO _SYS_REPO WITH GRANT OPTION

If you miss this step, an error will occur when you activate your views later.

Explanation: The activation of modeling views are done in the name of user _SYS_REPO.
Think of _SYS_REPO as "the activation guy". It takes your models and creates the necessary runtime objects from them. Therefore user _SYS_REPO needs the allowance to select YOUR tables/views. (If _SYS_REPO user cannot select on the tables specified in the from-clause of the view-definition, it cannot define that view)

If other users need to select this view (obviously this is always the case, otherwise the views would not make sense), then _SYS_REPO needs to have the additional allowance to grant the select further (WITH GRANT OPTION).

Therefore after having activated all your models that access data in your schemas, _SYS_REPO wants to give you (and probably other users) read access to the activated models.
If NO object of the schema will be used for modeling views, then you do not need to grant select on that schema to _SYS_REPO.

If you replicate data automatically, using SAP LTR Server, this command is executed automatically in the background while creating a new schema.

No comments:

Post a Comment