db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oystein Grovlen - Sun Norway <Oystein.Grov...@Sun.COM>
Subject Re: Create Copy of Database with the necessary files
Date Tue, 21 Aug 2007 07:28:22 GMT
Lars Vogel wrote:
> Hello,
> is there a way to create a database copy with only the necessary files?

I am not quite sure I understand what you mean by the necessary files.

> Background: I did copy "my" database back and forth between a server and 
> my PC. I always copied the whole directory and did paste it into the 
> existing target directory in the assumption that all files would be 
> overwritten.
> I realized later that as new files are created the file set is not 
> always the same. Now I want to identify the files which are still used 
> as the directory is unnecessary large for my small dataset.

Creating and dropping tables and indexes will create and remove the 
corresponding files, respectively.  Compressing a table may also create 
a new file for it.

Note that many of the files represents system tables that are necessary 
even if you do not access them directly.

Is it not an option to recreate the target directory before you do the 
copy?  That way, there should be no unecessary files.

> The CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE seems to copy all database 
> files even if they are not in use (see below for the jave coding). Is 
> there a ways to identify and copy only the used files?
> Best regards, Lars
>         CallableStatement cs = con
>         .prepareCall("CALL SYSCS_UTIL.SYSCS_BACKUP_DATABASE(?)");
>         cs.setString(1, "c:/temp/backupdir3");
>         cs.execute();
>         cs.close();

Which version are you using?  As far as I know, the non-blocking backup 
mechanism introduced in 10.2, does only backup the tables that are 
defined in the current database dictionary.


View raw message