I ran this as a part of redefining a table
DECLARE l_num_ers PLS_INTEGER; BEGIN DBMS_REDEFINITION.copy_table_dependents( uname => 'myuser', orig_table => 'mytable', int_table => 'redef', copy_indexes => DBMS_REDEFINITION.cons_orig_params, copy_triggers => TRUE, copy_constraints => TRUE, copy_privileges => TRUE, ignore_errors => FALSE, num_errors => l_num_ers); DBMS_OUTPUT.put_line('l_num_ers=' || l_num_ers); END; /
And got the error
ORA-01749: you may not GRANT/REVOKE privileges to/from yourself ORA-06512: at "SYS.DBMS_REDEFINITION", line 752 ORA-06512: at "SYS.DBMS_REDEFINITION", line 1698
So how can I solve this?. The same code worked on another database where the only difference I've found is that the user myuser did not have select right on the table.
Select PRIVILEGE, GRANTEE from dba_tab_privs where owner = 'MYUSER' and TABLE_NAME = 'MYTABLE';
To find the differences.
Is the solution to revoke my own privilege to the table?