How do I grant access to an Amazon Redshift user to read the system tables, views, logs, etc?

夙愿已清 提交于 2019-12-11 02:12:30

问题


I have a user in Amazon Redshift. I want that user to be able to do read-only queries against the system tables:

http://docs.aws.amazon.com/redshift/latest/dg/cm_chap_system-tables.html

But I don't know how to grant a user who is not a superuser access to these tables as it does not appear to be documented anywhere on amazon.


回答1:


Obviously you don't want to grant superuser to another user just so they can see system logs. Being able to monitor is a very common use case that shouldn't require giving someone carte blanche access.

Thankfully you have the ability to grant access to system tables using the syslog access option.

alter user user123 syslog access unrestricted

See Redshift documentation on visibility




回答2:


If you are a Superuser, you can make other user as superuser or create a new superuser and then other user can query system table and views. Use createuser privilege.
Below is the sample query

create user user_super createuser password '1234';
alter user user_super createuser;

Be careful while making any superuser, superuser gets all access including grant and revoke and query run from superuser always goes to query-1 and will make other queries wait until finished.



来源:https://stackoverflow.com/questions/39582173/how-do-i-grant-access-to-an-amazon-redshift-user-to-read-the-system-tables-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!