deletion of data from a large table
Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: deletion of data from a large table
If I remember rightly, deleting rows from the table does NOT free up tablespace. In order to do that you have to trunctate the table (although this of course deletes all data from the table)...I can't for the life of me remember how you adjust the space the table is actually using after doing a delete...(to everyone else) would an analyze work? Kev. -Original Message- Sent: 26 July 2001 12:41 To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Thomas, Kevin INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: deletion of data from a large table
I think this is happening because when you DELETE data the High Water Mark(HWM) is not lowered. Essentially you have not gained any freespace. If possible you could export remaining data truncate table then re-import. Correct me if I am wrong here. Rick -Original Message- Sent: Thursday, July 26, 2001 7:41 AM To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: deletion of data from a large table
Rukmini, Try to do coalesce on the tablespace on which the table is sitting in after deleting rows. alter tablespace TSNAME coalesce; Baskar -Original Message- Sent: 26 July 2001 12:41 To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Ramasamy, Baskar INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
Re: deletion of data from a large table
This can be done . But what about the constraints ? - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 5:41 PM I think this is happening because when you DELETE data the High Water Mark(HWM) is not lowered. Essentially you have not gained any freespace. If possible you could export remaining data truncate table then re-import. Correct me if I am wrong here. Rick -Original Message- Sent: Thursday, July 26, 2001 7:41 AM To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: deletion of data from a large table
Hi folks, Rick Cale was correct in saying that a truncate would release the storage by default. The only other option is to drop and recreate the table. Oracle will only release allocated storage when it is specifically asked to. The overhead on having a process monitoring which space it can drop would be prohibitive and needless. ( Imagine an example where an interface table is constantly filled and emptied - do you really want the storage to be constantly allocated and deallocated? ). Coalescing the tablespace will group adjacent free extents together but will have no effect on allocated blocks. Regards, Mike Hately, Oracle DBA |+-- || Ramasamy, Baskar | || Baskar.Ramasamy@cal| || anais.com | || | || 07/26/01 01:17 PM | || Please respond to | || ORACLE-L| || | |+-- -| | | | To: Multiple recipients of list ORACLE-L | | [EMAIL PROTECTED]| | cc: (bcc: Mike Hately/ETECH) | | Subject: RE: deletion of data from a large table | -| Rukmini, Try to do coalesce on the tablespace on which the table is sitting in after deleting rows. alter tablespace TSNAME coalesce; Baskar -Original Message- Sent: 26 July 2001 12:41 To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Ramasamy, Baskar INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
Re: deletion of data from a large table
Rukmini If you have good PCTUSED you are safe!! The space will be reused, Other wise You have to reorganize table!! From: Rukmini Devi [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Subject: Re: deletion of data from a large table Date: Thu, 26 Jul 2001 04:35:48 -0800 This can be done . But what about the constraints ? - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 5:41 PM I think this is happening because when you DELETE data the High Water Mark(HWM) is not lowered. Essentially you have not gained any freespace. If possible you could export remaining data truncate table then re-import. Correct me if I am wrong here. Rick -Original Message- Sent: Thursday, July 26, 2001 7:41 AM To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). _ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Raghu Kota INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: deletion of data from a large table
Great discussion. Reminds me of lazydba list. Alex Hillman -Original Message- Sent: Thursday, July 26, 2001 8:43 AM To: Multiple recipients of list ORACLE-L Hi folks, Rick Cale was correct in saying that a truncate would release the storage by default. The only other option is to drop and recreate the table. Oracle will only release allocated storage when it is specifically asked to. The overhead on having a process monitoring which space it can drop would be prohibitive and needless. ( Imagine an example where an interface table is constantly filled and emptied - do you really want the storage to be constantly allocated and deallocated? ). Coalescing the tablespace will group adjacent free extents together but will have no effect on allocated blocks. Regards, Mike Hately, Oracle DBA |+-- || Ramasamy, Baskar | || Baskar.Ramasamy@cal| || anais.com | || | || 07/26/01 01:17 PM | || Please respond to | || ORACLE-L| || | |+-- -| | | | To: Multiple recipients of list ORACLE-L | | [EMAIL PROTECTED]| | cc: (bcc: Mike Hately/ETECH) | | Subject: RE: deletion of data from a large table | -| Rukmini, Try to do coalesce on the tablespace on which the table is sitting in after deleting rows. alter tablespace TSNAME coalesce; Baskar -Original Message- Sent: 26 July 2001 12:41 To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Ramasamy, Baskar INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Hillman, Alex INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: deletion of data from a large table
You would need to drop any foreign key constraints pointing to that table before truncating and then recreate them after reloading the data. If I remember correctly, simply disabling them won't work since Oracle treats Truncate Table the same as Drop Table in many ways. Other constraints (NOT NULL, etc) won't be affected. Also, depending on the size of your initial extent and the amount of data you have remaining, you might be able to resize the one remaining datafile down after you truncate the table. (e.g., if your initial exent is 5 Meg and you don't anticipate ever having more than 1 Meg of data, you can RESIZE the datafile down to 5 Meg after the truncate). Jay Miller -Original Message- Sent: Thursday, July 26, 2001 8:36 AM To: Multiple recipients of list ORACLE-L This can be done . But what about the constraints ? - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 5:41 PM I think this is happening because when you DELETE data the High Water Mark(HWM) is not lowered. Essentially you have not gained any freespace. If possible you could export remaining data truncate table then re-import. Correct me if I am wrong here. Rick -Original Message- Sent: Thursday, July 26, 2001 7:41 AM To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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).
RE: deletion of data from a large table
Oops, meant to say you can RESIZE the datafile down to 1 Meg after the truncate -Original Message- Sent: Thursday, July 26, 2001 11:01 AM To: Multiple recipients of list ORACLE-L You would need to drop any foreign key constraints pointing to that table before truncating and then recreate them after reloading the data. If I remember correctly, simply disabling them won't work since Oracle treats Truncate Table the same as Drop Table in many ways. Other constraints (NOT NULL, etc) won't be affected. Also, depending on the size of your initial extent and the amount of data you have remaining, you might be able to resize the one remaining datafile down after you truncate the table. (e.g., if your initial exent is 5 Meg and you don't anticipate ever having more than 1 Meg of data, you can RESIZE the datafile down to 5 Meg after the truncate). Jay Miller -Original Message- Sent: Thursday, July 26, 2001 8:36 AM To: Multiple recipients of list ORACLE-L This can be done . But what about the constraints ? - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 5:41 PM I think this is happening because when you DELETE data the High Water Mark(HWM) is not lowered. Essentially you have not gained any freespace. If possible you could export remaining data truncate table then re-import. Correct me if I am wrong here. Rick -Original Message- Sent: Thursday, July 26, 2001 7:41 AM To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or
RE: deletion of data from a large table
This is what I use for truncating data from a large table with foreign key constraints. select 'alter table ' ||b.table_name ||' disable constraint '||b.constraint_name ||';' from user_constraints a, user_constraints b where a.table_name = tablename and a.constraint_name = b.r_constraint_name and b.constraint_type='R' / truncate table tablename; select 'alter table ' ||b.table_name ||' enable constraint '||b.constraint_name| |';' from user_constraints a, user_constraints b where a.table_name = tablename and a.constraint_name = b.r_constraint_name and b.constraint_type='R' / Rakesh [EMAIL PROTECTED] 07/26/01 11:01AM You would need to drop any foreign key constraints pointing to that table before truncating and then recreate them after reloading the data. If I remember correctly, simply disabling them won't work since Oracle treats Truncate Table the same as Drop Table in many ways. Other constraints (NOT NULL, etc) won't be affected. Also, depending on the size of your initial extent and the amount of data you have remaining, you might be able to resize the one remaining datafile down after you truncate the table. (e.g., if your initial exent is 5 Meg and you don't anticipate ever having more than 1 Meg of data, you can RESIZE the datafile down to 5 Meg after the truncate). Jay Miller -Original Message- Sent: Thursday, July 26, 2001 8:36 AM To: Multiple recipients of list ORACLE-L This can be done . But what about the constraints ? - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 5:41 PM I think this is happening because when you DELETE data the High Water Mark(HWM) is not lowered. Essentially you have not gained any freespace. If possible you could export remaining data truncate table then re-import. Correct me if I am wrong here. Rick -Original Message- Sent: Thursday, July 26, 2001 7:41 AM To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ:
Re: deletion of data from a large table
Well, I have disabled FK constraints, done a truncate and re-enabled. Terry Miller, Jay wrote: You would need to drop any foreign key constraints pointing to that table before truncating and then recreate them after reloading the data. If I remember correctly, simply disabling them won't work since Oracle treats Truncate Table the same as Drop Table in many ways. Other constraints (NOT NULL, etc) won't be affected. Also, depending on the size of your initial extent and the amount of data you have remaining, you might be able to resize the one remaining datafile down after you truncate the table. (e.g., if your initial exent is 5 Meg and you don't anticipate ever having more than 1 Meg of data, you can RESIZE the datafile down to 5 Meg after the truncate). Jay Miller -Original Message- Sent: Thursday, July 26, 2001 8:36 AM To: Multiple recipients of list ORACLE-L This can be done . But what about the constraints ? - Original Message - To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Sent: Thursday, July 26, 2001 5:41 PM I think this is happening because when you DELETE data the High Water Mark(HWM) is not lowered. Essentially you have not gained any freespace. If possible you could export remaining data truncate table then re-import. Correct me if I am wrong here. Rick -Original Message- Sent: Thursday, July 26, 2001 7:41 AM To: Multiple recipients of list ORACLE-L Hi All, I have deleted 3 lakhs records from a large table. But there is no effect on tablespace i.e. before I delete the data freespace in TS is 100MB , after deletion also it is showing 100MB. What could be the reason ? How to get the freespace after deleting the data ? Thanks rukmini -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Cale, Rick T (Richard) INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rukmini Devi INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Miller, Jay INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Terry Ball INET: [EMAIL PROTECTED] 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: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L