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 2000 Forums
 SQL Server Administration (2000)
 Clearing Log File

Author  Topic 

tincupal
Starting Member

24 Posts

Posted - 2008-08-07 : 13:00:01
Hi All,

I've created a SQL Enterprise Manager database maintenance plan to backup the databases nightly. However, the log file is not getting cleared as part of this process. I don’t see an option in the maintenance plan to reset the log file.

How can I clear the log file as part of the backup maintenance plan or do I have to create a separate script to clear the log file?

Thanks, Al

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-07 : 13:07:34
Either start backing up the transaction log (it's available in the maintenance plan) or change your recovery model to SIMPLE. We cover this topic at least once a day, so feel free to do some searching.

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

Subscribe to my blog
Go to Top of Page

tincupal
Starting Member

24 Posts

Posted - 2008-08-07 : 14:01:22
Hi Tara,

Ok thanks, I'll do some searching. One more question: will backing up the log file automatically clear it?

Thanks, Al
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-07 : 14:18:19
It'll clear out the completed transactions.

We backup our transaction logs every 15 minutes.

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

Subscribe to my blog
Go to Top of Page

tincupal
Starting Member

24 Posts

Posted - 2008-08-11 : 11:57:02
I turned on log file backup but the only log file being backed up is for the model database. All other databases are getting error “Backup can not be performed on this database. This sub task is ignored.”

The log files are in a separate folder from the database. Is this a problem?

The model log file is in the same folder as the database. But so is master and pubs and they are not being backup.

Any ideas?

Thanks, Al
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-08-11 : 12:00:45
Your Recovery model of databases should be Full or Bulk-logged to backup transaction log.
Go to Top of Page

tincupal
Starting Member

24 Posts

Posted - 2008-08-11 : 12:30:03
I'm using a database maintenance plan where I'm backing up all databases.
Go to Top of Page

tincupal
Starting Member

24 Posts

Posted - 2008-08-11 : 12:32:00
Where would I find the recovery model?
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-08-11 : 12:34:02
quote:
Originally posted by tincupal

I'm using a database maintenance plan where I'm backing up all databases.


Doesn't matter? Only Model has Full Recovery model by default coz that's the model for new database you create.
Go to Top of Page

tincupal
Starting Member

24 Posts

Posted - 2008-08-11 : 12:42:19
Ok, so I still have my original problem. Can I truncate log files during a backup maintenance plan or do I need to run a special script? The databases are from a 3rd party software package.

Thanks, Al
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-08-11 : 12:47:11
To see the recovery model, right click on the databases, go to properties and then options.

In SQL Server 2000, you'll need to create a maintenance plan for FULL recovery model and one for SIMPLE.

Or just use my script to backup the databases, it's smart enough to know the difference:
http://weblogs.sqlteam.com/tarad/archive/2008/05/21/60606.aspx

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

Subscribe to my blog
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-08-11 : 12:54:44

Find your recovery nmodel for all databases using this:

SELECT Name,DATABASEPROPERTYEX(Name,'RECOVERY') AS [Recovery Model]
FROM master.dbo.sysdatabases
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-08-11 : 22:17:29
If you like to keep simple recovery model for those dbs, you don't need log backup then.
Go to Top of Page
   

- Advertisement -