zoukankan      html  css  js  c++  java
  • rename交换表名字对其他对象及授权的影响实验

    很久不来了,一直忙,今天来看看,刚刚做了一个关于海量数据在线分区方案的测试(oracle 10.2.0.1 for 32 bit winxp):

    --创建user:tt并授权
    sqlplus / as sysdba
    create user tt identified by tt default tablespace users temporary tablespace temp;
    grant connect to tt;

    --user:test下创建表及基于它的过程、函数、视图、同义词,并给user:tt授权
    sqlplus test/test

    create or replace procedure p_test
    is
    begin
    insert into test values(10,'ww');
    commit;
    end p_test;
    /

    create or replace FUNCTION F_test return char
    as
      v_cnt int;
      begin
      select count(*) into v_cnt from test;
      return v_cnt;
    end;
    /

    create or replace view v_test
    as
    select * from test;

    create or replace synonym s_test for test;

    grant select on test to tt;

    --user:tt下检查test.test表查询
    sqlplus tt/tt
    select * from test.test;

    --测试:
    sqlplus test/test

    create table test_bk as select * from test;
    rename test to test_old;
    rename test_bk to test;

    sqlplus tt/tt
    select * from test.test

    connect test/test
    select * from v_test;
    select * from s_test;
    select f_test() from dual;
    exec p_test;


    --结果:
    1、授权(select on test)失效;
    2、过程(p_test)、函数(f_test)、视图(v_test)失效,但使用时会自动编译;
    3、同义词(s_test)不失效;
     

    Oracle & Mysql & Postgresql & MSSQL 调优 & 优化
    ----------------------------------------------------------
    《高性能SQL调优精要与案例解析》
    blog1:http://www.cnblogs.com/lhdz_bj
    blog2:http://blog.itpub.net/8484829
    blog3:http://blog.csdn.net/tuning_optmization
  • 相关阅读:
    WAF绕过方法
    ”非常危险“的Linux命令
    CSRF--花式绕过Referer技巧
    安卓手机的后门控制工具SPADE
    基于RedHat发行的Apache Tomcat本地提权漏洞
    SQL注入--宽字节注入
    MySQL提权
    CF1067D. Computer Game(斜率优化+倍增+矩阵乘法)
    CF1063F. String Journey(后缀数组+线段树)
    BZOJ4732. [清华集训2016]数据交互(树链剖分+线段树+multiset)
  • 原文地址:https://www.cnblogs.com/lhdz_bj/p/2369761.html
Copyright © 2011-2022 走看看