Hola
jc3000... de nuevo yo.... pero esta vez para dar algo de solucion a este lio
Atendiendo tu SUGERENCIA de deshabilitar los fk de las tablas... me puse en la tarea de hacer este script
Código PHP:
set def on ver off
set serverout on size 1000000
prompt Digite dueno de la tabla
accept Tabowner prompt 'OWNER: '
prompt Digite separado por comas (,) y en MAYUSCULAS la lista de tablast: TAB1,TAB2,...
accept TabList prompt 'Table list: '
prompt Accion a ejecutar ( ENABLE, DISABLE, ENABLE NOVALIDATE ... ):
accept State prompt 'State: '
spool enable_disable_fk.log
declare
l_str_sel_cur varchar2(4000);
l_str_sql_ddl varchar2(4000);
l_owner dba_constraints.owner%TYPE;
l_constraint_name dba_constraints.constraint_name%TYPE;
l_table_name dba_constraints.table_name%TYPE;
type t_cur_fk is ref cursor;
cur_fk t_cur_fk;
begin
l_str_sel_cur:= 'select fk.owner, fk.constraint_name , fk.table_name ' ||
' from dba_constraints fk, dba_constraints pk ' ||
' where fk.CONSTRAINT_TYPE = ''R'' and ' ||
' pk.owner = upper(''&&Tabowner'') and ' ||
' fk.R_CONSTRAINT_NAME = pk.CONSTRAINT_NAME and ' ||
' pk.TABLE_NAME in ( ' ||
'''' || replace('&&TabList',',',''',''') || '''' ||
')';
open cur_fk for l_str_sel_cur;
dbms_output.put_line('Executing: ');
loop
fetch cur_fk into l_owner, l_constraint_name, l_table_name;
exit when cur_fk%notfound;
l_str_sql_ddl := 'ALTER TABLE '||l_owner||'.'||l_table_name||' MODIFY CONSTRAINT '||l_constraint_name||' &&State';
dbms_output.put_line(l_str_sql_ddl);
execute immediate l_str_sql_ddl;
end loop;
if cur_fk%rowcount = 0 then
dbms_output.put_line('No Foreign key to modify');
end if;
close cur_fk;
end;
/
spool off
jejeje..... Doy lo que sea si me la creites.....
en verdad lo saque de la siguiente pagina
http://www.oracle.com/technology/ora...05/090505.html
Igual, agradezco su colaboracion y sus ideas.....
Un Cordial Saludo