小编use*_*853的帖子

数据库登录触发器

为了阻止 Oracle 数据库上的特定用户和 IP 组合,我创建了以下触发器,并且编译没有错误。

Create or replace trigger you_may_not_login
after logon on database
begin
if sys_context('USERENV','SESSION_USER')='xx' AND     sys_context('USERENV','IP_ADDRESS')='10.0.30.219' then
raise_application_error(-20001,'Denied!  You are not allowed to logon the database');
end if;
end;
/
Run Code Online (Sandbox Code Playgroud)

当我使用 'xx' 用户登录时,警报日志显示以下错误,但访问权限已授予数据库,触发器以某种方式无法阻止用户登录。

Errors in file /oraarch/core/udump/wfsbi_ora_9338.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-20001: Sorry, you are not allowed here!
ORA-06512: at line 9
Run Code Online (Sandbox Code Playgroud)

我哪里错了?/

trigger oracle access-control

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

access-control ×1

oracle ×1

trigger ×1