当前位置:网站首页>Oracle收回权限 & 创建角色
Oracle收回权限 & 创建角色
2022-07-03 09:46:00 【喝醉酒的小白】
0、收回权限
SELECT 'REVOKE '||PRIVILEGE||' FROM BAIPX;' FROM dba_sys_privs WHERE GRANTEE='BAIPX';
1、收回dba权限
revoke dba from BAIPX;
2、创建角色并授权相关权限
create role BAIPX_ROLE;
grant select on v_$sysstat to BAIPX_ROLE;
grant delete any table to BAIPX_ROLE;
grant insert any table to BAIPX_ROLE;
grant select any table to BAIPX_ROLE;
grant unlimited tablespace to BAIPX_ROLE;
grant execute any procedure to BAIPX_ROLE;
grant update any table to BAIPX_ROLE;
grant SELECT ANY TABLE to BAIPX_ROLE;
grant CREATE VIEW to BAIPX_ROLE;
grant ALTER SESSION to BAIPX_ROLE;
grant DROP PUBLIC SYNONYM to BAIPX_ROLE;
grant CREATE DATABASE LINK to BAIPX_ROLE;
grant CREATE ANY DIRECTORY to BAIPX_ROLE;
grant SELECT ANY DICTIONARY to BAIPX_ROLE;
grant CREATE SYNONYM to BAIPX_ROLE;
grant CREATE PUBLIC SYNONYM to BAIPX_ROLE;
grant CREATE TYPE to BAIPX_ROLE;
grant CREATE LIBRARY to BAIPX_ROLE;
grant CREATE PUBLIC DATABASE LINK to BAIPX_ROLE;
grant CREATE TRIGGER to BAIPX_ROLE;
grant DEBUG CONNECT SESSION to BAIPX_ROLE;
grant CREATE TABLE to BAIPX_ROLE;
grant CREATE CLUSTER to BAIPX_ROLE;
grant CREATE SESSION to BAIPX_ROLE;
grant CREATE SEQUENCE to BAIPX_ROLE;
grant DROP PUBLIC DATABASE LINK to BAIPX_ROLE;
grant CREATE PROCEDURE to BAIPX_ROLE;
3、把角色授予给用户
grant BAIPX_ROLE to BAIPX;
grant connect, resource to BAIPX;
grant unlimited tablespace to BAIPX;
4、查看用户权限
###查询某用户的被赋予的系统权限
select * from dba_sys_privs where GRANTEE='BAIPX';
###查询某用户被赋予的角色权限
select * from dba_role_privs where GRANTEE='BAIPX';
###查询角色内包含的权限
select * from role_sys_privs where role='BAIPX';
授予相同权限
select table_name from dict where table_name like '%PRIVS%';
select 'grant '|| PRIVILEGE|| ' ' || ' on ' || OWNER||'.'|| TABLE_NAME||' TO ' || GRANTEE|| ';'from dba_tab_privs where grantee='WSCRM';
select 'grant '|| GRANTED_ROLE || ' to ' || GRANTEE||';' from dba_role_privs where grantee='WSCRM';
select 'grant '|| privilege|| ' to ' || grantee||';' from dba_sys_privs where grantee='WSCRM';
边栏推荐
- STM32F1与STM32CubeIDE编程实例-TM1637驱动4位7段数码管
- Communication software development and Application
- Solutions of n-ary linear equations and their criteria
- 软件测试(测试用例)编写之俗手、本手、妙手
- Strategic management of project organization
- snownlp情感分析
- 做软件测试三年,薪资不到20K,今天,我提出了辞职…
- What is the salary level of 17k? Let's take a look at the whole interview process of post-95 Test Engineers
- 游戏测试相关 测试一个英雄的技能(春招被问比较多的一道题)
- ConstraintLayout跟RelativeLayout嵌套出现的莫名奇妙的问题
猜你喜欢
软件测试必学基本理论知识——APP测试
The normal one inch is 25.4 cm, and the image field is 16 cm
现在零基础转行软件测试还OK吗?
I, a tester from a large factory, went to a state-owned enterprise with a 50% pay cut. I regret it
T5 的尝试
Qt:qss custom qscrollbar instance
反正切熵(Arctangent entropy):2022.7月最新SCI论文
MAUI Developer Day in GCR
T5 attempt
在职美团测试工程师的这八年,我是如何成长的,愿技术人看完都有收获
随机推荐
Rollup, cube and grouping sets functions of grouping functions
Typescript learning summary
做软件测试三年,薪资不到20K,今天,我提出了辞职…
软件测试——Redis数据库
Exclusive analysis | truth about resume and interview
Differences among norm, normalize and normalized in eigen
How to realize automatic testing in embedded software testing?
Activity and fragment lifecycle
snownlp情感分析
Flink < --> Introduction to JDBC +with parameter
Qt:qss custom qmenubar instance
QT:QSS自定义 QMenuBar实例
Do you really need automated testing?
sqlmap基本使用方法
嵌入式軟件測試怎麼實現自動化測試?
The testing department of the company came to the king of the Post-00 roll, and the veteran exclaimed that it was really dry, but
“测试人”,有哪些厉害之处?
在职美团测试工程师的这八年,我是如何成长的,愿技术人看完都有收获
独家分析 | 关于简历和面试的真 相
11. Provider service registration of Nacos service registration source code analysis