copy 数据库第三接口授权
来源:互联网 发布:淘宝海外代购是真的吗 编辑:程序博客网 时间:2024/05/19 15:42
跟第三方做接口程序时给对方开放只能查询某些视图用户的步骤如下:
我们有这样一个需求:在数据库中建立两个用户,用户A
这个用户B
这种需求在很多行业的应用中都很常见。假如这是一道面试题,您该如何去回答呢?
我采用下面的方法来回答这个问题。
第一步,创建新用户A
这里用户名称分别为ryd_interface_src
drop user ryd_interface_src cascade;
create user ryd_interface_src identified by ryd_interface_src;
grant connect,create view to ryd_interface_src;
drop user ryd_interface cascade;
create user ryd_interface identified by ryd_interface;
grant connect,create synonym to ryd_interface;
第二步,登录数据库一个模式中,授权给用户A
conn qlzqclient/qlzq+client8
grant select on INVEST_CLOCK
grant select on INVEST_LOG
这里授权方法加了一个with grant option
第三步,登录数据库用户A
conn ryd_interface_src/ryd_interface_src
create or replace view run_views as
select id as doc_id, title,fbsj as upload_date,'' as branch_code from qlzq.runs_lantern@CLIENT_QLZQWEB
where EXT1='1' and sysdate >
and sysdate < SOLID_TIME
union
select a.doc_id,a.title,a.upload_date,a.branch_code
left
where
a.state =1 and a.is_delete =0
and
and
create or replace view INVEST_CLOCK_VIEWS as
select
create or replace view INVEST_LOG_VIEWS as
select
第四步,在数据库用户A
因为在步骤二中,加了with grant option
grant select on INVEST_CLOCK_views to ryd_interface;
grant select on INVEST_LOG_views to ryd_interface;
grant select on run_views to ryd_interface;
第五步,在数据库用户B
conn ryd_interface/ryd_interface
select count(*) from ryd_interface_src.run_views;
select count(*) from ryd_interface_src.INVEST_CLOCK_views;
select count(*) from ryd_interface_src.INVEST_LOG_views;
create synonym
create synonym
create synonym
第三方的系统直接通过这个同义词就可以访问到用户A
第六步,限制资源使用
因为用户B
话数做一个限制。
这里采用profile
conn / as sysdba
alter system set resource_limite=true scope=both sid='*';
新建profile,
create profile third_user limit SESSIONS_PER_USER 1 FAILED_LOGIN_ATTEMPTS unlimited;
alter user ryd_interface profile third_user;
将会话数调整到30
alter profile third_user limit SESSIONS_PER_USER 30;
通过以上操作,我们就可以实现这个需求了。
- copy 数据库第三接口授权
- 数据库授权
- 数据库授权
- 第三方授权
- 第三方授权登陆
- 第三章 Shiro授权
- 第三章 授权
- 第三章 授权
- 第三章 授权
- 第三方授权
- iOS HTTP接口授权
- Shiro第三篇【授权、自定义reaml授权】
- 第三章 授权(三)授权流程
- QQ的第三方授权和取消第三方授权
- 第三方登录授权说明
- 第三方登录授权说明
- 第三方登录,授权,分享
- 简单的第三方授权
- 从语义化的角度,<li> 标签中的内容应该使用 <p> 标签吗?
- (Slide)CNN图像分类与物体检测
- Manifest中一些标签的作用
- 关于机器学习 你不得不思考这些问题
- V4L2源代码之旅五:V4L2的起点和终点
- copy 数据库第三接口授权
- FCC算法:七、检查字符串结尾--Confirm the Ending
- 【DevExpress v17.2新功能预告】WinForms上的图表增强
- 通过scp上传文件到服务器
- Android实战:CoolWeather酷欧天气(加强版数据接口)代码详解(上)
- 从键盘输入字符串并输出该字符串(汇编语言)
- 微信公众平台给用户发红包+php
- Css有关于圣杯及双飞翼布局
- 字符串不输出某一指定字符!