[oracle@crl ~]$ rlwrap sqlplus / as sysdba
  
  SQL*Plus: Release 11.2.0.4.0 Production on Tue May 16 14:59:27 2017
  
  Copyright (c) 1982, 2013, Oracle. All rights reserved.
  
  Connected to:
  
  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  
  SQL> create table z2 as select 1 as a from dual;
  
  Table created.
  
  SQL> grant select on z2 to dwetl;
  
  Grant succeeded.
  
  SQL>
  
  2、以dwetl账号登陆,对表进行查询权限,查询OK,能访问数据
  
  [oracle@crl ~]$ rlwrap sqlplus 'dwetl/"pwd2017"'@DB1
  
  SQL*Plus: Release 11.2.0.4.0 Production on Tue May 16 14:59:01 2017
  
  Copyright (c) 1982, 2013, Oracle. All rights reserved.
  
  Connected to:
  
  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  
  SQL> select * from sys.z2;
  
  A
  
  ----------
  
  3、再以sys登陆,删除表z2后,再次建立表z2
  
  [oracle@crl ~]$ rlwrap sqlplus / as sysdba
  
  SQL*Plus: Release 11.2.0.4.0 Production on Tue May 16 14:59:27 2017
  
  Copyright (c) 1982, 2013, Oracle. All rights reserved.
  
  Connected to:
  
  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  
  SQL> drop table sys.z2;
  
  Table dropped.
  
  SQL> create table z2 as select 1 as a from dual;
  
  Table created.
  
  SQL>
  
  SQL> select * from sys.z2;
  
  A
  
  4、再以dwetl登陆,看是否可以查询到,答案是查不到,报错表或者视图不存在
  
  [oracle@crl ~]$ rlwrap sqlplus 'dwetl/"pwd2017"'@DB1
  
  SQL*Plus: Release 11.2.0http://www.xuancai88c.cn/ .4.0 Production on Tue May 16 15:03:10 2017
  
  Copyright (c) 1982, 2013,http://027yeshenghuowang.com/ Oracle. All rights reserved.
  
  Connected to:
  
  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data feilcheng88.cn Mining and Real Application Testing options
  
  SQL> select * from sys.z2;
  
  select * from sys.z2
  
  *
  
  ERROR at line 1:
  
  ORA-00942: table or view does not exist
  
  5,再次以sys登陆,赋予表z2给dwetl的权限
  
  [oracle@crl ~]$ rlwrap sqlplus / as sysdba
  
  SQL*Plus: Release 11.2.0.4.0 Production on Tue May 16 15:14:16 2017
  
  Copyright (c) 1982, 2013, Oracle. All rights reserved.
  
  Connected to:
  
  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  
  SQL> grant select on z2 to dwetl;
  
  Grant succeeded.
  
  6,再次以dwetl登陆,尝试是否可以查询到sys.z2表,OK,可以查询到数据了
  
  [oracle@crl ~]$ rlwrap sqlplus 'dwetl/"pwd2017"'@DB1
  
  SQL*Plus: Release 11.2.0.4.0 Production on Tue May 16 15:14:57 2017
  
  Copyright (c) 1982, 2013, Oracle. All rights reserved.
  
  Connected to:
  
  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  
  SQL> select * from sys.z2;
  
  A
  
  ----------
  
  7、truncate对权限有无影响?
  
  以sys登陆,执行truncate操作表z2www.lafeiyl.cn,然后退出,以dwetl登陆查询表z2,发现可以执行select操作
  
  SQL> truncate table z2;
  
  Table truncated.
  
  SQL> exit
  
  ERROR:
  
  ORA-04088: error during execution of trigger 'TIMDBA.TRIG_LOGOFF_AUDIT'
  
  ORA-01403: no data found
  
  ORA-06512: at line 5
  
  Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data Mining and Real Application Testing options (with complications)
  
  [oracle@crl ~]$ rlwrap sqlplus 'dwetl/"pwd2017"'@DB1
  
  SQL*Plus: Release 11.2.0.4.0 Production on Tue May 16 15:18:08 2017
  
  Copyright (c http://www.yiqianou.cn/) 1982, 2013, Oracle. All rights reserved.
  
  Connected to:
  
  Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
  
  With the Partitioning, OLAP, Data Mining and Real Application Testing options
  
  SQL> select * from sys.www.yigouyule2.cn/ z2;
  
  no rows selected
  
  SQL>
  
  以上测试实验结论标识:
  
  (1):当表被drop掉后,别的用户对这个表的操作权限失效了,请记得重新grant下权限,不然另外的用户就无法对表进行操作;
  
  (2):当表被truncate之后,别的用户对这张表的操作权限依然有效。
  
  顶
  
  1

Oracle drop table 和 truncate table对grant授权的影响的更多相关文章

  1. delete table 和 truncate table

    delete table 和 truncate table 使用delete语句删除数据的一般语法格式: delete [from] {table_name.view_name} [where< ...

  2. MySQL删除大表时潜在的问题(drop table,truncate table)

    来源于:https://www.cnblogs.com/CtripDBA/p/11465315.html,侵删,纯截图,避免吸引流量之嫌 case1,删除大表时,因为清理自适应hash索引占用的内容导 ...

  3. 【转载】delete table 和 truncate table 的区别

    使用delete语句删除数据的一般语法格式: delete [from] {table_name.view_name} [where] 将XS表中的所有行数据删除 delete XS 执行完后,发现X ...

  4. Navicat工具里的empty table和truncate table的区别

    如图: 相同点:都会清空数据表里的所有数据 不同点:empty table是清空表里的数据:truncate table是删除表,然后再创建这张表 意义:对于主索引自动增加的情况,empty清表后,新 ...

  5. Oracle DROPtable以及Truncate table 的简单测试

    1. 一个用户库 有一个业务表比较大 大小是 49g 表的行数为:121546147 一亿两千万行 制作一个虚拟机的快照测试一下 drop table 和 truncate table的性能差距 2. ...

  6. 关于 truncate table 的一点学习札记

    ---下面整理笔记来之 itpub 的各位前辈的语录.这里做了一个汇总.仅供学习. truncate table后,oracle会回收表和其表中所在的索引到initial 大小,也就是初始分配的seg ...

  7. SQL中truncate table和delete的区别

    truncate table table_name delete from table_name drop table table_name truncate table在功能上与不带where子句的 ...

  8. truncate table 和delete

    delete table 和 truncate table 使用delete语句删除数据的一般语法格式: delete [from] {table_name.view_name} [where< ...

  9. [Hive - LanguageManual] Create/Drop/Alter Database Create/Drop/Truncate Table

    Hive Data Definition Language Hive Data Definition Language Overview Create/Drop/Alter Database Crea ...

随机推荐

  1. CF613D Kingdom and its Cities 虚树

    传送门 $\sum k \leq 100000$虚树套路题 设$f_{i,0/1}$表示处理完$i$以及其所在子树的问题,且处理完后$i$所在子树内是否存在$1$个关键点满足它到$i$的路径上不存在任 ...

  2. Luogu3220 HNOI2012 与非 数位DP

    传送门 题意:给出$N$个范围在$[0,2^k-1]$的整数,定义位运算$NAND$为位运算$AND$的逆运算,求$[L,R]$中有多少数能成为若干个前面给出的整数.若干括号和$NAND$运算组成的表 ...

  3. React-redux-saga

    新建sagas.js import { takeEvery , put} from 'redux-saga/effects' import axios from 'axios'; import { G ...

  4. 如何使用 GroupBy 计数-Count()

    十年河东,十年河西,莫欺少年穷. 本节探讨的内容很简单,就是如果使用GroupBy计数 提供两种方法:第一:把查询的数据,转化为泛型,然后泛型分组计数. 第二:Linq语句直接分组计数 有如下范例: ...

  5. [Spark][Hive]外部文件导入到Hive的例子

    外部文件导入到Hive的例子: [training@localhost ~]$ cd ~[training@localhost ~]$ pwd/home/training[training@local ...

  6. Opencv 2.4.10 +VS2010 项目配置

    资料来源:http://blog.csdn.net/scottly1/article/details/40978625

  7. vue-cli 3.0 axios 跨域请求代理配置及生产环境 baseUrl 配置

    1. 开发环境跨域配置 在 vue.config.js 文件中: module.exports = { runtimeCompiler: true, publicPath: '/', // 设置打包文 ...

  8. 【C++】std::是什么?

    引例: #include<iostream> int main() { std::cout<<"我喜欢C++";//输出一句话 std::cout<& ...

  9. jdbc操作根据bean类自动组装sql,天啦,我感觉我实现了hibernate

    场景:需要将从ODPS数仓中计算得到的大额可疑交易信息导入到业务系统的mysql中供业务系统审核.最简单的方式是用阿里云的组件自动进行数据同步了.但是本系统是开放是为了产品化,要保证不同环境的可移植性 ...

  10. Python 工程管理及 virtualenv 的迁移

    virtualenv 是管理 python 工程的利器,它可以很好的帮你维护项目中的依赖,使用 virtualenv,还能保持 global 库的干净.不会被不同项目中的第三方库所污染. virtua ...