إنشاء مستخدم جديد فقط المستخدم فقط على DB2 في قاعدة البيانات بأكملها
-
11-12-2019 - |
سؤال
أنا خادم Oracle / SQL DBA لهما معرفة محدودة في IBM DB2.لدينا DB2 9.7 FP4 يعمل على AIX 6. أود إنشاء مستخدم جديد ومنحه قراءة فقط الامتياز فقط في قاعدة بيانات معينة.الرجاء المساعدة!
شكرا واحترام محمد
المحلول
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