db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Matrigali <mikem_...@sbcglobal.net>
Subject Re: Unable to restore a Derby database
Date Tue, 23 Nov 2004 18:57:41 GMT
I am not sure what is going on, here are some things I can think of to
try to learn more.

o can you try using ij directly and not using the network server, just
  to isolate the issue.
o how do you back up the database?  Are you using the derby system
  procedure?
o is there any chance that there are still connections to the database
  when the restoreFrom connection is made?
o Did you look at error log files, was there anything in there?

Can anyone comment if this is the correct syntax for passing the
restoreFrom attribute through the network server?

Calvin Smith wrote:

> hi,
> 
> I'm having trouble restoring a Derby database. I backed it up to another
> directory, and then tried adding a few rows to the original database,
> disconnecting, and then connecting again with the restoreFrom attribute.
> I was able to connect successfully, but the extra records were still in
> the database, and it hadn't been overwritten.
> 
> I tried to connect first through ANT (since this is part of my build
> process), but just to be sure that ANT wasn't causing the problem, I
> connected with a JDBC client (DBVisualizer) and observed the same behavior.
> 
> The URL I ordinarily connect to is:
> 
> jdbc:derby:net://localhost:1527/asdf;create=true
> 
> After doing the backup of the database, I verified that there were a
> bunch of files in my backup directory under a directory called
> 'asdf' (the database name), which seems like a successful backup, but
> when I connect with the following URL:
> 
> jdbc:derby:net://localhost:1527/asdf;restoreFrom=/home/cs/Desktop/workspace/asdf/db/derby-backups
> 
> 
> nothing is different, and the restoreFrom apparently did nothing. Here
> are my config details:
> 
> Java VM:  Java HotSpot(TM) Client VM
> Java Version:  1.4.2_06-b03
> Java Vendor:  Sun Microsystems Inc.
> OS Name:  Linux
> OS Arch:  i386
> OS Version:  2.6.9
> 
> Both the Derby and Universal JDBC driver were downloaded about 5 days
> ago, so they're probably the latest versions, but here's what JDBC
> records as the versions:
> 
> Apache Derby
> 10.0.2.1
> IBM DB2 JDBC Universal Driver Architecture
> 2.4.17
> 
> I also tried connecting directly using ij, and observed the same
> behavior. I started ij, then executed:
> 
> connect
> 'jdbc:derby:net://localhost:1527/asdf;restoreFrom=/home/cs/Desktop/workspace/asdf/db/derby-backups:user=test;password=test;';
> 
> 
> And I observed that the data created after the backup occurred was still
> there.
> 
> Any ideas what might be going on? If anybody has been able to
> successfully restore, I'd really appreciate seeing a connectUrl or two
> that worked correctly.
> 
> Thanks in advance...
> 
> -calvin
> 
> p.s. Erring on the side of too much info, here is the ANT target which
> shows how I'm starting the server:
> 
> <target name="db-start" description="Start derby on localhost:1527">
>     <mkdir dir="${derby.basedir}"/>
>     <java classname="org.apache.derby.drda.NetworkServerControl"
> fork="yes" dir="${derby.basedir}">
>         <arg line="start"/>
>     <jvmarg value="-Dderby.system.home=${derby.basedir}"/>
>     <jvmarg value="-Xmx256m"/>
>         <classpath refid="db.derby.server.classpath"/>
>     </java>
> </target>
> 
> Roughly equivalent to:
> 
> cd ${derby.basedir}; java -Dderby.system.home=${derby.basedir} -Xmx256m
> -classpath ${db.derby.server.classpath}
> org.apache.derby.drda.NetworkServerControl start
> 
> 

Mime
View raw message