当前位置:网站首页>Oracle creates users with query permission only
Oracle creates users with query permission only
2022-07-28 09:24:00 【Shen Gong】
One 、 Create user
-- Create user
create user USERB identified by " password " default tablespace Table space ;
-- Grant login permission
grant connect to estate_user;
-- Grant permission to query any table
grant select any table to userName;
Two 、 Grant permission to view all tables or a table or view under a user
-- stay USERA Query all tables under , form sql
select 'grant select on USERA.' || table_name || ' to USERB;' from user_tables;
-- stay USERA In the implementation of grant Of sql
grant select on USERA.tableA to USERB;
Sign in USERB Query table , You need to bring the user name of the original creation user : for example :
select * from USERA.TABLEA
3、 ... and 、 If you don't want to bring the original user name, you need to create synonyms
-- The first thing you need to sys User authorization USER_B Create synonym permissions :
GRANT CREATE SYNONYM TO USERB;
-- Create synonyms :
create synonym USERB.TABLENAME1 for USERA.TABLENAME1 ;
-- Batch create synonyms , stay USERA In the implementation of :
select 'grant select on USERA.' || table_name || ' to USERB;' from user_tables;
-- stay USERB In the implementation of grant sentence .
After building synonyms ,pl/sql developer See the table , Still can't see all the tables , But fortunately, it can USERB. Can point out all the watches :

View synonyms under users
SELECT * FROM DBA_SYNONYMS where OWNER = 'USERB';
Delete synonyms
drop synonym sysn_name;
Four 、 Delete user :
drop user htqryall cascade;
边栏推荐
- golang升级到1.18.4版本 遇到的问题
- 2022年起重机司机(限桥式起重机)考试题库及模拟考试
- 如何在多线程环境下使用 GBase C API ?
- TXT text file storage
- 训练一个自己的分类 | 【包教包会,数据都准备好了】
- QT基础练手小程序-简单计算器设计(附带源码,解析)
- IP protocol of network layer
- 2022高压电工考试模拟100题及模拟考试
- 【英语考研词汇训练营】Day 15 —— analyst,general,avoid,surveillance,compared
- QT basic hand training applet - simple calculator design (with source code, analysis)
猜你喜欢

Problems encountered in upgrading golang to version 1.18.4

2022 safety officer-b certificate examination simulated 100 questions and answers

Dn-detr paper accuracy, and analyze its model structure & 2022 CVPR paper

QT基础练手小程序-简单计算器设计(附带源码,解析)

网络层的IP协议

快速上手Flask(一) 认识框架Flask、项目结构、开发环境

技术分享| 快对讲综合调度系统

Title and answer of work permit for safety management personnel of hazardous chemical business units in 2022

2022 safety officer-c certificate special operation certificate examination question bank and answers
![Map of China province > City > level > District > Town > village 5-level linkage download [2019 and 2021]](/img/ea/fd799bbef5110fddf4066e76892f81.png)
Map of China province > City > level > District > Town > village 5-level linkage download [2019 and 2021]
随机推荐
478-82(56、128、718、129)
侯捷STL标准库和泛型编程
2022年安全员-B证考试模拟100题及答案
Rgb-t tracking: [multimodal fusion] visible thermal UAV tracking: a large scale benchmark and new baseline
v-bind指令的详细介绍
C#简单调用FMU ,进行仿真计算
【SwinTransformer源码阅读二】Window Attention和Shifted Window Attention部分
会议OA系统
Introduction to official account
LeetCode_ 406_ Rebuild the queue based on height
QT basic hand training applet - simple calculator design (with source code, analysis)
mysql5.7.38容器里启动keepalived
推荐一个摆脱变量名纠结的神器和批量修改文件名方法
DN-DETR 论文精度,并解析其模型结构 & 2022年CVPR论文
1.5 merge\rebase\revert\stash\branch
个人博客小程序
负数的十六进制表示
正则表达式为十六进制数字?
Mysql5.7.38 start keepalived in the container
股指期货开户的条件和流程