多营运中心(账套)权限表资料分离设定

原理:zxw_file权限表取消同义词设定,直接参照ds库建档,这样就可让zxw_file资料独立于其他账套资料,不随主资料库一起变化。

---1.备份资料,记录笔数
create table cqjh.temp_cqjhzxw_file as
select * from cqjh.zxw_file
---2.删除同义词,重新建档并赋权限
drop synonym cqjh.zxw_file;  
CREATE table cqjh.zxw_file as select * from ds.zxw_file where 1 = 0 ;
grant select on cqjh.zxw_file to tiptopgp; 
grant update on cqjh.zxw_file to tiptopgp; 
grant delete on cqjh.zxw_file to tiptopgp; 
grant insert on cqjh.zxw_file to tiptopgp; 
grant index  on cqjh.zxw_file to public; 
grant select on cqjh.zxw_file to ods;

---3.恢复备份的数据--核对笔数
insert into cqjh.zxw_file
select * from cqjh.temp_cqjhzxw_file

同义词解释可参照: https://www.cnblogs.com/kerrycode/archive/2012/12/19/2824963.html

Oracle的同义词(synonyms)从字面上理解就是别名的意思,和视图的功能类似,就是一种映射关系。

posted @ 2022-12-21 13:51  三生有幸格格  阅读(35)  评论(1编辑  收藏  举报