当前位置:网站首页>oracle创建只读权限的用户简单四步走
oracle创建只读权限的用户简单四步走
2022-07-02 02:11:00 【leowang5566】
第一步、创建用户。使用有管理员权限的用户创建一个新的用户:
create user 用户名 identified by 密码 default tablespace 表空间;
第二步、赋连接权限:
grant connect to 用户名;
第三步、赋表权限
grant select on owner.表名 to 用户名;
如果有多表,可以用selece转换批量执行语句:
select 'grant select on '||owner||'.'||object_name||' to 用户名;'
from dba_objects
where owner in ('owner')
and object_type='TABLE';
第四步、创建同义词:
create or replace SYNONYM 用户名.表名 FOR owner.表名;
如果有多表,可以用selece转换批量执行语句:
SELECT 'create or replace SYNONYM 用户名.'||object_name||' FOR '||owner||'.'||object_name||';' from dba_objects
where owner in ('owner')
and object_type='TABLE';
边栏推荐
- Sword finger offer II 031 Least recently used cache
- 大学的知识是否学而无用、过时?
- Which is a good Bluetooth headset of about 300? 2022 high cost performance Bluetooth headset inventory
- JMeter (II) - install the custom thread groups plug-in
- Makefile simple induction
- Open that kind of construction document
- STM32F103 - two circuit PWM control motor
- 软件开发生命周期 --瀑布模型
- Bash bounce shell encoding
- trading
猜你喜欢
How to use redis ordered collection
How to turn off debug information in rtl8189fs
Opencascade7.6 compilation
leetcode2310. The one digit number is the sum of integers of K (medium, weekly)
[Video] visual interpretation of Markov chain principle and Mrs example of R language region conversion | data sharing
leetcode2311. 小于等于 K 的最长二进制子序列(中等,周赛)
5g/4g pole gateway_ Smart pole gateway
软件开发生命周期 --瀑布模型
1069. Division of convex polygons (thinking, interval DP)
附加:信息脱敏;
随机推荐
Using mongodb in laravel
pytest 测试框架
What style of Bluetooth headset is easy to use? High quality Bluetooth headset ranking
Construction and maintenance of business websites [13]
The middle element and the rightmost element of the shutter
Failed to transform file 'xxx' to match attributes
Electronic Association C language level 1 33, odd even number judgment
Design and implementation of key value storage engine based on LSM tree
MySQL主从延迟问题怎么解决
正则表达式学习笔记
How to turn off debug information in rtl8189fs
leetcode2305. Fair distribution of biscuits (medium, weekly, shaped pressure DP)
Redis环境搭建和使用的方法
leetcode2309. The best English letters with both upper and lower case (simple, weekly)
321. Chessboard segmentation (2D interval DP)
Data analysis on the disaster of Titanic
C language 3-7 daffodils (enhanced version)
Openssl3.0 learning XXI provider encoder
Construction and maintenance of business websites [14]
Sword finger offer 42 Maximum sum of continuous subarrays