jeudi 12 mars 2015

SQL Server 2008, problem with backing up transaction log


I have a transaction backup job which runs every hour, first it backups up from the database log to another drive then it shrinks the log and deletes old trn files.


Maintenance job


The middle task shrinks the log fle.



USE myDB
DBCC SHRINKFILE('myDB_LOG', 0, TRUNCATEONLY)


However, sometimes I received the following error.



Description: Executing the query "USE myDB DBCC SHRINKFILE('myDB_LOG'..." failed with the following error: "Backup, file manipulation operations (such as ALTER DATABASE ADD FILE) and encryption changes on a database must be serialized. Reissue the statement after the current backup or file manipulation operation is completed. Changed database context to 'myDB'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 22:00:19 Finished: 22:04:17 Elapsed: 238.26 seconds. The package execution failed. The step failed.



What seems to be happening, is there a better way to backup and shrink the database log? I am using SQL server 2008





Aucun commentaire:

Enregistrer un commentaire