To run this please have database options recovery model set to FULL, this can be changed in the SSMS --- right click databse --- properties ---options --- recovery model to FULL
--******************************************************************
--schedule this for nightly run
--****************************************************************************
--back up database
BACKUP DATABASE [Database] TO DISK = N'Z:\DATABASE\Database_backup.bak' WITH NOFORMAT, INIT, NAME = N'ManufacturingChina_backup', SKIP, REWIND, NOUNLOAD, STATS = 10
GO
--backup up transaction log
BACKUP LOG [Database] TO DISK = N'Z:\DATABASE\TRANSACTION LOG BACKUPS\Database.trn' WITH NOFORMAT, INIT, NAME = N'Database-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
go
-- shrink log file
DBCC SHRINKFILE (N'Database_Log' , 786)
GO
--******************************************************************
--schedule this for hourly run
--****************************************************************************
--backup log hourly
BACKUP LOG [Database] TO DISK = N'Z:\DATABASE\TRANSACTION LOG BACKUPS\Database.trn' WITH NOFORMAT, NOINIT, NAME = N'Database-Transaction Log Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO
-- backup log hourly
DBCC SHRINKFILE (N'Database_Log' , 786)
go
thanks. do not hesitate trying various download repair sql server, it is often the only choice to retrieve the data from corrupted documents
ReplyDelete