› Fóruns › Banco de dados Oracle › ALTER TABLE ORA-01031: insufficient privil. mesmo como DBA › ALTER TABLE ORA-01031: insufficient privil. mesmo como DBA
Obrigado pela atenção.
Márcio,
Não era problema de lógica, pois não tinha ninguém apontando para está tabela
SELECT other.TABLE_NAME,
other.owner,
other.constraint_name
FROM sys.dba_constraints this,
sys.dba_constraints other
WHERE this.constraint_name = other.r_constraint_name
AND this.owner = 'GS_TESTE'
AND this.TABLE_NAME = 'TIPO_PELE'
AND other.constraint_type = 'R'
AND other.r_owner = this.owner;
TABLE_NAME OWNER CONSTRAINT_NAME
0 rows selected
Apesar disso, descobri o problema:
Era um índice funcional (uma função determinística) na tabela TIPO_PELE,
sendo que está função estava em outro schema:
CREATE UNIQUE INDEX GS_TESTE.XIE1TIPO_PELE ON GS_TESTE.TIPO_PELE (GS.TO_KEY(TIPO_PELE)) ;
Criei a função no mesmo schema e ficou assim:
CREATE UNIQUE INDEX XIE1TIPO_PELE ON TIPO_PELE ( TO_KEY(TIPO_PELE)) ;
Obrigado a todos.