# 920
lily
|
|
To: eygle
美好的假期终究是结束了又得奔命工作了遥远的”十一“期待你
From: lily 2005.05.07 18:28
|
|
|
|
To: lily
[COLOR=blue]俺马上就可以休假,又可以来一次长途旅行了[/COLOR]
From: eygle 2005.05.08 17:43
|
|
|
|
# 919
Sabrina
|
|
To:
明天就又离开北京了,不知道再见面是什么时候
From: Sabrina 2005.05.07 09:07
|
|
|
|
To: Sabrina
[COLOR=blue]也许用不了多久[/COLOR]
From: eygle 2005.05.08 17:42
|
|
|
|
# 916
Remen
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
To: Remen
[COLOR=blue]
使用dbms_sys_sql就可以了,写个完整的例子给你:
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) 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;
/
[/COLOR]
From: eygle 2005.05.06 18:09
|
|
|
|
# 914
vongates
|
|
To: eygle
謝謝eygle:
MKS我裝了,謝謝,看到它我就才想起來,之前裝Oracle ERP1157 For windows的時候用到它的。。真的很好用。再謝謝了
From: vongates 2005.04.30 22:22
|
|
|
|
To: vongates
[COLOR=blue]我也使从ERP开始使用MKS一直到现在[/COLOR]
From: eygle 2005.05.04 03:18
|
|
|
|
# 911
lily
|
|
To:
不太懂但总之心理很难过 我也不知为何
From: lily 2005.04.30 01:28
|
|
|
|
To: lily
[COLOR=blue]
阳光总在风雨后,也许对于她会是件好事也不一定啊。
[/COLOR]
From: eygle 2005.04.30 16:44
|
|
|
|
# 910
福鼎
|
|
To: eygle
五一好!!!!!!
距离总是在不断加大,和你这个14年的同学哥们,心里和现实的,祝你事业一路好!!!!!!!!!!
From: 福鼎 2005.04.29 22:17
|
|
|
|
To: 福鼎
[COLOR=blue]
五一快乐,有什么度假计划么?[/COLOR]
From: eygle 2005.04.30 01:04
|
|
|
|
|