eygle.com   eygle.com
eygle.com  
 
eygle.com - 留言簿 - 回复留言 - Powered by eYgLe.Com
返回留言簿
回 复 留 言
留言ID:
留言原文:
To: eygle
  老虎,帮帮忙吧,我们现在用的是oracle erp ,db 8174
现在我想吧所与owner得table的所有权付给apps,并授权grant权限,但是就是不知道执行sqlplus得时候应该用那个用户执行?apps我也试过了,提示不能授权给自己
脚本如下:
$vi b.sql
declare username varchar2(100) default 'SYS';
begin
for tablelist in (select owner,table_name from dba_tables
  where owner not in ('SYS','SYSTEM','APPS') order by 1 )
loop
if tablelist.owner<> username then
execute immediate 'alter session set current_schema = '||tablelist.owner||'';
username = tablelist.owner;
end if;
execute immediate 'grant all on '||tablelist.owner||'.'||tablelist.table_name ||' to apps with grant option';
end loop;
end;
/
$svrmgrl
SVRMGR> connect internal
Connected.
SVRMGR> @b.sql
ORA-01929: no privileges to GRANT
ORA-06512: at line 10
SVRMGR>
$ sqlplus apps/apps@b.sql

SQL*Plus: Release 8.1.7.0.0 - Production on Fri May 6 13:47:42 2005

(c) Copyright 2000 Oracle Corporation.All rights reserved.


Connected to:
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
With the Partitioning option
JServer Release 8.1.7.4.0 - Production

declare username varchar2(100) default 'SYS';
*
ERROR at line 1:
ORA-01749: you may not GRANT/REVOKE privileges to/from yourself
ORA-06512: at line 10




From: Remen
2005.05.05 22:43
管理密码: 请输入管理密码, 否则无法回复.
斑竹昵称:
信息图标: ( 随机 )


BB 代码:
内容:

如果想删除回复, 请点击最下面的删除回复按钮.
删 除 回 复
管理密码: 请输入管理员密码, 只有版主才能删除回复.
Copyright © 2003~2012 eygle.com All Rights Reserved.
Powered by: www.eygle.com