Hi, in the help of Servoy are great examples of how to backup a Sybase-db manually!
Does anybody know how we can schedule such a task? (Windows)
I think I have to use a commandline-tool.
Does anybody have syntax for such a thing?
Hi, in the help of Servoy are great examples of how to backup a Sybase-db manually!
Does anybody know how we can schedule such a task? (Windows)
I think I have to use a commandline-tool.
Does anybody have syntax for such a thing?
HJK:
Hi, in the help of Servoy are great examples of how to backup a Sybase-db manually!Does anybody know how we can schedule such a task? (Windows)
I think I have to use a commandline-tool.
Does anybody have syntax for such a thing?
You can schedule all the backups to be performed automatically from Sybase Central. It’s very simple and you got a lot of options.
I maybe blind but I can find the backup functions,
but I can’t find the scheduler options!
please, be my guide in the darkness
HJK:
I maybe blindbut I can find the backup functions,
but I can’t find the scheduler options!please, be my guide in the darkness
It will be a honour and a privilege :
Open Sybase Central and connect to your db
Click on it, on the frame on the left of the screen
Choose EVENTS
Create a new event following wizard’s advices
That’s all
ahh, thanks. But how can add a backup schedule?
Do you have syntax for that?
You just need to execute something like this:
BACKUP DATABASE
DIRECTORY ‘d:\temp\backup’
TRANSACTION LOG RENAME
in other words, its right in the SQL dialect.
ve3cnu:
You just need to execute something like this:BACKUP DATABASE
DIRECTORY ‘d:\temp\backup’
TRANSACTION LOG RENAMEin other words, its right in the SQL dialect.
Could you explain what the last line stands for?
I confess I never use it
This clause will cause the server to rename current transaction log at the completion of the backup. The name for the renamed copy will be of the form YYMMDDnn.log. If the MATCH keyword is omitted, the backup copy of the log will have the same name as the current transaction log for the database. If you supply the MATCH keyword, the backup copy of the transaction log is given a name of the form YYMMDDnn.log, to match the renamed copy of the current transaction log. Using the MATCH keyword enables the same statement to be executed several times without writing over old data.
Please define “MATCH keyword”. I think I know what you mean, but I want to be sure.
HJK:
Hi, in the help of Servoy are great examples of how to backup a Sybase-db manually!Does anybody know how we can schedule such a task? (Windows)
I think I have to use a commandline-tool.
Does anybody have syntax for such a thing?
Install SQL Anywhere Studio 9 from www.sybase.com.
You will find a cmdline-tool named ‘dbbackup.exe’ in the directory c:\program files\sybase\SQL Anywhere 9\win32
I have put together an Acrobat PDF file containing screen shots of how to create backup schedules with Sybase Central at:
http://66.105.190.195/choices/SybaseBackups.pdf
The last page of the file includes a paragraph that explains how to save time by copying and pasting groups of Monday through Friday backup events from the events folder of one database to the events folder of other databases.
I am NOT an expert on Sybase backups. This file represents my first attempt at putting together a file that I can make available to my users on my web site. However, before doing so I want to make sure that the information it contains is both clear and accurate. I would greatly appreciate any suggestions and comments.
I would be particularly interested in knowing if anyone has figured out how to import or paste schedules and events across multiple databases all at one time. In other words, a way that I could set this up once, export the settings and then make them available to all my customers (my customers all have the same Servoy solution).
My objective is to establish automatic scheduled Monday through Friday backups (full archive backups) of all the Sybase database files and their corresponding log files while the files are being paused by Sybase at the same time each evening. The approach described in the PDF file that I have provided at the above link appears to achieve this, but if there is another way of doing it that would not require our users to open Sybase Central at all, that would be even better.
Thanks for your input, Westy!
Helps a lot!
Stef
Thanks Stef. Glad it helped.
mvhertum:
You will find a cmdline-tool named ‘dbbackup.exe’ in the directory c:\program files\sybase\SQL Anywhere 9\win32
I am still in search of a way to do backups that pause Sybase without the need to install Sybase Central, if that is possible. Does anyone out there know if the dbbackup.exe file can work on its own without a Sybase Central installation if we install it with our own installer? On page 341 of the “Adaptive Server Anywhere Database Administration Guide” (version: June 2003) it states that backups can be made with Sybase Central, SQL statements and with a utility named dbbackup. With regard to dbbackup it says:
utility The dbbackup command-line utility makes backups. For example, executing the following command at the command prompt makes backup copies of the database and transaction log in the directory c:\backup on the client machine:
dbbackup -c “connection-string” c:\backup
“client” is not in red in the original quote.
I am command line challenged so I do not fully understand this. I assume I would have to replace dbbackup with its full path surrounded by quotes. I also assume I would have to replace “connection-string” with text describing the connection. What should be the syntax of such a connection string? Would the above line also pause the database before backing it up when Sybase is running? I assume the above line could be saved as a text file with a .bat extension with Notepad and then executed any time the backup is needed. Could such a file be executed by the built in backup wizard of Windows XP or 2000 based upon a schedule established by that wizard?
Again, I am just thinking of possibly avoiding the 112 MB Sybase Central download for our customers (all of our customers are at remote locations that we never visit). Plus some customers may already be familiar with the built in Windows backup wizard.
The location of the Windows XP backup wizard is Start/All Programs/Accessories/System Tools/Backup.
After some more testing, the good news is that the following syntax, which has the “connection-string” inserted as defined on page 41 of the same manual, works perfectly for the above command line (backs up both contacts.db and contacts.log):
dbbackup -c “uid=dba;pwd=sql;dbn=contacts” c:\backup
As I suspected, it worked from the host, but not from the client. Maybe there is a different “connection-string” syntax for clients, or maybe the above reference to “client” was just a typo in the manual.
The bad news is that when I uninstall Sybase Central and place dbbackup.exe at c:\dbbackup.exe and modify the above command line accordingly, an error message comes up when I execute the .bat file saying it cannot locate the required dbtool9.dll file. When I place the dbtool9.dll file back where the Sybase Central intallation originally put it, the .bat file still evokes the same error message. Guess I will stick with the full Sybase Central installation unless someone can suggest another alternative for setting up backup schedules that pause the Sybase database files before each backup.
since everyone’s talking about backing up the sybase db here,
i thought this would be the right place for my question.
i backup all my machines over a local network in my office, and the backup
software (retrospect) always tells me that the the sybase db files
are locked:
Can't read file Servoy:database:servoy_repository.db, error -54 (file is busy/locked).
although i have copies of these files, which are getting backed up,
i’d like to know if there’s a way to bring down the database server
while i backup, and start it again afterward. it doens’t have to be
anything fancy or automatic; i don’t mind issuing the commands
manually.
thanks in advance.
rm.
You don’t need to bring the server down.
When you schedule a backup from within sybase central per database you can include the created backup in your retrospect setup. Do the backup let’s say half an hour before running retrospect and you have the wanted result.
The way to do this is described in the manuals or download the pdf Westy created.
RobertMeyer:
…
software (retrospect) always tells me that the the sybase db files
are locked:Can't read file Servoy:database:servoy_repository.db, error -54 (file is busy/locked).
IT2BE:
When you schedule a backup from within sybase central per database you can include the created backup in your retrospect setup. Do the backup let’s say half an hour before running retrospect and you have the wanted result.
…just remember to exclude the db directory from the retrospect backup…just save the files generated by the sybase central backup.
Ok tried all of this…but some problems I have.
I made 4 events to backup 4 databases.
I added a schedule for each 4 of them, the schedules are enabled.
I added a recurrence for every day, starting date from 1 oktober 2006, start time at 18.00
I use the following syntax
begin
BACKUP DATABASE
DIRECTORY 'K:\\Devoon\\backup Assyst'
TRANSACTION LOG RENAME
end
But nothing happens…
Also one event keeps changing the syntax in to
begin
backup database directory 'K:\\Devoon\\backup Assyst' transaction log rename
end
No matter what I do…it changes it back…but only on one event. The other 3 stays like the first syntax.
Also I cant seem to find any log files reporting that something went wrong. It is just like nothing happened.
No need to worry having the code changed to one line. The SQL is functionally equivalent.
If you haven’t already done so, test to make sure that the SQL statement works properly. You can do this within Sybase Central. Open the Events folder and right-click on the event that backs up the database. This will open a context menu. Click on the “Trigger…” menu item. This will execute the event immediately.
If the database and log file are not backed up to the ‘k:\ Devoon\backup Assyst’ directory, you want to make sure you have permissions to write to this location.
Either way, the error will be reported in the transaction log of the database server. Probably the easiest way to see the log messages is to remove the ‘-qw’ option from the top line of the servoy/sybase_db/sybase.config file. Then, when you start Servoy a message window will open up for the database. This window will display all messages concerning the database. You’ll be able to see why the backup didn’t work.
Let me know if you’re still having trouble.
David
Hi Dave,
I have isolated the problem a little bit more.
When I have ASA running as a service the events are NOT triggered even when I use the trigger option as you mentioned.
When I quit the service and use the Sybase-engine as supplied with Servoy (by starting up Servoy Developer). The events will be triggerred.
So somehow the difference is in running ASA as a service or not.
ANy suggestions David?