To change the backup location and the backup schedule of the external Sybase database subsequent to its initial backup, perform the following tasks on the device that has the external Sybase database installed and running:
Launch the DBISQL utility. For more information, see Step 1 in the Backing Up the External Sybase Database on a Windows or Linux Server.
Change the database backup schedule and the backup location as required.
You can use the same SQL query to change the database backup schedule and the backup location. You can change the backup schedule and the location at the same time or at a different time.
ALTER EVENT name_of_the_existing_backup_schedule_event_containing_the_database_backup_schedule_or_location_that_you_want_to_change
SCHEDULE
new_database_backup_schedule or existing_backup_schedule
HANDLER
BEGIN
BACKUP DATABASE DIRECTORY 'complete_path_of_the_existing_database_backup_location or complete_path_of new_database_backup_location'
TRANSACTION LOG TRUNCATE
END;
If you want to back up the database to a directory on Windows, you must use \\ (double backslash) as the delimiter while specifying the database backup directory path
For example, assume that you have database backup event, zendbbackup, that locally backs up the database to c:\dbackup at 1:00 a.m. every day. If you want to change the database backup schedule or location, review the following:
If you want to back up the database at 11:00 p.m. on Monday, Wednesday, and Friday of every week, change the database backup schedule in the zendbbackup event by executing the following query in the DBISQL utility:
ALTER EVENT zendbbackup
SCHEDULE
'11:00 PM' ON ('Monday', 'Wednesday', 'Friday')
HANDLER
BEGIN
BACKUP DATABASE DIRECTORY 'c:\\dbbackup'
TRANSACTION LOG TRUNCATE
END;
If you want to back up the database to a new location, such as e:\zendb\dbbackup, change the database backup location in the zendbbackup event by executing the following query in the DBISQL utility:
ALTER EVENT zendbbackup
SCHEDULE
'1:00 AM' EVERY 24 HOURS
HANDLER
BEGIN
BACKUP DATABASE DIRECTORY 'e:\\zendb\\dbbackup'
TRANSACTION LOG TRUNCATE
END;
If you want to back up the database at 2:00 a.m. on the first, second, and third day on the month to a new location, e:\zendb\dbbackup, change the database backup schedule and location in the zendbbackup event by executing the following query in the DBISQL utility:
ALTER EVENT zendbbackup
SCHEDULE
'2:00 AM' EVERY 24 HOURS ON (1,2,3)
HANDLER
BEGIN
BACKUP DATABASE DIRECTORY 'e:\\zendb\\dbbackup'
TRANSACTION LOG TRUNCATE
END;