Get the App
SLTechnology News&Howtos  ›  Database  › 

Oracle creates users and gives them permission to read only certain tables

Shulou Source: shulou.com Published: 2022-06-01 18:17:13 10月10日 Update

# enter the database

Su-oraclesqlplus / as sysdba

# create a read-only user

Create user kms identified by "123-456"; grant connect to kms

# Grant permissions to tables

Grant select on ecology.hrmresource to kms;grant select on ecology.HrmDepartment to kms;grant select on ecology.HrmSubCompany to kms;grant select on ecology.hrmjobtitles to kms

# create synonyms

Grant create synonym to kms;create or replace synonym kms.hrmresource for ecology.hrmresource;create or replace synonym kms.HrmDepartment for ecology.HrmDepartment;create or replace synonym kms.HrmSubCompany for ecology.HrmSubCompany;create or replace synonym kms.hrmjobtitles for ecology.hrmjobtitles

Note: if synonyms are not created, kms users must use words such as ecology.table when querying the table, not table.

Tags: User synonym synonym permission writing data database query table query Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno OPPO Reno Linux Shulou Tech Info Apple Docker