日期:2014-05-17  浏览次数:21226 次

drop table系统授权的问题
为什么在oracle10i中,我在系统管理员用户下,却无法将drop table 系统权限授予其他用户:

SQL> connect sys/ab12345 as sysdba;
已连接。
SQL> grant drop table to gail;
grant drop table to gail
  *
第 1 行出现错误:
ORA-00990: 权限缺失或无效

------解决方案--------------------
grant drop any table to gail

------解决方案--------------------
SQL code

--首先drop any table 权限的描述是这样的
--Drop or truncate tables or table partitions in any schema.

--我们再看一下有没有drop table 这个权限

--查询一下SYSTEM_PRIVILEGE_MAP 表 
SQL> select * from SYSTEM_PRIVILEGE_MAP where name like 'DROP%TABLE' ;

 PRIVILEGE NAME                                       PROPERTY
---------- ---------------------------------------- ----------
       -44 DROP ANY TABLE                                    0
--没有drop table这个权限,怎么能删除自己建立的表呢?
--这是一个小例子
SQL> create user dex2013 identified by xiaojun default tablespace users ;

User created.

SQL> grant create session to dex2013 ;

Grant succeeded.

SQL> alter user dex2013 quota unlimited on users ;

User altered.

SQL> conn dex2013/xiaojun
Connected.
SQL> create table t (x int) ;

Table created.

SQL> drop table t ;

Table dropped.

--可以看到,只要你是对象的拥有者(must be in your own schema),就可以drop,view、SEQUENCE、INDEX同理.