[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. 个人博客地址: furur.xyz

    趁着Hexo的热度,最近就买了域名,在GitHub Pages上搭了个人博客.也不是说博客园不好吧,毕竟在博客园三年多,也学到了不少东西,唯一要吐槽的,估计也就是后台管理不方便,markdown无即时 ...

  2. TRIO-basic指令--九九乘法表demo

    在路上闲的没事,想到之前自己用别的语言实现乘法口诀表,于是来了兴趣用TRIO-basic试一下,挺简单的一段代码,大家看看就好. ' TRIO-basic '实现乘法口诀表 定义两个整型的局部变量 D ...

  3. 002-打开文件管理规范-20190406.bat

    rem 002-打开文件管理规范-20190406.bat start /max https://www.cnblogs.com/delphixx/p/10652763.htmlcopy %~0 C: ...

  4. 最好使用%f输出浮点数据,acm

    今天做题的时候发现使用%lf输出的时候总是wrong,而一旦改成%f就ac了,询问学长后知道,不要用%lf输出,浮点都用%f 然而我还是有疑惑,如果%f容不下输出的数据怎么办呢? 于是我就去百度 原来 ...

  5. 20135218 Linux 实践二 编译模块

    20135218 姬梦馨 1.编写模块代码 模块构造函数:执行insmod或modprobe指令加载内核模块时会调用的初始化函数.函数原型必须是module_init(),括号内是函数指针 模块析构函 ...

  6. Linux内核分析作业第六周

    创建新进程的过程 一.进程的描述 为了管理进程,内核必须对每个进程进行清晰的描述,进程描述符提供了内核所需了解的进程信息. 1.进程控制块PCB——task_struct 操作系统的三大管理功能 进程 ...

  7. SprngMVC源码学习

    运行helloWorld示例进入调试界面. DispatcherServlet:前端控制器 DispatcherServlet.doDispatch(HttpServletRequest, HttpS ...

  8. David Silver强化学习Lecture1:强化学习简介

    课件:Lecture 1: Introduction to Reinforcement Learning 视频:David Silver深度强化学习第1课 - 简介 (中文字幕) 强化学习的特征 作为 ...

  9. HTML5 Base64_encoding_and_decoding

    https://developer.mozilla.org/en-US/docs/Web/API/WindowBase64/Base64_encoding_and_decoding In JavaSc ...

  10. Mysql 5.7.21 单机多实例安装

    下载MySQL 5.7 二制包 [root@MySQL ~]# wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.21-linu ...