cancel
Showing results for 
Search instead for 
Did you mean: 

How and when to truncate log file in database mirroring setup (SQL Anywhere 17.0.11.7458)

fvestjens
Participant
0 Kudos
157

Currently in production environment we create a backup of the database every evening and we truncate the logfile.

In a test environment database mirroring has been setup and we want to truncate the logfile every evening here as well. However that doesn't seem to work. 
We're using "BACKUP DATABASE DIRECTORY 'F:\\transfusion' TRANSACTION LOG ONLY TRANSACTION LOG TRUNCATE;" but that does not work. We get an error see the screenshot belowbbea5dc7-6215-42b5-bed4-def467fc301a.png

How can we truncate the logfile in a database mirror setup?

VolkerBarth
Contributor

AFAIK, you simply cannot truncate the current log in a HA setup because the mirror relies on that - see here.

Instead, you can rename the log, and lateron delete the renamed log, and the log backup on the mirror will be deleted, too.

ricwash
Explorer

We run a backup everynight as well. We use DBBACKUP that comes with SQLA. When the backup runs the current log is archived and a new one started and this carries over to the mirror. So, we never have to truncate the log as it is reset every night with the backup. Unless I am misunderstanding something with your question.

Further, we never backup the database directory because the dbbackup backs the database up to another directory/drive on the server. We then run directory backups of that backup location off the server.

Accepted Solutions (0)

Answers (0)