当前位置:网站首页>Table access among Oracle database users
Table access among Oracle database users
2022-06-13 07:06:00 【AndroidOrCSharp】
Oracle The database has a user concept , I understand different users as different libraries .
Simply speaking , I call the trading pool TRADE user , I call the customer management library ACCOUNT user .
Under normal circumstances , Each user accesses its own table , But when cross user access is required , We have three choices .
One . The transaction library gives the customer library the authority to query the transaction table , We call it authorization , Keyword is grant.
Now let's simulate from A user , hold ableName The operation authority of is given to B user , The following authorization statement should be in A Library execution .
1. SELECT * FROM dba_users; -- Query all users in the database
2.GRANT SELECT ON tableName to B;-- Authorization inquiry ( Will table tableName The right of inquiry is granted to B)
GRANT INSERT ON tableName to B;-- Authorization to insert ( Will table tableName The right to insert is granted to B)
GRANT UPDATE ON tableName to B;-- Authorization update ( Will table tableName The right to renew is granted to B)
GRANT UPDATE ON tableName to Bwith grant option; -- The authority to update is transferred to the user , The user can continue to authorize other users ;
GRANT EXECUTE ON ProceDureName to B;-- Authorization stored procedure
3.Revoke select on tableName from B; -- Revoke the permission of query table ;
Revoke all on tableName from B;-- Withdrawal form tableName All permissions of ;
4.SELECT * from dba_tab_privs where grantee=upper('DC_CH');-- Query the object permissions given to a user
SELECT * from dba_sys_privs where grantee=upper('DC_CH');-- Query the system permissions owned by a user
SELECT* from session_privs ;-- Valid system permissions for the current session
such , We can directly from B The user action A User tableName This watch , The corresponding statement is
SELECT * from A.tableName;
UPDATE A.tableName set... wait
Two . Increase the granularity of operations , send B Users operate like their own tables A Tables in users , Introduce the concept of synonyms
The benefits of synonyms
1、 No memory space , Save a lot of database space
2、 Simplified access to database objects
3、 Improve the security of database object access
4、 The use scope of the extended database , Can achieve seamless interaction between different database users ; Synonyms can be created on a different database server , Connect through the network
1. stay A Create private synonyms in the user
CREATE SYNONYM TB FOR tableName;
such SELECT * FROM TB= SELECT * FROM tableName.
Suppose we have granted different permissions to this table B user , Then we can start from B China and Israel SELECT * FROM A.TB In the form of tableName.
2. stay A Create common synonyms among users
CREATE PUBLIC SYNONYM TB FOR tableName;
In this way, all users under this library can directly SELECT * FROM TB Mode of access tableName.
-- Delete public synonyms : drop public synonym TB ; -- Delete private synonyms : drop synonym TB ;
3、 ... and . A little more granular ,B The user can operate A All the tables below the user , introduce DB Link.
1. Establish database connection through interface tools .
2. adopt SQL Statement to establish a database connection
create database link DS
connect to DS_CH identified by ds
using '192.168.1.244/orch';
from B User access A The user's table is SELECT * FROM [email protected]
This completes the introduction of the three library user access methods , How to choose , It should be decided according to the actual situation .
边栏推荐
- C # using multithreading
- Xiaomi's one-sided interview questions (self sorting answers)
- 在 localStorage 中上传和检索存储图像
- Is it safe for Hangzhou Securities to open an account?
- 我的理财产品显示清算中是什么意思?
- 尝试使用RenderDoc查看UE的Shader代码
- Nfv basic overview
- FSM state machine
- Vsys of Isis (virtual system)
- RT-Thread 模拟器 simulator LVGL控件:switch 开关按钮控件
猜你喜欢
上位机开发(固件下载软件之详细设计)
10 Honest Facts I Want To Share With All Junior Developers
基于FPGA的ds18b20温度传感器使用
10 Honest Facts I Want To Share With All Junior Developers
Br tool backup recovery
不间断管理设计
Application of DS18B20 temperature sensor based on FPGA
【马尔科夫链-蒙特卡罗】马尔科夫链-蒙特卡罗方法对先验分布进行抽样
SDN基本概述
Make cer/pfx public and private key certificates and export CFCA application certificates
随机推荐
In the era of membership based social e-commerce, how do businesses build their own private domain traffic pool?
What does my financial product mean in clearing?
Can flush open a stock account? Is it safe?
15、 IO stream (I)
【RS-422与RS-485】RS-422与RS-485串行接口标准
Intelligent entertainment has developed steadily, and jinglianwen technology provides data collection and labeling services
Differences between SQL and NoSQL of mongodb series
[Tencent Alibaba's most comprehensive collection of test questions] (four sides: three rounds of technology +1 round of HR)
号称下一代监控系统 来看看它有多牛逼
The new business outlet of beautiful Tiantian second mode will be popular in the Internet e-commerce market
Xuanwu cloud technology passed the listing hearing: the performance fluctuated significantly, and chenyonghui and other three were the controlling shareholders
Learning notes of MySQL series by database and table
在 localStorage 中上传和检索存储图像
Smart finance is upgraded again, and jinglianwen technology provides data collection and labeling services
Chain 2+1 reward, what kind of mode is beautiful everyday seconds?
C drawing table and sending mail function
ML之FE:Vintage曲线/Vintage分析的简介、计算逻辑、案例应用之详细攻略
Detailed description of drawing ridge plot, overlapping densities of overlapping kernel density estimation curve, facetgrid object and function sns Kdeplot, function facetgrid map
数字时代进化论
c#高級編程-特性篇