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

“grant create table to 用户” 和 “grant create any table to 用户” 有什么区别
有些地方用第一个,有些地方用第二个,不懂,请教一下。

------解决方案--------------------
create table
create any table
这两个权限是不一样的,后者可以创建其他的用户的table
------解决方案--------------------
区别还是有的,create table全县只能在本schema内建表,而any table是可以跨schema的。
官方文档如下:
CREATE TABLE
 Create tables in the grantee's schema.
 
CREATE ANY TABLE
 Create tables in any schema. The owner of the schema containing the table must have space quota on the tablespace to contain the table.
 

------解决方案--------------------
create table 只能在自己的schema下创建table;
create any table 可以在别人的schema下创建table,例如userA执行:create table userB.tableName(n char(1));给用户userb创建表tabelName

引用楼主 ndb96 的帖子:
有些地方用第一个,有些地方用第二个,不懂,请教一下。