Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Dump records to a file
On 10 Jan 2005 11:53:26 -0800, hystable_at_yahoo.com wrote:
>Can anyone tell me how to dump records to a file and then load that
>file back into the table? I need to delete about 99% of the records in
>a table. I figured I could dump the records I want to keep to a file,
>truncate the table and then load the table again via the file. Or is
>there a better way to do it?
>
>Thanks.
If it is only 1 percent
create table bla as
select * from foo
where <records to be retained>
/
truncate table foo
/
insert into foo select * from bla
should do equally well.
-- Sybrand Bakker, Senior Oracle DBAReceived on Mon Jan 10 2005 - 14:30:20 CST