Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2005-03-03 : 02:39:42
|
| I want to check how Transaction Log backup works, for this want to have some exercise1. Full backup of Northwind2. Transaction log backup of Northwind3. Restore the backup as Nwnd4. Delete some records from Northwind.Employees5. Restore Transaction log backup on Nwnd6. Will we have all the employees which we have even deletedPlease send me the T-SQL for this |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2005-03-03 : 06:12:28
|
| It's a bit pointless if you don't write it yourself (or at least try) isn't it?It's pretty simple so have a go.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
real_pearl
Posting Yak Master
106 Posts |
Posted - 2005-03-07 : 07:22:31
|
| These are the steps that I am performing--Drop existing backup devicesp_dropdevice 'Northwind'--add backup devicesp_addumpdevice 'Disk', 'Northwind', 'C:\backup\Northwind.bak'--Backup databaseBACKUP DATABASE Northwind TO Northwind WITH INITWAITFOR DELAY '00:00:05'--Backup LogBACKUP LOG Northwind WITH TRUNCATE_ONLYWAITFOR DELAY '00:00:05'select * from master..sysprocesses where dbid = db_id('Nwnd')kill 51--Restore databaseRESTORE DATABASE NwndFROM DISK = 'c:\backup\Northwind.bak'WITH NORECOVERY,DBO_ONLY,MOVE 'Northwind' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\Nwnd.mdf', MOVE 'Northwind_Log' TO 'C:\Program Files\Microsoft SQL Server\MSSQL\data\Nwnd_log.ldf'WAITFOR DELAY '00:00:05'--Restore LogRESTORE LOG NwndFROM DISK = 'c:\backup\Northwind.bak'WITH NORECOVERY, DBO_ONLYWAITFOR DELAY '00:00:05'But after restoration, DB shows Nwnd(Loading) and on expansion shows .... (No items)Please tell me how to resolve this issue |
 |
|
|
eyechart
Master Smack Fu Yak Hacker
3575 Posts |
Posted - 2005-03-07 : 12:48:33
|
| you still have the database in NORECOVERY mode. The last logfile you play should have WITH RECOVERY instead. -ec |
 |
|
|
|
|
|