create procedure truncate_database is
begin
for i in ( select name from v$datafile order by file# desc ) loop
dbms_backup_restore.deletefile(i.name);
end loop;
end;
/
or something like that should do the trick...
:-)
- Tanel Põder <tanel.poder.003_at_mail.ee> wrote:
> Someone should file an enhancement request for "truncate database" command,
> this would not only be faster, but also more automatic!
>
> Tanel.
>
> ----- Original Message -----
> From: "Carel-Jan Engel" <cjpengel.dbalert_at_xs4all.nl>
> To: <gorbyx_at_gmail.com>
> Cc: <oracle-l_at_freelists.org>
> Sent: Wednesday, March 16, 2005 12:27 AM
> Subject: Re: query tune
>
>
> >I don't understand this truncate solution. We all know that when this
> > kind of reorganization has to be repeated on a regular basis, the
> > truncate isn't a real silver bullet. One should find the root cause of
> > the problem, and solve that. In this case, I would simply drop the
> > table. That saves a lot of future work, and performance can not degrade
> > again. Of course the statement will fail then, but as many teachers
> > tought us: The best way to execute a statement is stop executing it.
> > Problem solved.
> > Just my $0.02
>
> --
> http://www.freelists.org/webpage/oracle-l
>
Connor McDonald
Co-author: "Mastering Oracle PL/SQL - Practical Solutions"
Co-author: "Oracle Insight - Tales of the OakTable"
web: http://www.oracledba.co.uk
web: http://www.oaktable.net
email: connor_mcdonald_at_yahoo.com
"GIVE a man a fish and he will eat for a day. But TEACH him how to fish, and...he will sit in a boat and drink beer all day"
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/
--
http://www.freelists.org/webpage/oracle-l
Received on Tue Mar 15 2005 - 22:13:04 CST