Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Script request for FK enable/disable

RE: Script request for FK enable/disable

From: Koivu, Lisa <lkoivu_at_qode.com>
Date: Thu, 17 Aug 2000 15:13:49 -0400
Message-Id: <10592.114888@fatcity.com>


This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible.

------_=_NextPart_001_01C0087F.47B74BBC
Content-Type: text/plain;

        charset="iso-8859-1"

STEVE... before you do that with logging off/logging back on... you need to take a backup immediately upon completion of the import, right? Unless you are comfortable just re-importing as your recovery strategy for these tables.

-----Original Message-----
From: Steven Monaghan [mailto:MonaghaS_at_mscdirect.com] Sent: Thursday, August 17, 2000 3:01 PM
To: Multiple recipients of list ORACLE-L Subject: Script request for FK enable/disable

I inherited a job that tries to truncate about 20 tables weekly. After executing the truncate command, the script then does a delete cascade of the table. This was done because some of the truncate commands fail due to:

ORA-02266: unique/primary keys in the table referenced by enabled foreign keys

Does anyone out there have a script already developed that will allow me to enter a table name and have it generate the appropriate disable and enable commands, so I can truncate the table?

I've been trying to figure it out, using the dba_constraints table, but I haven't gotten very far yet, and I'd like to avoid re-inventing the wheel if possible.

Thanks again to the list for your help with the issue I raised yesterday about redo logs on import. We are going to turn logging off on the tables before the load and turn it back on after the load. Hopefully that will put out one of the fires with this process.

Steve



Steve Monaghan
Oracle DBA
MSC Industrial Direct Co., Inc.
Melville, NY
MonaghaS_at_mscdirect.com
-- 
Author: Steven Monaghan
  INET: MonaghaS_at_mscdirect.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

------_=_NextPart_001_01C0087F.47B74BBC
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2650.12">
<TITLE>RE: Script request for FK enable/disable</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>STEVE... before you do that with logging off/logging =
back on... you need to take a backup immediately upon completion of the = import, right?&nbsp; Unless you are comfortable just re-importing as = your recovery strategy for these tables.&nbsp; </FONT></P>
<P><FONT SIZE=3D2>-----Original Message-----</FONT>
<BR><FONT SIZE=3D2>From: Steven Monaghan [<A =
HREF=3D"mailto:MonaghaS_at_mscdirect.com">mailto:MonaghaS_at_mscdirect.com</A>= ]</FONT>
<BR><FONT SIZE=3D2>Sent: Thursday, August 17, 2000 3:01 PM</FONT>
<BR><FONT SIZE=3D2>To: Multiple recipients of list ORACLE-L</FONT>
<BR><FONT SIZE=3D2>Subject: Script request for FK enable/disable</FONT>
</P>
<BR>

<P><FONT SIZE=3D2>I inherited a job that tries to truncate about 20 =
tables weekly.&nbsp; After</FONT>
<BR><FONT SIZE=3D2>executing the truncate command, the script then does =
a delete cascade of the</FONT>
<BR><FONT SIZE=3D2>table.&nbsp; This was done because some of the =
truncate commands fail due to:</FONT>
</P>

<P><FONT SIZE=3D2>ORA-02266: unique/primary keys in the table =
referenced by enabled foreign</FONT>
<BR><FONT SIZE=3D2>keys</FONT>
</P>

<P><FONT SIZE=3D2>Does anyone out there have a script already developed =
that will allow me to</FONT>
<BR><FONT SIZE=3D2>enter a table name and have it generate the =
appropriate disable and enable</FONT>
<BR><FONT SIZE=3D2>commands, so I can truncate the table?</FONT>
</P>

<P><FONT SIZE=3D2>I've been trying to figure it out, using the =
dba_constraints table, but I</FONT>
<BR><FONT SIZE=3D2>haven't gotten very far yet, and I'd like to avoid =
re-inventing the wheel if</FONT>
<BR><FONT SIZE=3D2>possible.</FONT>
</P>

<P><FONT SIZE=3D2>Thanks again to the list for your help with the issue =
I raised yesterday</FONT>
<BR><FONT SIZE=3D2>about redo logs on import.&nbsp; We are going to =
turn logging off on the tables</FONT>
<BR><FONT SIZE=3D2>before the load and turn it back on after the =
load.&nbsp; Hopefully that will put</FONT>
<BR><FONT SIZE=3D2>out one of the fires with this process.</FONT>
</P>

<P><FONT SIZE=3D2>Steve</FONT>
</P>

<P><FONT SIZE=3D2>-------------------------------------</FONT>
<BR><FONT SIZE=3D2>Steve Monaghan</FONT>
<BR><FONT SIZE=3D2>Oracle DBA</FONT>
<BR><FONT SIZE=3D2>MSC Industrial Direct Co., Inc.</FONT>
<BR><FONT SIZE=3D2>Melville, NY</FONT>
<BR><FONT SIZE=3D2>MonaghaS_at_mscdirect.com</FONT>
<BR><FONT SIZE=3D2>-------------------------------------</FONT>
<BR><FONT SIZE=3D2>-- </FONT>
<BR><FONT SIZE=3D2>Author: Steven Monaghan</FONT>
<BR><FONT SIZE=3D2>&nbsp; INET: MonaghaS_at_mscdirect.com</FONT>
</P>

<P><FONT SIZE=3D2>Fat City Network Services&nbsp;&nbsp;&nbsp; -- (858) =
538-5051&nbsp; FAX: (858) 538-5051</FONT>
<BR><FONT SIZE=3D2>San Diego, =
California&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- Public Internet = access / Mailing Lists</FONT>
<BR><FONT =
SIZE=3D2>---------------------------------------------------------------= -----</FONT>
<BR><FONT SIZE=3D2>To REMOVE yourself from this mailing list, send an =
E-Mail message</FONT>
<BR><FONT SIZE=3D2>to: ListGuru_at_fatcity.com (note EXACT spelling of =
'ListGuru') and in</FONT>
<BR><FONT SIZE=3D2>the message BODY, include a line containing: UNSUB =
ORACLE-L</FONT>
<BR><FONT SIZE=3D2>(or the name of mailing list you want to be removed =
from).&nbsp; You may</FONT>
<BR><FONT SIZE=3D2>also send the HELP command for other information =
Received on Thu Aug 17 2000 - 14:13:49 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US