1、打开plsql,选择数据库,使用该数据库的管理员账号登录,一般这个管理员账号为sys。
2、如下图,按红色箭头所示顺序进行操作。
3、点击Role privileges,分别选择connect和resource。
4、点击apply。
5、给用户赋予表的查询权限:语句为grant select on xjydata.sfb_file to DBLINKTEST;
6、创建视图:在view上右击new。
7、填写view信息,然后点击ok。
8、将视图的查询权限赋予给用户。语句为grant select on xjydata.view_dblink_test_get_oea to DBLINKTEST;
9、使用账号DBLINKTEST登录,通过以下语句可以查询结果。select * from xjydat锾攒揉敫a.sfb_file;select * from xjydata.view_dblink_test_get_oea where oea01 = '2020-2102050001'同时,在user中找到DBLINKTEST,右击view,点击object privileges中可以看到上面语句赋予的权限