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'
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...
V12 supports only V10 and later databases. Use 5.5 server.
answered 10 Jul '12, 05:27
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:
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?
answered 16 Jul '12, 08:11