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 |
maranbe
Starting Member
28 Posts |
Posted - 2006-11-15 : 03:36:27
|
Hi folks,I am trying to simulate last transaction log backup after a damaged db in our test server. These are the steps:1. added new records to the test db2. deleted the test db mdf file3. attempted to ran the backup log with no_truncate but failed.4. then tried to rename the test log file4. created a similar db and log and changed recovery to 'full'5. stopped the sql6. replaced the currently created ldf file with the old ldf file7. restarted sql. at this point the status of test db is now suspect. strangely, i have done these steps when i'm restoring db to a new server and worked perfectly fine. only this time that i am having difficulty finding the problem.is there a way i can proceed to recover the last transaction if this is the scenario?Others may have a better way of testing the tail-log backup, would appreciate your suggestions/comments. Kindest regard,SQL Server 2K (Clustered)/2K5_________________________Our life is frittered away by detail ... Simplify, simplify. |
|
Kristen
Test
22859 Posts |
Posted - 2006-11-15 : 03:51:39
|
Would this do:Take a LOG backup - not need to use it, it restricts the next Log Backup to "recent" stuff onlyTake a safe copy of MDF fileTake full backupMake additional test transactionsStop SQL ServiceCopy BACK the saved MDF fileRe-start SQL ServiceTake "tail" Log backupRestore Full backupRestore "tail" TLog backupCheck that Test record is presentKristen |
 |
|
maranbe
Starting Member
28 Posts |
Posted - 2006-11-15 : 04:09:20
|
hi kristen,so the scenario i decsribed earlier won't be able to backup the tail-log? actually, i'm coming from the scenario that suddenly our production db failed due to corruption and i need to recover the latest transactions...thanks for your immediate response.Kindest regard,SQL Server 2K (Clustered)/2K5_________________________Our life is frittered away by detail ... Simplify, simplify. |
 |
|
Kristen
Test
22859 Posts |
Posted - 2006-11-15 : 05:14:39
|
"so the scenario i decsribed earlier won't be able to backup the tail-log? 2. deleted the test db mdf file"Well, after step 2 you won't be able to connect to the database to backup the TLog!If your MDF got corrupted (i.e. real world corruption) you would probably still be able to connect to the database, and make your tail-log.If you could NOT connect to the database then I would try:Stop SQL Service (so file not in use. Do NOT use DETACH)Take a Safe copy of LDF, or just RENAME it if time is critical)Start SQL ServiceRestore the latest FULL backupStop SQL Service, or Detach databaseRename the LDF and COPY the Safe-copy LDF in its place (do NOT just Rename your Safe copy - you need to keep that JustInCase!)Start SQL Service, or Re-attachTake the "tail" TLog backupNOTE: This is only relevant if your Recovery model is FULL. If your recovery model is SIMPLE then your own recourse is your last full backup, or a Log Reader like Lugent/Lumiscent(sp?)I would highly recommend that for a database in Full Recovery Model you should be taking TLog backups every 10 minutes, so that your maximum exposure for this sort of corruption is 10 minutes.If you have a real-word corruption you may want to post in the Data Corruption forumhttp://www.sqlteam.com/forums/forum.asp?FORUM_ID=22with a link back to this threadKristen |
 |
|
|
|
|
|
|