Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

We have a user running ASA 7 on a linux server they have a 1GB DB file in one location with a 15GB DB space in another location. We are looking at moving this over to a Windows server and updating to ASA10.

When we move the file we cannot access the DB using DBEng or DBSrv as the path in the DBSpace uses / as opposed to we need to change the path of the DB space before we can connect to unload and reload into ASA 10. Is there a way to alter this path if we cannot connect to the DB?

We would try to put the DB file and DB space into the same folder and alter the path on the Linux box so that the path is relative and does not have a / but the server does not have enough space for both together. Once we have the DB Windows ready we can unload remove the DBSpace and reload into one ASA10 DB file on a Windows server.

Any ideas on how we can alter the DBSpace path? I have no Linux experience and I am relying on a customer at the other end of a telephone to carry out the Linux work for me.

asked 10 Jun '11, 09:39

DustinBird's gravatar image

accept rate: 0%

Yes, you should be able to direct the engine to this path with the "-ds" database switch.

If you're trying to reload the version 7 file on Windows with SQL Anywhere 10 via dbunload on the command-line, you can try something like the following:

dbunload -c "UID=dba;PWD=sql;DBF=c:\path\to\old\database.db;DBS=-ds c:\path\to\old" -an c:\path\to\new\database.db
permanent link

answered 10 Jun '11, 11:17

Jeff%20Albion's gravatar image

Jeff Albion
accept rate: 25%

edited 10 Jun '11, 11:18

Thanks but will this work across platforms? The path in Linux is for example /example/DBspace.db but if I open this in windows it needs to find exampledbspace.db in order for me to connect to the DB

Windows will not be happy with the path having the incorrect slash.

(10 Jun '11, 11:27) DustinBird
Replies hidden

AFAIK, the -ds option will force the database engine to ignore the path of the dbspaces as specified in the system catalog. Therefore, you should be fine with this.

(13 Jun '11, 07:52) Volker Barth

Volker is correct - the "-ds" switch specifies the local path that the database server should use to locate the dbspaces -- ignoring any full paths specified in the system catalog. This will 'override' the absolute path "forward-slashes" you have specified on Linux. Once the database is started on Windows, you can 'rename' the DBSPACE paths if you wish, using the 'ALTER DBSPACE ... RENAME" statement.

Alternatively, always setting the dbspace paths to be relative will make them cross-platform.

Final note as an FYI/sidebar: Windows does actually respect the "forward-slash" as a path separator in many instances.

(13 Jun '11, 12:21) Jeff Albion

[Note, I have not tried this myself, and I'm not sure whether it will work on ASA 7...]

According to the docs, you might be able to change the dbspace's location (aka renaming the dbspace file) on the Linux system to a path/file that is not really existing. AFAIK, if the dbspace is already open (say, as you have accessed data from tables located in that dbspace), the engine will not try to open the renamed file until the database is stopped and restarted.

So you might be able to change the file path to something that will work on Windows, possibly something like (if the engine accepts the backslash as path separator on Linux)

ALTER DBSPACE dbspace2 RENAME 'C:\example\DBspace.db';

or at least to the current directory (by just supplying a file name without a path)

ALTER DBSPACE dbspace2 RENAME 'DBspace.db';

Now only the system catalog is changed, and stopping the database and copying the whole database to Windows (and adapting the dbspace filename, if necessary) should lead to a startable database there.

permanent link

answered 11 Jun '11, 08:32

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

Thanks I will give this a go today.

(13 Jun '11, 03:11) DustinBird
Your answer
toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 10 Jun '11, 09:39

question was seen: 3,730 times

last updated: 13 Jun '11, 12:21