您可以在另一个模式中创建此表,并在不授予更新的情况下授予您的模式选择、插入、删除,因此任何从当前模式执行更新状态的尝试都不会执行。
这是一个例子:
connect system/manager
grant connect, resource to user1 identified by user1;
grant connect, resource to user2 identified by user2;
disconnect
connect user1/user1
create table user1.table1(col1 number, col1_desc varchar2(16));
grant select, insert, delete on user1.table1 to user2;
disconnect
conn user2/user2
select * from user1.table1
insert into user1.table1 values (1, 'insert-user2');
commit;
insert into user1.table1 values (2, 'insert-user2');
commit;
delete from user1.table1 t where t.col1 = 2;
commit;
update user1.table1 t set t.col1_desc = 'ins-user2' where t.col1 = 1;
commit;
-- last update statement will throw ORA-01031: insufficient privileges
注意:您可以使用 user1.table1 的同义词直接从 user2 使用 table1 表名
问候,