请问我在 user A 的存储过程中,要修改 user b 的表的列 添加列,删除列,需要给 user A 什么权限?CREATE OR REPLACE PROCEDURE ddlproc  AS
 sqlw varchar2(200); BEGIN
sqlw :='ALTER TABLE TESTDB.tab1 add tname2 varchar2(50) not null ';
execute immediate sqlw;
end;

解决方案 »

  1.   

    grant insert,delete on B.TESTDB to A 
    oracle 包括系统权限和对象权限,grant resource,connect to userA   --授予系统权限
    grant DBA to userA  --授予角色
    grant select,update on A.Table1 to userB  --授予B 查询、更新A.Table1对象的权限
      

  2.   

    user B执行
    grant alter on TABLENAME to USERA;
      

  3.   

    谢谢!
    刚才没说明白。我要在User A 的存储过程中要修改 其他User 表的列,user不定,user表名也不定。
    user 名,表名,列名,列的类型,默认值等都是由参数传入的。请问如何比较简单的设定User A的权限?
      

  4.   

    system执行
    grant alter any table to USERA
      

  5.   

    bobfang(匆匆过客)
    我的USERA 是METADATA
    给了下面的权限。
    grant alter any cluster to METADATA;
    grant alter any table to METADATA;
    grant comment any table to METADATA;
    grant create any index to METADATA;
    grant create any sequence to METADATA;
    grant create any table to METADATA;
    grant create table to METADATA;
    grant delete any table to METADATA;
    grant drop any sequence to METADATA;
    grant drop any table to METADATA;
    grant execute any operator to METADATA;
    grant unlimited tablespace to METADATA;可以在存储过程中,创建别的user的表,并添加主键,创建序列发生器,
    但进行alter table 时,还是报权限不足。
      

  6.   

    oracle在修改表结构之前,需要先查询该表的结构,所以不能简单授予alter any table 
    最好:
    grant select any table to METADATA;
    grant select any dictionary to METADATA;
    试试看