The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

Hi all,

I'm not able to restore a database from a 5.5 version to a 12 version. I'm getting the following error:

The database archive 'E:\MICHAEL LS\VANDEMOORTELE\Vdm.db' could not be restored on the server '_sc069543125'.
Error during backup/restore: unable to open device E:\MICHAEL LS\VANDEMOORTELE\Vdm.db (Unknown err status reading HDR labels)
[Sybase][ODBC Driver][SQL Anywhere]Error during backup/restore: unable to open device E:\MICHAEL LS\VANDEMOORTELE\Vdm.db (Unknown err status reading HDR labels)
SQLCODE: -697
SQLSTATE: HY000
SQL Statement: RESTORE DATABASE 'Vdm.db' FROM 'E:\MICHAEL LS\VANDEMOORTELE\Vdm.db'

asked 10 Jul '12, 02:53

michaelvanwyngaerden's gravatar image

michaelvanwy...
46224
accept rate: 0%

retagged 18 Nov '12, 10:38

Nica%20_SAP's gravatar image

Nica _SAP
866722


The RESTORE DATABASE statement only works for backups created with the BACKUP DATABASE TO format of the BACKUP statement, which is intended to create an all-in-one-single-file backup of both database and transaction log in a single file on magnetic tape.

The BACKUP statement didn't exist in version 5.5, so by definition your file 'E:MICHAEL LS\VANDEMOORTELE\Vdm.db' is NOT a "database archive", which is SQL-Anywhere-speak for a tape backup.

Instead, your file 'E:\MICHAEL LS\VANDEMOORTELE\Vdm.db' is a much simpler "image backup", which is actually a copy of the original database.

So... you don't need to run any kind of "restore" process, but you do have to "upgrade" the database to Version 12; sadly, unlike versions 6, 7, 8 and 9, versions 10 through 12 can't start a version 5 database until it has been upgraded.

The following script demonstrates how to upgrade using the version 12 dbunload utility.

REM If you're a command-line kinda guy, here is my template Windows 
REM batch file run_dbunload_upgrade_v5_to_v12.bat. It does the 
REM unload-reload-all-in-one-dbunload-step, then starts dbeng12 
REM and dbisql so you can make sure the new database is up and running.

REM Be sure to stop *all* database engines on the computer you're using, 
REM before starting the upgrade.

REM dbunload...
REM -an ...  where to put new database
REM -ap ...  new database page size
REM -c ...   old database startup connection string
REM -o ...   where to put unload console display text file
REM -v       verbose mode for console display

PAUSE MAKE SURE YOU DO NOT HAVE ANY ENGINES RUNNING.

"%SQLANY12%\bin32\dbunload.exe"^
  -an ddd12.db^
  -ap 4096^
  -c "DBF=sademo.db;UID=dba;PWD=sql"^
  -o dbunload_log_sademo.txt^
  -v

PAUSE dbunload/reload done...

"%SQLANY12%\bin32\dbspawn.exe"^
  -f "%SQLANY12%\bin32\dbeng12.exe"^
  -o dbeng12_log_ddd12.txt^
  ddd12.db

PAUSE dbeng12 started...

"%SQLANY12%\bin32\dbisql.exe"^
  -c "ENG=ddd12;DBN=ddd12;UID=dba;PWD=sql"

PAUSE dbisql running...
permanent link

answered 10 Jul '12, 05:55

Breck%20Carter's gravatar image

Breck Carter
26.6k418575824
accept rate: 21%

edited 10 Jul '12, 05:57

V12 supports only V10 and later databases. Use 5.5 server.

permanent link

answered 10 Jul '12, 05:27

Dmitri's gravatar image

Dmitri
1.5k41132
accept rate: 11%

thanks for the help. I've indeed restored the database in my sql anywhere 12 version but I'm not able to connect with jdbc to the database.

I'm using the following jdbc url (with and without the databasename) with a user and password to get a connection but I'm receiving a login failed:

DBURL=jdbc:jtds:sybase://localhost:2638/test

yet I'm able to run the dbisql.exe in command line

dbisql.exe -c "ENG=test;DBN=test;UID=$USERID;PWD=$PASSWORD"

could someone tell what I'm doing wrong when trying to connect?

permanent link

answered 16 Jul '12, 08:11

michaelvanwyngaerden's gravatar image

michaelvanwy...
46224
accept rate: 0%

I suggest you post this as a new question rather than as an answer to the original - that way it's much more likely to be noticed by someone who can help.

(16 Jul '12, 10:33) Justin Willey

IMHO, the jConnect URL seems somewhat unusual, cf. this sample from the docs:

"jdbc:sybase:Tds:localhost:2638"

or - when specifying a particular database on the server

"jdbc:sybase:Tds:host:port?ServiceName=database"

(16 Jul '12, 10:48) Volker Barth

If you're really attempting to use jTDS as your JDBC driver, you should review the answer to this question - it likely will not work as you expect.

Trying jTDS within SQuirreL SQL also does not connect successfully for me to a version 12 SQL Anywhere database - it immediately disconnects.


If you wish/need to use a Type-4 JDBC driver with SQL Anywhere, we would instead recommend using jConnect.

If you can move to a mixed native-managed solution, the Sybase SQL Anywhere JDBC Type-1 driver is generally more efficient when accessing the SQL Anywhere database server. See the technical document page here and the blog entries here and here for more information.

For a historical list of how the iAnywhere JDBC driver has been used (which may help clarify older documentation), see the blog entry here.

(16 Jul '12, 13:18) Jeff Albion
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×404
×71
×17
×3

question asked: 10 Jul '12, 02:53

question was seen: 4,512 times

last updated: 18 Nov '12, 10:38