Coming soon
Coming soon

Cannot backup to a Network location using a Database Event

Hint Ref: 020707040006
Hint Date: 04/07/2007

Hint Details:

EFFECTED VERSION: Sybase 8
DETAILS:

Problem:

Using a database event to backup the database to a local directory on the server works OK, however it does not work to a network location,

Solution:

This is because the Database service does not have rights to the network location (if using the System Account) and it is more reliable to run tasks using procedures and functions than directly from the event.

1. Put the backup command into a Database Function:

CREATE function spaceman.dobackup()
returns char(1)
begin
message('Doing Backup');
backup database directory '\\\\192.168.101.8\\data\\dbbackup\\livebackup'
TRANSACTION LOG TRUNCATE;
message('Backup Completed')
end

2. Within the Database Event, call the function:

CREATE EVENT SMDailyBackup
SCHEDULE daily_backup
START TIME '7:00AM' EVERY 24 HOURS
HANDLER
call spaceman.dobackup()
END

3. Within the Sybase Service configuration go to the 'Account' tab and select 'Other Account'. Select a user who has rights to the database location and the network location

4. Restart the service.