SQLDBPool Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

restore db from transaction log

Go down

restore db from transaction log Empty restore db from transaction log

Post  Amit Mon Nov 21, 2011 6:54 pm

I want to restore my data base from transaction log but i dont know how i can i done this job ..........and where i can find transaction log in sql 2005 . how can i enable transaction log ...kindly provide me all details about transaction log .....

Thanks,
Amit Sharma

Amit
Guest


Back to top Go down

restore db from transaction log Empty Re: restore db from transaction log

Post  Admin Mon Nov 21, 2011 7:04 pm

Hi Amit,

To restore a database from transaction log, trasnsaction log backup must be scheduled on the database. You can check the MSDB backup history table for the transaction log backup.

Execute below query to check the backup history. If TLog backup backup is not scheduled, you can create a database maintenance plan and schedule it.

Declare @dbname as varchar(100)
set @dbname = 'write database name here'
SELECT CONVERT(CHAR(100), SERVERPROPERTY('Servername')) AS Server ,
msdb.dbo.backupset.database_name ,
CASE msdb..backupset.type
WHEN 'D' THEN 'Database'
WHEN 'L' THEN 'Log'
WHEN 'I' THEN 'Diff. Database'
ELSE msdb..backupset.type
END AS Backup_Type ,
msdb.dbo.backupset.backup_start_date ,
msdb.dbo.backupset.backup_finish_date , msdb.dbo.backupmediafamily.physical_device_name,
-- msdb.dbo.backupset.description ,
DATEDIFF(mi,msdb.dbo.backupset.backup_start_date, msdb.dbo.backupset.backup_finish_date) AS 'Duration(Min)',
msdb.dbo.backupset.name AS 'backupset_Name' ,
msdb.dbo.backupset.backup_size ,
msdb.dbo.backupset.expiration_date ,
msdb.dbo.backupset.is_copy_only ,
msdb.dbo.backupmediafamily.logical_device_name
FROM msdb.dbo.backupmediafamily
INNER JOIN msdb.dbo.backupset
ON msdb.dbo.backupmediafamily.media_set_id = msdb.dbo.backupset.media_set_id
WHERE (CONVERT(DATETIME, msdb.dbo.backupset.backup_start_date, 102) >= getdate()-2)
AND msdb..backupset.type in ( 'D','I','L')
AND msdb.dbo.backupset.database_name =@dbName
ORDER BY 2,5 DESC


Let me know if you need more information.

Regards,
Jugal Shah

Admin
Admin

Posts : 8
Join date : 2011-11-14

https://sqldbpool.board-directory.net

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum