<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Broken Foreign Keys in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565525#M838457</link>
    <description>hi,&lt;BR /&gt;What do you mean by "broken"?&lt;BR /&gt;&lt;BR /&gt;what is the status of the constraint?&lt;BR /&gt;&lt;BR /&gt;query the status field:&lt;BR /&gt;desc dba_constraints&lt;BR /&gt; Name                            Null?    Type&lt;BR /&gt; ------------------------------- -------- ----&lt;BR /&gt; OWNER                           NOT NULL VARCHAR2(30)&lt;BR /&gt; CONSTRAINT_NAME                 NOT NULL VARCHAR2(30)&lt;BR /&gt; CONSTRAINT_TYPE                          VARCHAR2(1)&lt;BR /&gt; TABLE_NAME                      NOT NULL VARCHAR2(30)&lt;BR /&gt; SEARCH_CONDITION                         LONG&lt;BR /&gt; R_OWNER                                  VARCHAR2(30)&lt;BR /&gt; R_CONSTRAINT_NAME                        VARCHAR2(30)&lt;BR /&gt; DELETE_RULE                              VARCHAR2(9)&lt;BR /&gt; STATUS                                   VARCHAR2(8)&lt;BR /&gt; DEFERRABLE                               VARCHAR2(14)&lt;BR /&gt; DEFERRED                                 VARCHAR2(9)&lt;BR /&gt; VALIDATED                                VARCHAR2(13)&lt;BR /&gt; GENERATED                                VARCHAR2(14)&lt;BR /&gt; BAD                                      VARCHAR2(3)&lt;BR /&gt; RELY                                     VARCHAR2(4)&lt;BR /&gt; LAST_CHANGE                              DATE&lt;BR /&gt;&lt;BR /&gt;let us know&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;yogeeraj</description>
    <pubDate>Fri, 17 Jun 2005 08:56:07 GMT</pubDate>
    <dc:creator>Yogeeraj_1</dc:creator>
    <dc:date>2005-06-17T08:56:07Z</dc:date>
    <item>
      <title>Broken Foreign Keys</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565521#M838453</link>
      <description>I made an export of a database with no broken foreign keys and ftp'd it to another server where I performed a re-org. This imported the clean database. Sometime between yesterday and today one of the foreign keys broke, but no one has been on the system and all objects are valid. What could have caused this foreign key to break?</description>
      <pubDate>Thu, 16 Jun 2005 13:46:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565521#M838453</guid>
      <dc:creator>Chassidy Rentz</dc:creator>
      <dc:date>2005-06-16T13:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: Broken Foreign Keys</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565522#M838454</link>
      <description>Is the primary key (that the foreign key points to) possibly a key field that's populated from a sequencer that's triggered on row insert?  If so, you're import may have fired the trigger and generated a whole new set of primary keys , hence your foreign key is pointing to nothing.  Have to be careful to turn off triggers before starting imports because of this very thing.  This may not be your problem, but in general it's what I look for in the very scenario you've described.</description>
      <pubDate>Thu, 16 Jun 2005 16:32:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565522#M838454</guid>
      <dc:creator>TwoProc</dc:creator>
      <dc:date>2005-06-16T16:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: Broken Foreign Keys</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565523#M838455</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Before import, disable all triggers executing the result of the following query:&lt;BR /&gt;&lt;BR /&gt;select 'alter trigger'||' '||owner||'.'||object_name||' '||'disable'&lt;BR /&gt;from dba_objects&lt;BR /&gt;where object_type = 'TRIGGER';&lt;BR /&gt;&lt;BR /&gt;And, after, re-enable them:&lt;BR /&gt;&lt;BR /&gt;select 'alter trigger'||' '||owner||'.'||object_name||' '||'enable'&lt;BR /&gt;from dba_objects&lt;BR /&gt;where object_type = 'TRIGGER';&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Eric Antunes</description>
      <pubDate>Fri, 17 Jun 2005 04:12:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565523#M838455</guid>
      <dc:creator>Eric Antunes</dc:creator>
      <dc:date>2005-06-17T04:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: Broken Foreign Keys</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565524#M838456</link>
      <description>If the DB your importing to does not have the schema, you'll have to import first without data, disable triggers, import data, and then reenable triggers.&lt;BR /&gt;&lt;BR /&gt;Here is the sequence I used (it concern a fromuser/touser import, not full) :&lt;BR /&gt;&lt;BR /&gt;1. import tables structure with options "rows=n indexes=n constraints=n grants=n" and some other extra options such as buffer, ignore...&lt;BR /&gt;&lt;BR /&gt;2. disable trigger with a script like that :&lt;BR /&gt;sqlplus /nolog &amp;lt;&amp;lt; EOF&lt;BR /&gt;connect ${login}/${pass}&lt;BR /&gt;set verify off&lt;BR /&gt;set head off&lt;BR /&gt;set pages 0&lt;BR /&gt;spool trigoff_$$.sql&lt;BR /&gt;select 'alter trigger '||trigger_name||' disable;' from user_triggers;&lt;BR /&gt;spool off&lt;BR /&gt;sta trigoff_$$.sql&lt;BR /&gt;exit&lt;BR /&gt;EOF&lt;BR /&gt;rm trigoff_$$.sql&lt;BR /&gt;&lt;BR /&gt;3. import data with a new imp command with options "indexes=n constraints=n grants=n". &lt;BR /&gt;&lt;BR /&gt;4. enable constraints with a last import command using options "rows=n indexes=y  constraints=y grants=y"&lt;BR /&gt;&lt;BR /&gt;Import data without indexes and constraints make it faster than all-in-one. You have to parse 3 times the file so it may be a better thing to have a user export than a full export.&lt;BR /&gt;Triggers will be activated by imp itself at end of step 3.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Jun 2005 05:35:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565524#M838456</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2005-06-17T05:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: Broken Foreign Keys</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565525#M838457</link>
      <description>hi,&lt;BR /&gt;What do you mean by "broken"?&lt;BR /&gt;&lt;BR /&gt;what is the status of the constraint?&lt;BR /&gt;&lt;BR /&gt;query the status field:&lt;BR /&gt;desc dba_constraints&lt;BR /&gt; Name                            Null?    Type&lt;BR /&gt; ------------------------------- -------- ----&lt;BR /&gt; OWNER                           NOT NULL VARCHAR2(30)&lt;BR /&gt; CONSTRAINT_NAME                 NOT NULL VARCHAR2(30)&lt;BR /&gt; CONSTRAINT_TYPE                          VARCHAR2(1)&lt;BR /&gt; TABLE_NAME                      NOT NULL VARCHAR2(30)&lt;BR /&gt; SEARCH_CONDITION                         LONG&lt;BR /&gt; R_OWNER                                  VARCHAR2(30)&lt;BR /&gt; R_CONSTRAINT_NAME                        VARCHAR2(30)&lt;BR /&gt; DELETE_RULE                              VARCHAR2(9)&lt;BR /&gt; STATUS                                   VARCHAR2(8)&lt;BR /&gt; DEFERRABLE                               VARCHAR2(14)&lt;BR /&gt; DEFERRED                                 VARCHAR2(9)&lt;BR /&gt; VALIDATED                                VARCHAR2(13)&lt;BR /&gt; GENERATED                                VARCHAR2(14)&lt;BR /&gt; BAD                                      VARCHAR2(3)&lt;BR /&gt; RELY                                     VARCHAR2(4)&lt;BR /&gt; LAST_CHANGE                              DATE&lt;BR /&gt;&lt;BR /&gt;let us know&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Fri, 17 Jun 2005 08:56:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/broken-foreign-keys/m-p/3565525#M838457</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-06-17T08:56:07Z</dc:date>
    </item>
  </channel>
</rss>

