四、Enable and Configure Cross-Database Access
来源:互联网 发布:java防止sql注入转义 编辑:程序博客网 时间:2024/05/21 22:25
4.1 启用跨租户数据库访问
在租户数据库之间的只读查询是支持的,但是缺省状态是不启用的。你必须要在系统数据库中启用这个功能,然后再配置两个数据库之间的通讯
Situation
租户数据库TN1需要访问租户数据库TN2下面的Table_A
Procedure
1.在系统数据库中启用cross_database_access
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') set ('cross_database_access', 'enabled')='true' WITH RECONFIGURE;
2.配置源数据库和目标数据库
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') set ('cross_database_access', 'targets_for_<source_db_name>')='<target_db1>[,<target_db2>...]' WITH RECONFIGURE;
NOTE:<source_db_name>是源数据库,<target_db1>是目标数据库,<source_db_name>从<target_db1>取数据
Example:
ALTER SYSTEM ALTER CONFIGURATION ('global.ini', 'SYSTEM') set ('cross_database_access', 'targets_for_TN1')='TN2' WITH RECONFIGURE;
3.在目标数据库(TN2)中创建用户,并将这个用户与源数据库(TN1)的用户做一个映射
Example:
CREATE USER User_2 PASSWORD aA111111;
ALTER USER User_2 ADD REMOTE IDENTITY User_1 AT DATABASE TN1;
或者直接用一条语句替换
CREATEUSER User_2 PASSWORD aA111111WITH REMOTEIDENTITY User_1ATDATABASE TN1;
4.将Table_A的查询权限赋给User_2
GRANT SELECT ON TABLE Table_A TO User_2 WITH GRANT OPTION;
5.在TN1中使用用户User_1查询TN2中表Table_A 的数据
4.2 使用跨租户数据库访问会遇到的问题
- 四、Enable and Configure Cross-Database Access
- Access Database Design and Programming
- How Do I Enable Remote Access To MySQL Database Server?
- IIS 7.5, Classic ASP and Access database
- Enable OWIN Cross-origin Request
- enable flashback database feature
- Ubuntu install SVN server and configure using http access
- Real World Microsoft Access Database Protection and Security
- Disable or Enable SSH Root Login and Limit SSH Access in Linux
- ApacheDS 2.0__Basic User Guide 1.4.5 - Enable and disable anonymous access (基础用户指导手册)
- Explanation of Cross Domain and Client Access Policy files for Silverlight
- You want to configure and schedule offline database backups to run automatically. Which tool or util
- The database has local access protection and you are not authorized to access it locally
- 给 configure.ac 添加 --enable-feature 选项
- how to enable debug in configure?
- ffmpeg configure 不支持 --enable-libopencv 解决
- configure: error: *** Could not enable any backends.
- Invalid Cross-thread access... bug?
- Educational Codeforces Round 25 B. Five-In-a-Row
- iOS转前端之仿写登录页面
- 关于浏览器隐私/无痕模式下localStorage的判断
- 视觉设计师提升自己能力的17条经验(上)
- CLR Via C# Note--The CLR's execution mode
- 四、Enable and Configure Cross-Database Access
- leetcode 628 Maximum Product of Three Numbers c语言 (找到第k大的数)
- web开发—前言
- 在线教育+直播,千亿市场的新入口
- 解决如何点击返回上层
- mysql--新建表的默认值小结
- 页面文本复制
- Node.js 运行.js文件出现错误找不到文件的解决办法
- android Utils大集合