Oracle普通用户change notification 事件授权
问题描述:
当客户表插入新数据是通过绑定Change Notification事件,收到数据更新通知并拉去对应数据库表的数据,但客户不会给Oracle数据的管理员角色,只能给一个普通用户角色,普通用户角色又不具有Change Notification事件权限,如何实现上述功能?
解决方案:
1、创建一个普通用户
create user username identified by password;
2、授予即系统默认权限的集合CONNECT、RESOURCE
grant connect,resource to username;
注:此时的用户拥有连接数据库,创建表、序列、触发器等权限;
3、授予普通用户 change notification权限
grant change notification to username;
4.在代码中注册事件