cancel
Showing results for 
Search instead for 
Did you mean: 

Insufficient previlege in data preview of database view

former_member186082
Active Contributor
0 Kudos

Hi All,

I'm facing error this error on data preview of database view.

SAP DBTech JDBC: [258]: insufficient privilege: Not authorized: line 1 col 25 (at pos 24)

I've all the privileges on the schema in which view has been created. Owner(creator) of the view is other user. Should I have privileges on that views also explicitly for data preview?

Regards,
Chandu.

Accepted Solutions (1)

Accepted Solutions (1)

rindia
Active Contributor

Hi Chandu,

This is already addressed by Lars in this thread.

Regards

Raj

former_member186082
Active Contributor
0 Kudos

Hi Raj,

The issue is related to view at schema level, not information view. _SYS_REPO has SELECT privilege on the schema with GRANTABLE option. Please read my reply to Deepak and share your thoughts.

Regards,
Chandu.

rindia
Active Contributor
0 Kudos

Hi Chandu,

Can you check do you have system privilege CATALOG READ assigned to your user id.

If this does not work, just run this query and show the result. It helps others to find your missing privilege.

SELECT * FROM "PUBLIC"."GRANTED_PRIVILEGES" where GRANTEE = 'your_user_name';

Regards

Raj

former_member186082
Active Contributor
0 Kudos

Raj, I have CATALOG READ privilege to my user id. I've executed the SQL, how to proceed further...??

rindia
Active Contributor
0 Kudos

Send the screenshot or export your result of query.

former_member186082
Active Contributor
0 Kudos

PFA

former_member184768
Active Contributor
0 Kudos

Hi Chandu,

One question, can you please try running the query defined in the view definition and see if you can see the output.

Regards,

Ravi

rindia
Active Contributor
0 Kudos

Hi Chandu,

I just created a user called 'MYUSER' and just granted privileges  as shown below:

Execute on REPOSITORY_REST

SELECT on schema which has view. That's all and nothing else.

    

Then I ran the query:

 

Then I logged in as MYUSER and open a schema which has view (not column view/information view) and can do data preview without any problem.

   

Please let me know if you still has issues with this.

Regards

Raj

former_member186082
Active Contributor
0 Kudos

Hi Ravindra,

Yes, I'm able to run the query used in the procedure definition and fetch data. But not able to data preview the view.

Regards,
Chandu.

former_member184768
Active Contributor
0 Kudos

. Now that is interesting.

I can think of following options:

  • If the situation is applicable to you, please try what Rama or Raj has suggested below
  • If the query can be executed, please ignore data preview option and just run the query to see the data. Generally data preview should run the same query as you can run from SQL editor.
  • Please raise OSS message with SAP.

Regards,

Ravi

rindia
Active Contributor
0 Kudos

Hi Chandu,

Have you tried the privileges which I given with screenshots. It should work.

Regards

Raj

former_member186082
Active Contributor
0 Kudos

Raj,

I think SAPHDB schema is created and owned by HANAUSER. Try to assign SELECT privilege on SAPHDB schema to MYUSER using other user like SYSTEM user. Then try to data preview on the view created by HANAUSER in SAPHDB schema.

This is my case. SCHEMA1 in which view resides is created and owned by USER1. SYSTEM user gave privileges on SCHEMA1 to MYUSER. USER1 is not authorized to give privileges on SCHEMA1 to MYUSER.

Regards,
Chandu.

former_member186082
Active Contributor
0 Kudos

Yes Raj, I've privileges on that schema. Infact, I've all the privileges on that schema. As I posted here under, I feel privileges has to be assigned by the user who created and owns the schema, not other user like SYSTEM.

former_member186082
Active Contributor
0 Kudos

Yes Ravindra, its really weird. I can run query to get output. But the problem is there are webi reports on top of that view. This is creating an issue. When we drilled down the issue, we stuck at this level. I will try other ways, if even those dont work, I've to raise note to SAP as you said.

rindia
Active Contributor
0 Kudos

Hi Chandu,

