You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Knut Anders Hatlen <Kn...@Sun.COM> on 2007/11/01 11:53:51 UTC

Re: drop table does not delete .dat files

Fabian Merki <fa...@merkisoft.ch> writes:

>> > hi all
>> >
>> > i've just recognized that drop table does not delete .dat files.  is
>> > this a feature or a bug? google did not help to answer this question
>> > ;-(
>> 
>> Hi Fabian,
>> 
>> Are the dat files still there after you have performed a shutdown of the
>> database? (DriverManager.getConnection("jdbc:derby:mydb;shutdown=true"))
>> 
>> -- 
>> Knut Anders
>
> hi knut
>
> thanks for your reply.
> the shutdown did clean up the dat file (table and index). but is there
> another way - i'd like to keep the db running if possible.

I think the unused dat files are deleted during the checkpoint (which is
invoked when you have 10 MB of transaction logs), so they'll eventually
go away. I don't know of any way to trigger a checkpoint manually (other
than shutting down the database or performing lots of updates) or if
there's another way to delete the files.

-- 
Knut Anders

Re: drop table does not delete .dat files

Posted by "Dag H. Wanvik" <Da...@Sun.COM>.
Knut Anders Hatlen <Kn...@Sun.COM> writes:

> Fabian Merki <fa...@merkisoft.ch> writes:
>
>>> > hi all
>>> >
>>> > i've just recognized that drop table does not delete .dat files.  is
>>> > this a feature or a bug? google did not help to answer this question
>>> > ;-(
>>> 
>>> Hi Fabian,
>>> 
>>> Are the dat files still there after you have performed a shutdown of the
>>> database? (DriverManager.getConnection("jdbc:derby:mydb;shutdown=true"))
>>> 
>>> -- 
>>> Knut Anders
>>
>> hi knut
>>
>> thanks for your reply.
>> the shutdown did clean up the dat file (table and index). but is there
>> another way - i'd like to keep the db running if possible.
>
> I think the unused dat files are deleted during the checkpoint (which is
> invoked when you have 10 MB of transaction logs), so they'll eventually
> go away. 

Yes, unless you have backed up the database with log archival mode
set:
http://db.apache.org/derby/docs/10.3/ref/rrefbackupdbenablelogproc.html


> I don't know of any way to trigger a checkpoint manually (other
> than shutting down the database or performing lots of updates) or if

There is the SYSCS_UTIL.SYSCS_CHECKPOINT_DATABASE system procedure.

Thanks,
Dag

> there's another way to delete the files.
>
> -- 
> Knut Anders