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.

 All Forums
 SQL Server 2005 Forums
 SQL Server Administration (2005)
 Where is my .trn backup file

Author  Topic 

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 00:03:40
Hi,
I created a maintenance plan(Full backup and Hourly Transaction Log Backup) in SQL Server 2005, the backup file was set to the default location: “Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup”. From the SQL Server Agent, the Job History is showing the jobs succeeded. But when I open the Backup folder, I only see the .bak file, the .trn file is not there. I changed the file location of Hourly Transaction Log Backup, the .trn file is still not there, even the Job History is showing the jobs succeeded for the new location.

Can some one tell me what happened to the maintenance plan and where is the .trn backup file?

Thanks.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-03 : 00:24:47
select * from msdb..backupmediafamily where physical_device_name like '%.trn'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 10:09:48
Thanks Tara,
I ran the script you provided in System Databases/msdb and I got nothing!
So, that means the Transaction Log Backup didn't run. But, why I got jobs succeeded in Job History?
Is there any way to fix it?

Thanks.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-03 : 10:26:41
"So, that means the Transaction Log Backup didn't run."

Are you sure the Backup Filename was ".trn" ?

More normally backup files have ".BAK" extension - but they can be whatever you make them, of course

Perhaps look for files with a date/time around when the backup was made.

See script here for backup history:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=54300#273265
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 10:49:43
Thanks Kristen,
Surely I setup the maintenance plan to make a Full backup with “bak” as Backup file extension, Transaction Log backup with the “trn” as Backup file extension. The problem is I have the full backup files (.bak) as designed, but the .trn file is not there. Both jobs were showing “succeeded” in Job History.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-03 : 10:54:49
I would still query the backup history to see what file, if any, was created around that time.

maybe the file was created, and then something deleted it (e.g. the retention policy was set very short). Knowing what SQL thinks!! it did may help solve the problem.

You might have a file ending in "trn" rather than ".trn" ... or ".trm" [typo] or somesuch ...
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 11:54:57
Thanks Kristen,

This query was used in msdb of System Databases:
select * from dbo.backupmediafamily
only the .bak files showing in the results like this:
C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Backup\VCData2\VCData2_backup_201006022358.bak

And there is no any transaction log record like .trn.

In Maintenance Cleanup Task, the (Delete files older than the following:) was set 1 week(s).

I have created Back Up Database Task in maintenance plan for both Full and Transaction Log types for over 60 databases in 8 servers in the same way. So there was no [typo] or [trm] kind of error in the setting.

Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-03 : 12:05:00
"This query was used in msdb of System Databases:
select * from dbo.backupmediafamily
"

I was meaning to use the query from the link I posted which gives more detail, and more control over what you see. As an example it will restrict the output to a specific database name.

What you are looking for is the backup file path / filename created at the time the job ran successfully.

Glad to hear there is no chance of you having made a mistake, but it doesn't help in finding what has happened to the file. As I said, maybe something has deleted it since, but to know that we need to know the path / name of the file that was created and then whether it is still there, or not.
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 12:34:28
Thanks Kristen,
I used your script and changed the BS.database_name = N'VCDATA2' for my database, and got all 7 records with Type "D", means "Full".
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-03 : 12:59:19
Try deleting and then recreating your maintenance plan. You can verify if a transaction log backup is happening by checking the backupmediafamily table as well as checking the SQL Server Error Log.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-03 : 13:23:42
"I used your script and changed the BS.database_name = N'VCDATA2' for my database, and got all 7 records with Type "D", means "Full"."

Do you mean that 1) you restricted to Type "D" in the WHERE clause?
or 2) that you only saw type "D" records in the output - i.e. the only thing in your WHERE clause was the database name?

If its the second then no Transaction Log Backup was created for this database.

Might be worth trying the query for a different database - one that you know has successfully had Transaction backups - just to check that the query is actually outputting history data for transaction backups

If that works OK and thus we conclude that no transaction backup was produced for VCDATA2 database then need to review the maintenance plan (nuke it and have another go as Tara suggests seems a good plan to me!)
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 14:00:48
Thanks Kristen and Tara,

I know the propose of this query, surely I won’t restrict the type. The ONLY change in the query was replacing the N'MyDatabaseName' with my database name N'VCDATA2'. And I got the result of 7 records with “D” in field “type”.
Actually I did delete the maintenance plan and recreate a new one last week. I’ll try that again, if still not working, Probably something wrong with the database, and I will do backup/restore for the database.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-03 : 14:03:03
What's the recovery model of your database?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 14:47:54
quote:
Originally posted by tkizer

What's the recovery model of your database?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog



Bulk-logged.
Should I chang it to Full?
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-03 : 14:50:02
Not necessarily, I just wanted to make sure it wasn't set to SIMPLE.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-03 : 15:00:44
"I know the propose of this query, surely I won’t restrict the type."

Yeah, well I have no way of knowing that you know that.

I'd still recommend running the query on a database name that you know has Transaction log backups, just to double check. Different SQL versions or something that I haven't come across before might mean it isn't working properly for you.
Go to Top of Page

lw1990
Yak Posting Veteran

85 Posts

Posted - 2010-06-03 : 16:41:51
Hi Tara,
The job started to backup the trans log file(.trn) on the next hour after I changed the recovery model from Bulk-logged to Full!

Don't know why, can someone explain it?

Many thnaks to Tara and Kristen.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-06-03 : 16:46:43
I can't explain that as tlog backups are available for both bulk_logged and full.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2010-06-04 : 02:19:24
Maintenance Wizard has a reputation for being "Less than ideal".

Sorry, no idea why you didn't get TLog backups, but I'm glad you've got it fixed.
Go to Top of Page
   

- Advertisement -