create table fullnodeineterface_backup as (select * from nodeinterface); create table fullsubinterface_backup as (Select * from subinterface); create table fullhsrp_backup as (select * from hsrp); create table nodeineterface_backup as (select * from nodeinterface where ipdataid not in (select ipdataid from ipdata) AND ipdataid NOT IN ( SELECT ipdataid FROM ip_data_v6)); create table subineterface_backup as (select * from subinterface where ipdataid not in (select ipdataid from ipdata )); create table subineterfaceV6_backup as (select * from subinterface where IPDATAV6ID not in (select ipdataid from ip_data_v6 )); create table hsrp_backup as (select * from hsrp where hsrpipid not in (select ipdataid from ipdata) AND hsrpipid NOT IN ( SELECT ipdataid FROM ip_data_v6)) update nodeinterface set ipdataid=null where ipdataid not in (select ipdataid from ipdata) AND ipdataid NOT IN ( SELECT ipdataid FROM ip_data_v6); update subinterface set ipdataid=null where ipdataid not in (select ipdataid from ipdata ); update subinterface set IPDATAV6ID=null where IPDATAV6ID not in (select ipdataid from ip_data_v6 ); update hsrp set hsrpipid=null where hsrpipid not in (select ipdataid from ipdata ) AND hsrpipid NOT IN ( SELECT ipdataid FROM ip_data_v6); commit;