-1

I am working at a company that has some CRM software running in a remote Windows XP server that uses a SQLAnywhere 9 db to store its data; I have access to this remote server with an administrator account.

I would like to extract the db into a .sql file so that I can run the db locally on my machine without affecting the running db in the server (since it is key for the company's day to day operation).

The reason I need this is that we are going to test some BI Software and we need data from this database to test it, but we don't know the structure of the database since the developers of the CRM software didn't give us any documentation on it. So we need to have the database locally so that, without affecting the running CRM, we can:

  1. understand the structure by looking at the DDL
  2. make queries to it to get sample data

I researched a bit, and the most common solution to my problem was to use dbunload on the remote server to unload the db into a reload.sql file that contained what I needed. But most tutorials on the subject mention that I have to stop the db first (which would be catastrophic). If this is the only option, then I guess I am willing to do it on the weekend when the CRM is not used, but I wanted to know if there was another solution first.

If there is no other solution, can you point me to where I can find the proper and safer way to do this?

I have researched a lot, but prior to this day I have never even heard of SQLAnywhere, so I really need all the help I can get. My main concern is doing something that impacts negatively the CRM software.

Thank you.

  • Why the downvote? I think it is a legitimate question, for which there is not much documentation online, and that can help future developers that have to work with legacy systems that use SQLAnywhere. – Beto Esquivel Jul 02 '15 at 17:34
  • I don't understand where the MySQL comes in but if you just want a test environment then shutdown the SQLAnywhere server, copy the .db and .log files to your test machine and run dbsrv9.exe or dbeng9.exe there. – beater Jul 02 '15 at 18:12
  • Can I do this without turning off the server? I cannot shut it down because it is used by an application that is key to the company's operation. – Beto Esquivel Jul 02 '15 at 20:19
  • yes, but harder. As long as you can install Adaptive Server Anywhere on your test machine then use the dbbackup.exe command to backup a live db and you can then run your test db server from those backup files. http://infocenter.sybase.com/archive/topic/com.sybase.help.adaptive_server_anywhere_9.0.2/pdf/asa902/dbdaen9.pdf – beater Jul 03 '15 at 11:35
  • Thank you, will give it a try. – Beto Esquivel Jul 03 '15 at 12:40

1 Answers1

0

You can run dbunload across the network, you just have to tell it to do an "external" unload. The default is to do an internal unload which would only work from the machine where the database server is running.

I don't have SQL Anywhere 9 documentation right now to look up the exact switch, but dbunload -? should show you all the possible switches.

Edit:
-an will create a new database and load the data and schema from another data
-xi switch will do external unload and internal reload.
-c parameters to connect to your remote database

data64
  • 1
  • 2
  • Is there a way to do it while the db is running? – Beto Esquivel Jul 15 '15 at 03:11
  • Yes, the db would have to be running if you want to do this across the network. I suggest creating a dsn to the remote database then you can just point dbunload to the dsn. Let me know if you are still struggling with the command line switches. – data64 Jul 15 '15 at 03:21