5

我正在尝试对现有表进行分区而不使用 Oracle 删除和重新创建它。

我的 Oracle 10g 支持应用程序中的 DBMS_REDEFINITION 包

我已经按照 oracle 文档中的说明向用户授予了所有必要的权限。

grant CREATE ANY TABLE to DDUSER;
grant ALTER ANY TABLE to DDUSER;
grant DROP ANY TABLE to DDUSER;
grant LOCK ANY TABLE to DDUSER;
grant SELECT ANY TABLE to DDUSER;
grant execute on dbms_redefinition to DDUSER;

我能够执行以下程序

begin
Dbms_Redefinition.Can_Redef_Table('DDUSER', 'TABLE');
end;
This throws no error neither any result (Assuming this is as expected)

但是当我试图跑步时

BEGIN
  DBMS_REDEFINITION.start_redef_table(
    uname      => 'DDUSER',        
    orig_table => 'TABLE',
    int_table  => 'TABLE_1');
END;

我收到以下错误:

错误报告:
ORA-01031:权限不足
ORA-06512:在“SYS.DBMS_REDEFINITION”第 50 行
ORA-06512:在“SYS.DBMS_REDEFINITION”第 1343 行
ORA-06512:在第 2 行
01031.00000 -“权限不足”

你能帮我吗,我在这里缺少什么特权?或者是否知道在包 DBMS_REDEFINITION 的第 50 行中执行了哪个操作?

4

4 回答 4

3

试试这个:

grant DROP ANY INDEX to DDUSER;
grant CREATE ANY INDEX to DDUSER;

如果表包含索引(很可能就是这种情况),则必须创建新索引。

于 2014-05-22T13:49:20.220 回答
2

我刚刚遇到了这个问题。我在 start_redef_table 上遇到了完全相同的错误。

所以在搜索了很多之后,我给了用户以下权限并且它起作用了。

grant execute on dbms_redefinition package to myuser (你已经有了)

然后

grant CREATE ANY TABLE to myuser;

grant  ALTER ANY TABLE to myuser;

grant  DROP ANY TABLE to myuser;

grant LOCK ANY TABLE to myuser;

grant SELECT ANY TABLE to myuser;

赋予这些权限后 start_redef_table 工作正常。

于 2018-07-15T05:45:49.537 回答
1

在 Oracle 12c 上,有额外的系统特权“REDEFINE ANY TABLE”。

这对我有用。

grant REDEFINE ANY TABLE  to myUser;
grant ADMINISTER DATABASE TRIGGER to myUser;
grant ALTER ANY INDEX to myUser; 
grant ALTER ANY MATERIALIZED VIEW to myUser;
grant ALTER ANY SEQUENCE to myUser;
grant ALTER ANY TRIGGER to myUser;
grant CREATE ANY INDEX to myUser;
grant CREATE ANY MATERIALIZED VIEW to myUser;
grant CREATE ANY SEQUENCE to myUser;
grant CREATE ANY TABLE to myUser;
grant CREATE ANY TRIGGER to myUser;
grant CREATE ANY VIEW to myUser;
grant CREATE MATERIALIZED VIEW to myUser;
grant CREATE SESSION to myUser;
grant CREATE VIEW to myUser;
grant DROP ANY INDEX to myUser;
grant DROP ANY MATERIALIZED VIEW to myUser;
grant DROP ANY SEQUENCE to myUser;
grant DROP ANY TRIGGER to myUser;
grant DROP ANY VIEW to myUser;
grant EXECUTE ANY PROCEDURE to myUser;
grant INSERT ANY TABLE to myUser;
grant MERGE ANY VIEW to myUser;
grant SELECT ANY DICTIONARY to myUser;
grant SELECT ANY TABLE to myUser;
grant UNDER ANY VIEW to myUser;
grant UPDATE ANY TABLE to myUser;

祝你好运

于 2018-02-20T10:29:44.110 回答
0

添加此内容后,您缺少 CREATE Materialized View 我已成功重新定义为普通用户

对于 Oracle 12.1 指令说 https://docs.oracle.com/database/121/ARPLS/d_redefi.htm#ARPLS67511

我想在其他版本中可能是一样的

grant CREATE MATERIALIZED VIEW 
grant CREATE TABLE 
grant EXECUTE on dbms_redefinition 
于 2020-06-05T08:00:09.297 回答