db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Don Clary" <don.cl...@sbcglobal.net>
Subject RE: Database restoration not working.
Date Wed, 12 May 2010 05:14:22 GMT
Good Evening Kristian!

Thank you very much for the ideas.  I figured out what the issue was.

Using your ideas, I verified that I could connect to the backup database
from its directory; I verified that I could connect to it from the directory
where the program runs.  Both okay, so it seemed to not be a permission
issue.  The connection attempts worked fine when the path to the database
contained no spaces.  I knew that the full path to my backup database
contained spaces, so I had been trying to deal with that by quoting the
path.  The relative path that worked without quotes, failed when I added the
quotes.  When I took the quotes off of the full path, it worked!

Thank you very much!

Regards,

Don


C:\Documents and Settings\Don\My
Documents\JavaDev\HSA_ServiceHours\ServiceHours>java -jar
"%DERBY_INSTALL%\lib\derbyrun
.jar" ij
ij version 10.5
ij> connect 'jdbc:derby:.\HSA_backup\backup10-05-09\derbyDB' user 'user1'
password 'user1';
ij> show connections;
CONNECTION0* -  jdbc:derby:.\HSA_backup\backup10-05-09\derbyDB
* = current connection
ij> disconnect;
ij> connect 'jdbc:derby:"C:\Documents and Settings\Don\My
Documents\JavaDev\HSA_ServiceHours\ServiceHours\HSA_backup\bac
kup10-05-09\derbyDB"' user 'user1' password 'user1';
ERROR 08001: No suitable driver found for jdbc:derby:"C:\Documents and
Settings\Don\My Documents\JavaDev\HSA_ServiceHour
s\ServiceHours\HSA_backup\backup10-05-09\derbyDB"
ij> show connections;
No connections available.
ij>


> -----Original Message-----
> From: Kristian.Waagan@Sun.COM [mailto:Kristian.Waagan@Sun.COM]
> Sent: Tuesday, May 11, 2010 12:56 AM
> To: derby-user@db.apache.org
> Subject: Re: Database restoration not working.
>
>
> On 11.05.10 06:37, Don Clary wrote:
> > I am also trying to use the "restoreFrom=" switch when opening
> the database,
> > but have not been successful yet.
> >
>
> Hi Don,
>
> Just a few ideas:
>   - are you doing this from the embedded driver?
>   - are you able to boot the backup directly?
>     (i.e. go to 'C:\Documents and Settings\Don\My
> Documents\JavaDev\HSA_ServiceHours\ServiceHours\HSA_backup\backup1
> 0-05-09',
> start ij and type "connect
> 'jdbc:derby:derbyDB[;user=...;password=...;...]'")
>   - if the above works, can you do the same from a different directory,
> specifying the full path in the connect statement?
>     (just to rule out Windows path issues)
>
> FYI, the check that fails is a File.exists(), which is why I want to
> rule out path and privilege issues.
>
>
> Regards,
> --
> Kristian
>
>
> > I am getting the following error:
> >
> > Caused by: java.sql.SQLException: Failed to start database
> 'derbyDB', see
> > the next exception for details.
> >   at
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
> > Source)
> >   at
> >
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransp
> ortAcrossD
> > RDA(Unknown Source)
> >   ... 43 more
> > Caused by: java.sql.SQLException: Backup database directory
> 'C:\Documents
> > and Settings\Don\My
> >
> Documents\JavaDev\HSA_ServiceHours\ServiceHours\HSA_backup\backup1
> 0-05-09\de
> > rbyDB' not found. Please make sure that the specified backup
> path is right.
> >   at
> org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(Unknown
> > Source)
> >   at
> >
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.wrapArgsForTransp
> ortAcrossD
> > RDA(Unknown Source)
> >   at
> org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQLException(Unknown
> > Source)
> >   at
> org.apache.derby.impl.jdbc.Util.generateCsSQLException(Unknown Source)
> >
> > "derbyDB" is the name of my database.
> >
> > The backup database does exist and everything needed (log dir, seg0 dir&
> > .dat files, BACKUP.HISTORY file, service.properties) appears to be
> > available.  The application trying to restore the file was
> started in the
> > '...\ServiceHours' directory,
> >
> > It seems that derby (10.5.3.0) can not access this directory for some
> > reason.  Anyone have a suggestion?
> >
> > Thank you!
> >
> > Don
> >
> >    -----Original Message-----
> >    From: Dinesh Bajaj [mailto:dinesh.bajaj@ymail.com]
> >    Sent: Saturday, April 24, 2010 9:59 AM
> >    To: Derby Discussion
> >    Subject: Re: Database restoration not working.
> >
> >
> >          Hi Myrna,
> >
> >          Thanks for your reply.
> >
> >          As I noted in my previous message that I already got
> the answer to
> > my query through a web article.  However, thanks to you for you reply
> > nevertheless.
> >
> >          -Dinesh
> >
> >          --- On Sat, 24/4/10, Myrna van Lunteren<m.v.lunteren@gmail.com>
> > wrote:
> >
> >
> >            From: Myrna van Lunteren<m.v.lunteren@gmail.com>
> >            Subject: Re: Database restoration not working.
> >            To: "Derby Discussion"<derby-user@db.apache.org>
> >            Date: Saturday, 24 April, 2010, 9:01 PM
> >
> >
> >            On Fri, Apr 23, 2010 at 7:37 PM, Dinesh Bajaj
> > <dinesh.bajaj@ymail.com>  wrote:
> >
> >                    Hi All,
> >
> >                    My understanding is that restoring a
> backedup database
> > should restore it to to its original location. If for example,
> a database is
> > backedup from the location c:\one to c:\two, and if it is later
> restored,
> > then the database ought to be restored to the original location, i.e.
> > c:\one. However, I find that this is not the case with Derby.
> >
> >                    String connectionURL =
> > "jdbc:derby:mydbname;restoreFrom=c:/temp/two/mydbname"
> >
> >                    On using the above-mentioned connection string, the
> > connection to the database is indeed made; however, it is not
> restored to
> > its original location. Where the database is restored, and how
> I can get it
> > restored to its original location?
> >
> >                    Thanks in advance.
> >
> >                    Regards,
> >                    Dinesh
> >
> >
> >
> >
> >
> >            Hi Dinesh,
> >
> >            As you found, derby does not retain information about the
> > directory structure around the database, just the internal
> organization of
> > the database itself. And the backup/restore doesn't keep that
> information
> > either.
> >            Derby processes start from the location where the
> java process is
> > invoked...
> >            So, to restore to the original position, I'd suggest
> starting the
> > restore in the original location.
> >            Or, you can just specify the target directory in the
> URL, i.e.:
> >            String connectionURL =
> > "jdbc:derby:c:/temp/one/mydbname;restoreFrom=c:/temp/two/mydbname"
> >            That should make mydbname database get restored to
> c:/temp/one.
> >
> >            Myrna
> >
> >
> >
> >
>


Mime
View raw message