전체 데이터베이스의 DB2에서 새 읽기 전용 사용자 만들기
-
11-12-2019 - |
문제
IBM DB2에서 지식이 제한된 Oracle / SQL Server DBA입니다.우리는 AIX 6에서 DB2 9.7 FP4를 실행하고 있으며 새 사용자를 만들고 특정 데이터베이스에 대한 읽기 전용 권한을 부여하고 싶습니다.제발 도와주세요!
감사합니다 모하메드
해결책
There is no read only privilege on a database in DB2. You will need to grant SELECT
privileges on specific tables, preferably via a role to avoid doing this multiple times.
- Create a new database role, e.g.
create role readonly
. - Grant
SELECT
privileges on the required tables to that role:grant select on myschema.mytable to role readonly
. - Create a new user in the operating system, e.g.
# mkuser newuser
. - Grant the role to the user:
grant role readonly to user newuser
.
Note that the new user will likely need to change the initial password before he or she can connect to the database.
제휴하지 않습니다 dba.stackexchange