您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

对操作Oracle数据库的用户进行安全权限控制

2025/12/9 11:23:06发布19次查看
一、采用数据库级别触发器控制非sys、system的alter\drop\truncate权限 --控制alter操作 create or replace trigger sys.trigge
一、采用数据库级别触发器控制非sys、system的alter\drop\truncate权限
--控制alter操作
create or replace trigger sys.trigger_alter
before alter
on database
begin
if ora_login_user not in ('sys','system') then
raise_application_error (-20001,'please not do alter!');
end if;
end;
/
--控制drop操作
create or replace trigger sys.trigger_drop
before drop
on database
begin
if ora_login_user not in ('sys','system') then
raise_application_error (-20001,'please not do drop!');
end if;
end;
/
--控制truncate操作
create or replace trigger sys.trigger_truncate
before truncate
on database
begin
if ora_login_user not in ('sys','system') then
raise_application_error (-20001,'please not do truncate!');
end if;
end;
/
经过测试,一般用户进入数据库后无法进行alter、drop、truncate的操作
限制了对数据的破坏性操作,若进行上述操作,系统会产生
ora-00604: error occurred at recursive sql level 1
ora-20001: please do not drop!
之类错误
ps:未限制create操作,因为1、create操作不会对生产数据产生破坏性影响;
2、若限制create操作,,可能会导致create index的操作失败
======================================================
二、调整tssa用户权限
revoke dba from tssa;
grant connect to tssa;
将dba权限从tssa用户移除,并重新对其赋予connect权限
经过业务测试,未发现引起业务异常
=======================================================
三、创建只读用户bzwh
create user bzwh profile default
    identified by bzwh default tablespace users
    account unlock;
grant create session to bzwh
grant select any dictionary to bzwh
grant select any sequence to bzwh
grant select any table to bzwh
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product