1.首先在A用户下运行,把读取userA表的权限赋值给B,这样在B中建立视图就可以读取A中userA表中的数据了。
grant select on A.userA to B;
2.登录用户B表空间,建立视图。语句如下:
create or
replace view cas_user_view as select
B.LOGIN_NAME,B.PASSWORD,B.LOGIN_FLAG from userB B union select
A.LOGIN_NAME,A.PASSWORD,A.LOGIN_FLAG
from A.userA A;
到此,在用户B中已建立名为
cas_user_view的视图,可以供A和B同时使用。