12
返回列表 发新帖
楼主: mylajitong

这是不是一个隐患啊?(在别的表空间操作)应该如何避免?

[复制链接]
论坛徽章:
3
2010年世界杯参赛球队:墨西哥
日期:2010-08-12 13:54:05ITPUB9周年纪念徽章
日期:2010-10-08 09:28:512011新春纪念徽章
日期:2011-02-18 11:43:35
11#
发表于 2010-7-1 16:25 | 只看该作者
原帖由 Yong Huang 于 2010-6-30 05:35 发表


I find something new today. In 11gR2 (specifically mine is 11.2.0.1), but not in any other version, not even 11gR1, if you previously gave unlimited quota on a tablespace to a user, granted resource role, then revoking unlimited tablespace privilege will remove his unlimited quota on that tablespace.


SQL> create user u identified by u123456 quota unlimited on users;

User created.

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

TABLESPACE_NAME        BYTES    MAX_BYTES
--------------- ------------ ------------
USERS                      0           -1

SQL> grant resource to u;

Grant succeeded.

SQL> select privilege from dba_sys_privs where grantee = 'U';

PRIVILEGE
----------------------------------------
UNLIMITED TABLESPACE

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

TABLESPACE_NAME        BYTES    MAX_BYTES
--------------- ------------ ------------
USERS                      0           -1

SQL> revoke unlimited tablespace from u;

Revoke succeeded.

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

no rows selected

SQL> alter user u quota unlimited on users;

User altered.

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

TABLESPACE_NAME        BYTES    MAX_BYTES
--------------- ------------ ------------
USERS                      0           -1

SQL> select privilege from dba_sys_privs where grantee = 'U';

no rows selected

SQL> select * from v$version where rownum = 1;

BANNER
----------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production


This does not happen in my 11.1.0.6 database, and does not happen if I give quota of some specific number (instead of "unlimited"). There may be a note on MOS but I haven't checked.

Yong Huang


这个应该逻辑上是正确的吧,回收所有ST的权限(不包括默认表空间),应该会收回其他表空间的quota吧

使用道具 举报

回复
论坛徽章:
0
12#
发表于 2010-7-2 02:39 | 只看该作者
家用电器的使用寿命随着时间的流失而减小,虽然电器本身没有发生故障,但电器本身也有寿终的时候,这就是家用电器的使用寿命。

使用道具 举报

回复
论坛徽章:
1
ITPUB9周年纪念徽章
日期:2010-10-08 09:28:51
13#
 楼主| 发表于 2010-7-8 17:44 | 只看该作者
原帖由 Yong Huang 于 2010-6-30 05:35 发表


I find something new today. In 11gR2 (specifically mine is 11.2.0.1), but not in any other version, not even 11gR1, if you previously gave unlimited quota on a tablespace to a user, granted resource role, then revoking unlimited tablespace privilege will remove his unlimited quota on that tablespace.


SQL> create user u identified by u123456 quota unlimited on users;

User created.

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

TABLESPACE_NAME        BYTES    MAX_BYTES
--------------- ------------ ------------
USERS                      0           -1

SQL> grant resource to u;

Grant succeeded.

SQL> select privilege from dba_sys_privs where grantee = 'U';

PRIVILEGE
----------------------------------------
UNLIMITED TABLESPACE

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

TABLESPACE_NAME        BYTES    MAX_BYTES
--------------- ------------ ------------
USERS                      0           -1

SQL> revoke unlimited tablespace from u;

Revoke succeeded.

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

no rows selected

SQL> alter user u quota unlimited on users;

User altered.

SQL> select tablespace_name, bytes, max_bytes from dba_ts_quotas where username = 'U';

TABLESPACE_NAME        BYTES    MAX_BYTES
--------------- ------------ ------------
USERS                      0           -1

SQL> select privilege from dba_sys_privs where grantee = 'U';

no rows selected

SQL> select * from v$version where rownum = 1;

BANNER
----------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production


This does not happen in my 11.1.0.6 database, and does not happen if I give quota of some specific number (instead of "unlimited"). There may be a note on MOS but I haven't checked.

Yong Huang


感谢大牛继续关注这个问题。

使用道具 举报

回复
论坛徽章:
1
ITPUB9周年纪念徽章
日期:2010-10-08 09:28:51
14#
 楼主| 发表于 2010-7-8 17:46 | 只看该作者
原帖由 不再画地为牢 于 2010-7-1 16:25 发表


这个应该逻辑上是正确的吧,回收所有ST的权限(不包括默认表空间),应该会收回其他表空间的quota吧



我觉得逻辑上应该也说得通, 但这个问题要不是 Yong Huang 提出来,大家估计都还没注意到这个细节呢。

使用道具 举报

回复

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

TOP技术积分榜 社区积分榜 徽章 团队 统计 知识索引树 积分竞拍 文本模式 帮助
  ITPUB首页 | ITPUB论坛 | 数据库技术 | 企业信息化 | 开发技术 | 微软技术 | 软件工程与项目管理 | IBM技术园地 | 行业纵向讨论 | IT招聘 | IT文档
  ChinaUnix | ChinaUnix博客 | ChinaUnix论坛
CopyRight 1999-2011 itpub.net All Right Reserved. 北京盛拓优讯信息技术有限公司版权所有 联系我们 未成年人举报专区 
京ICP备16024965号-8  北京市公安局海淀分局网监中心备案编号:11010802021510 广播电视节目制作经营许可证:编号(京)字第1149号
  
快速回复 返回顶部 返回列表