This is my case. SCHEMA1 in which view resides is created and owned by USER1. SYSTEM user gave privileges on SCHEMA1 to MYUSER. USER1 is not authorized to give privileges on SCHEMA1 to MYUSER.

In such a case if we assign the object privilege EXECUTE on the procedure GRANT_SCHEMA_PRIVILEGE_ON_ACTIVATED_CONTENT to user (USER1) then USER1 is authorizes to give privileges to other users such as MYUSER.

Wish you all the best.

Regards

Raj

former_member186082
Active Contributor
0 Kudos

Didn't work Raj

I gave EXECUTE on GRANT_SCHEMA_PRIVILEGE_ON_ACTIVATED_CONTENT to USER1 and then SELECT on SCHEMA1 to MYUSER. It says Could not grant privilege 'SELECT' on 'SCHEMA1'. You are not authorized to perform the required actions.

former_member186082
Active Contributor
0 Kudos

Hi All,

Thanks for your time and suggestions. It worked at last, we just deleted and recreated the views with other user id and now we are able to see data(data preview). Both the user ids has sames privileges, not sure what the issue was.

Once again thanks for all your replies.

Regards,

Chandu.

former_member299080
Participant
0 Kudos

The GRANTABLE option made all the diference in my test system. It is not mentioned in the Hana modeling guide.

Marco

Former Member
0 Kudos

HI Raj,

I've gone through this entire post, but am still having trouble. I have an Attribute View created in my package, and it uses tables from my schema. I was able to Validate and Activate the Attribute view after using the following SQL:

GRANT SELECT ON SCHEMA "<SCHEMA_NAME>" to _SYS_REPO WITH GRANT OPTION;

But when I do a Data Preview of this Attribute View, and click on Raw Data, I get the following error:

Error: SAP DBTech JDBC: [258]: insufficient privilege: Not authorized

How can I fix this error?

lucas_oliveira
Advisor
Advisor
0 Kudos

Hi,

Please do not resurrect old-answered threads. Open a new discussion and refer to this one if necessary.

Maybe it's time for you to review

BRs,

Lucas de Oliveira (moderator)

Answers (2)

Answers (2)

deepak_chodha
Explorer

Hi Chandu,

For any database view:

Not only privileges on the schema in which view has been created, but make sure you have select privileges on the schema from where you are getting the tables.

For any HANA view(attribute/analytical/calculation) please check:

  1. Have you given select object privilege on your schema to _SYS_REPO user?

          If not execute with your user:

               grant select on schema <schema_name> to _SYS_REPO with GRANT option

          This helps in activation and data preview of the HANA views.

    2.   Can you check does your user has at least one analytical privilege or not.

          Analytical privileges are created on HANA views in order to restrict the view of data for a user. You need to have atleast one privilege on your           view to see the data.

          If you want to see all the data, ask your system admin to give to _SYS_BI_CP_ALL privilege.

I sense your issue to be resolved with _sys_repo privilege.

HAPPY HANA

Deepak Chodha.

former_member186082
Active Contributor
0 Kudos

Hi Deepak,

Thanks for the quick reply. As I mentioned, its a database view, created at schema level. Not an information view ( attribute/analytical/calc view) at package level.

View has been created in the same schema in which base tables reside. Data preview works on tables but not on these views. I've all privileges on that schema.

There are no analytical privileges defined, I even tried with giving _SYS_BI_CP_ALL to my user, still doesn't work.

The same issue is for other users as well. Data preview works only for the user who created the view, but not for others.

Any other thoughts??

Regards,
Chandu.

rama_shankar3
Active Contributor
0 Kudos

Chandra,

Your issue is really strange! Are you in the AWS cloud or is this your client instance? Which version of HANA revision are you running in the backend and frontend on? Both rev.#'s should match backend and front-end.

Few months ago, I experienced a similar weird issue in my AWS cloud when I was in rev. 52. I full stopped the HANA server and started it and reassigned the grants and it fixed the problem. If you are in the cloud try this assuming my solution may work for you.

Good luck!

Rama

former_member186082
Active Contributor
0 Kudos

Hi Rama,

Its not in AWS, I'm working in client instance. My Studio is in Rev60 and DB in 66

Regards,
Chandu.