What's mean ORA-25191?[转帖]_MySQL, Oracle及数据库讨论区_Weblogic技术|Tuxedo技术|中间件技术|Oracle论坛|JAVA论坛|Linux/Unix技术|hadoop论坛_联动北方技术论坛  
网站首页 | 关于我们 | 服务中心 | 经验交流 | 公司荣誉 | 成功案例 | 合作伙伴 | 联系我们 |
联动北方-国内领先的云技术服务提供商
»  游客             当前位置:  论坛首页 »  自由讨论区 »  MySQL, Oracle及数据库讨论区 »
总帖数
1
每页帖数
101/1页1
返回列表
0
发起投票  发起投票 发新帖子
查看: 4427 | 回复: 0   主题: What's mean ORA-25191?[转帖]        下一篇 
wayne
注册用户
等级:中校
经验:1690
发帖:221
精华:0
注册:2011-7-21
状态:离线
发送短消息息给wayne 加好友    发送短消息息给wayne 发消息
发表于: IP:您无权察看 2011-7-24 18:54:49 | [全部帖] [楼主帖] 1  楼

在参考了 Using DBMS_SYS_SQL Package to grant Privilege留言板里有朋友继续问道,出现了以下错误:

ORA-25191: cannot reference overflow table of an index-organized table
ORA-06512: at "SYS.DBMS_SYS_SQL", line 1474
ORA-06512: at line 9


查一下Oracle手册,我们看到:

ORA-25191 cannot reference overflow table of an index-organized table

Cause: An attempt was made to directly access the overflow table of an index-organized table.
Action: Issue the statement against the parent index-organized table containing the specified overflow table.


意思是说,对于Overflow的IOT表,只需要对父表进行授权即可。简单动手自己试试看也可以:

SQL> connect eygle/eygle
Connected.
SQL> CREATE TABLE TEST_IOT
2 (id NUMBER PRIMARY KEY,
3 C1 VARCHAR2(50),
4 C2 VARCHAR2(10))
5 ORGANIZATION INDEX PCTTHRESHOLD 10 OVERFLOW;

Table created.

SQL> col object_name for a30
SQL> select object_name,object_type from user_objects where object_name like '%IOT%';

OBJECT_NAME OBJECT_TYPE
------------------------------ ------------------
SYS_IOT_OVER_7370 TABLE
SYS_IOT_TOP_7370 INDEX
TEST_IOT TABLE

SQL> grant select on SYS_IOT_OVER_7370 to scott;
grant select on SYS_IOT_OVER_7370 to scott
*
ERROR at line 1:
ORA-25191: cannot reference overflow table of an index-organized table

SQL>



Ok,那么接下来的就简单了,只要把我们之前的过程简单修改一下:

declare
sqltext varchar2(200);
c integer;
begin
for userlist in (select user_id,username from all_users where username not in ('SYS','SYSTEM','EYGLE')) loop
for tablelist in (select owner,table_name from dba_tables where owner = userlist.username and table_name not like '%IOT_OVER%') loop
sqltext := 'grant all on '||tablelist.owner||'.'||tablelist.table_name ||' to eygle with grant option';
c := sys.dbms_sys_sql.open_cursor();
sys.dbms_sys_sql.parse_as_user( c,sqltext,dbms_sql.native,userlist.user_id);
sys.dbms_sys_sql.close_cursor(c);
end loop;
end loop;
end;
/


这样就可以了.




赞(0)    操作        顶端 
总帖数
1
每页帖数
101/1页1
返回列表
发新帖子
请输入验证码: 点击刷新验证码
您需要登录后才可以回帖 登录 | 注册
技术讨论