MigraTI - Soluções em banco de dados

quarta-feira, 12 de maio de 2021

ORA-00604: error occurred at recursive SQL level 1 | ORA-00942: table or view does not exist

 Cliente estava com problemas em sua atualização, a atualização travava em uma tabela padrão do sistema onde ele adicionava duas colunas e depois apagava outras.

Ao tentar dropar uma coluna o erro abaixo aparecia, conforme:


SQL> ALTER TABLE R152PEN DROP(DTHTRA, CODERR);
ALTER TABLE R152PEN DROP(DTHTRA, CODERR)
*
ERROR at line 1:
ORA-00604: error occurred at recursive SQL level 1
ORA-00942: table or view does not exist

A tabela estava certa, com as colunas, meu primeiro teste foi verificar o case sensitive, mas também não resolveu.

Ao rodar um trace da minha sessão li o arquivo e estava com o seguinte erro:
Trace file: orcl_ora_13094_SESSAO_LANA.trc
Sort options: default

********************************************************************************
count    = number of times OCI procedure was executed
cpu      = cpu time in seconds executing 
elapsed  = elapsed time in seconds executing
disk     = number of physical reads of buffers from disk
query    = number of buffers gotten for consistent read
current  = number of buffers gotten in current mode (usually for update)
rows     = number of rows processed by the fetch or execute call
********************************************************************************

The following statement encountered a error during parse:

update radm_mc$ set intcol#=intcol#-:1 where (obj#=:2 or obj#=:3) and intcol#>:4 and intcol#<:5

Error encountered: ORA-00942
********************************************************************************
 

Pesquisei sobre essa tabela e descobri que basta cria-la, conforme abaixo:

create table SYS.RADM_MC$
(
obj# NUMBER not null,
intcol# NUMBER not null,
mfunc NUMBER not null,
mparams VARCHAR2(1000),
regexp_pattern VARCHAR2(512),
regexp_replace_string VARCHAR2(4000),
regexp_position NUMBER,
regexp_occurrence NUMBER,
regexp_match_parameter VARCHAR2(10),
mp_iformat_start_byte INTEGER,
mp_iformat_end_byte INTEGER,
mp_oformat_start_byte INTEGER,
mp_oformat_end_byte INTEGER,
mp_maskchar_start_byte INTEGER,
mp_maskchar_end_byte INTEGER,
mp_maskfrom INTEGER,
mp_maskto INTEGER,
mp_datmask_mo INTEGER,
mp_datmask_d INTEGER,
mp_datmask_y INTEGER,
mp_datmask_h INTEGER,
mp_datmask_mi INTEGER,
mp_datmask_s INTEGER
)
tablespace SYSTEM
pctfree 10
pctused 40
initrans 1
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
— Create/Recreate indexes
create index SYS.I_RADM_MC1 on SYS.RADM_MC$ (OBJ#)
tablespace SYSTEM
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);
create index SYS.I_RADM_MC2 on SYS.RADM_MC$ (OBJ#, INTCOL#)
tablespace SYSTEM
pctfree 10
initrans 2
maxtrans 255
storage
(
initial 64K
next 1M
minextents 1
maxextents unlimited
);


Após a criação da tabela do sys, a tabela R152PEN permitiu ser modificada.


Atualização realizada com sucesso.

Nenhum comentário:

Postar um comentário