on 2013 Dec 31 11:33 AM
I've inherited an old SQL Anywhere 8 database on which I'm trying to perform regular backups via the DBBACKUP command line. I have no prior experience with Sybase or SQL Anywhere. I've only been able to get it working using the following command line when the database is offline:
dbbackup -c "dbf=D:\\Data\\database.db;uid=DBA;pwd=sql" 😧\\Data\\Backup
However, I don't know how to either 1) perform the backup while the database is active (preferred), or to 2) gracefully stop the database in order to perform the backup using the above command line. When I try the above command while the database is active, I get the error: "Specified database is invalid". So I've tried another command:
dbbackup -c "ENG=servername;DBN=database;UID=DBA;PWD=sql" 😧\\Data\\Backup
And get the error: "Specified database not found."
I'm not familiar with the Connection Parameters, so perhaps I am using the wrong ones. For ENG I'm using the hostname of the server and for DBN I'm using the name of the database specified when starting the database: dbsrv8.exe -n database D:\\Data\\database.db
Is this correct?
This is on Windows Server 2012. One thing of note is that when I first set this up, I configured the ODBC (32-bit) connection and the database would start and run automatically (but only as that user?). At some point I had to revert back to how we started it on the old server: I have a monitor that checks if the process dbsrv8.exe is running and if not starts it up running as the System account using the command dbsrv8.exe -n database D:\\Data\\database.db
. This way the database will start up soon after a reboot without having log in and manually start it.
Any recommendations on how to either 1) perform the backup while the database is active (preferred), or to 2) gracefully stop the database in order to perform the backup.
Thanks for any advice or suggestions!
Request clarification before answering.
If the database is not running (as in your first example), running dbbackup is not necessary - you can simply copy the files:
copy 😧\\Data\\database.db 😧\\Data\\Backup\\ copy 😧\\Data\\database.log 😧\\Data\\Backup\\
If you have any dbspaces, you'll have to copy those as well. The dbbackup command will do the same thing (and in a single statement), but will be much slower.
If you want to back up a database that is running, you need to give dbbackup the server name that use used when starting the server. In your case, with the command line of dbsrv8.exe -n database D:\\Data\\database.db
, the first "database" is the server name (after the -n
), and second "database" is the database name (the name of the file without the ".db" extension). So your dbbackup command should be:
dbbackup -c eng=database;dbn=database;uid=dba;pwd=sql 😧\\Data\\Backup
If you are running on a different machine, or the server is running as a service, then shared memory will not work and you need to tell dbbackup to use TCP/IP to connect to the server. To do this, you'd add the LINKS parameter:
dbbackup -c eng=database;dbn=database;uid=dba;pwd=sql;links=tcpip 😧\\Data\\Backup
If you still can't connect, it's possible you need more TCP/IP parameters in order to find the server (for example, if the server is running on a different subnet, or there is a firewall involved). For v12 or later clients, you should use the HOST parameter. For earlier clients, there are a number of TCP/IP parameter to use; the v11 documentation is here.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah - if the server is running under System, then shared memory won't work. You'll need to add the LINKS parameter to your connection string to tell dbbackup to use TCP/IP to find the server. Your new command would be:
dbbackup -c eng=database;dbn=database;uid=dba;pwd=sql;links=tcpip D:\\Data\\Backup
User | Count |
---|---|
50 | |
9 | |
8 | |
6 | |
5 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.