cancel
Showing results for 
Search instead for 
Did you mean: 

Alter the path of a DBSpace when connection to DB fails

Former Member
0 Kudos
4,104

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

jeff_albion
Product and Topic Expert
Product and Topic Expert

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
Former Member
0 Kudos

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.

VolkerBarth
Contributor
0 Kudos

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.

jeff_albion
Product and Topic Expert
Product and Topic Expert

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.

VolkerBarth
Contributor

[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.

Former Member
0 Kudos

Thanks I will give this a go today.