Problem with GRANT in Oracle 10

I have a user admin who has administrator privileges and oracle XE user by default. The user admin created the CAR table, role S, and provided this SELECT role on the CAR table. The administrator then granted role S to user hr. But when hr tries select * from admin.car, the database gives an error that such a table or view does not exist. here is the code:

create role S;
grant select on admin.car to S;
grant S to hr;

what is the problem?

+3
source share
1 answer

When a user logs on to Oracle, all roles are enabled by default, but SET roles other than the default must be enabled using the SET ROLE statement:

SET ROLE S;

Setting the DEFAULT Role Role

, . SET ROLE. DEFAULT, ALTER USER:

ALTER USER hr
DEFAULT ROLE S;

:

+7

Source: https://habr.com/ru/post/1774813/


All Articles