Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problem with DBMS_REDEFINITION.START_REDEF_TABLE using a SEQUENCE

plhtyukOct 17 2011 — edited Oct 18 2011
Hi eveyrone,

I try to use the DBMS_REDEFINITION package for the first time.

When I try to use an Oracle SEQUENCE in the column mapping string I receive an error :

Rapport d'erreur :
ORA-42008: une erreur s'est produite au cours de l'instanciation de la redéfinition
ORA-12018: l'erreur suivante est survenue pendant la génération du code pour "BRUNCARL"."T_REDEF_1_INTERIM"
ORA-00917: virgule absente
ORA-06512: à "SYS.DBMS_REDEFINITION", ligne 52
ORA-06512: à "SYS.DBMS_REDEFINITION", ligne 1634
ORA-06512: à ligne 7
42008. 0000 - "error occurred while instantiating the redefinition"
*Document: YES
*Cause: An error occurred while instantiating the online redefinition
which requires aborting the redefinition.
*Action: Correct the error, abort, and restart the online redefinition.

Here is my code:

create table t_redef_1 (my_id number(19) not null, val_1 number(2));
insert into t_redef_1 values (1, 5);
insert into t_redef_1 values (1, 7);

create table t_redef_1_interim (my_id number(19) not null, val_1 number(2));
create sequence t_redef_seq;

declare
l_colmap varchar(8000);
begin
l_colmap :=
*'t_redef_seq.NEXTVAL my_id,*
val_1';
dbms_redefinition.start_redef_table
*( uname => 'BRUNCARL',*
orig_table => 'T_REDEF_1',
int_table => 'T_REDEF_1_INTERIM',
orderby_cols => 'VAL_1',
col_mapping => l_colmap,
options_flag => dbms_redefinition.CONS_USE_ROWID);
end;
*/*

If I use a static value (e.g. 1) indstead of t_redef_seq.NEXTVAL for the col_mapping value, it work:

...
begin
l_colmap :=
*'1 my_id,*
val_1';
...

Any help will be appreciated.

Best regards.

Carl
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 15 2011
Added on Oct 17 2011
1 comment
605 views