all groups > sql server misc > october 2003 >
You're in the

sql server misc

group:

Transaction log 18 G and database 470MB


Transaction log 18 G and database 470MB Narendra Talreja
10/8/2003 9:34:39 PM
sql server misc: SQL gurus,

Simple question:

Our database is 470MB and transaction log has become 18GB! (Clustered). I
see local Fixed drives in both the SQL boxes from 'System Information' and
disk manager where data is being stored.

We are backing up database once in 24 hours and transaction logs every two
hours during business hours and full transaction log at night.

Simple Question is if we are backing full transaction log at night then
isn't supposed to make the transaction log to "zero" bytes or say clear the
transaction log automatically??? After all when transaction logs have been
backup then why the transaction log continue to grow??

If the database is crashed what would be the sequence to recover:

Restore database in restore mode then restore first transaction log backup
taken after full backup of database and then restore the next backup taken
of transaction log and so on. (to apply in sequence starting from the first
one backup of transaction log taken).

Now question is :

Situation #1

1) if database is crashed and we still have transaction logs then can we
restore transaction logs (not backup of transaction logs) at the end of
procedure to restore as given above??

Situation #2

2) database is crashed and we do not have transaction logs then we can
restore as given in the procedure above except that in the last stage we
keep "no restore mode"??

Thanks

Mei

Re: Transaction log 18 G and database 470MB mike NO[at]SPAM high-pow-er.com
10/25/2003 11:46:41 PM
[quoted text, click to view]

Simple answer:

change your database to simple mode.


your transaction file will barely grow. since your backin up every
Re: Transaction log 18 G and database 470MB Tibor Karaszi
10/28/2003 10:03:46 AM
[quoted text, click to view]

Does not necessarily help. If you have one modification requiring a large amount of log space, then
simple recovery will not help. Also, even if you backup every two hour, doing log backup gives point
in time restore. Thanks to this, you can often achieve zero data loss. For some organizations,
losing two hours worth of data is not desirable.
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver


[quoted text, click to view]

Re: Transaction log 18 G and database 470MB GSX Neil
11/4/2003 11:38:03 AM
Try

USE <dbname>
GO
BACKUP LOG <dbname> WITH TRUNCATE_ONLY
GO
DBCC LOGINFO(<dbname>)
GO
DBCC SHRINKFILE(<logname>)
GO

You need to replace <dbname> with the database name and <logname> with the
logical file name of the log file. You can ShrinkFile on any logical
filename, including the dat's.

Hope it helps, certainly did the job for us.

NEIL.

[quoted text, click to view]

Re: Transaction log 18 G and database 470MB Ryan Waight
11/4/2003 11:57:33 AM
Have a look at this article.

http://www.mssqlserver.com/faq/logs-shrinklog.asp

--
HTH
Ryan Waight, MCDBA, MCSE

[quoted text, click to view]

Re: Transaction log 18 G and database 470MB GSX Neil
11/4/2003 1:00:24 PM
Very useful but it's never proved an issue for us. Some of our users have
18Gb log files (or whatever disk spaces they have) and after running the
first and third commands they never have the problem again.

Log files are difficult to understand at a low level but if something works
for us we tend to stick with it.

Cheers for the additional info though.

NEIL.


[quoted text, click to view]

Re: Transaction log 18 G and database 470MB Tibor Karaszi
11/4/2003 1:05:52 PM
[quoted text, click to view]

What recovery mode are you running the database in? Are you doing regular
log backups? Regular database backups? Doing TRUNCATE_ONLY will break the
chain of log backups and is unacceptable in some organizations. Also, it
should not be necessary, a regular log backup should suffice just as well.

--
Tibor Karaszi


[quoted text, click to view]

Re: Transaction log 18 G and database 470MB GSX Neil
11/4/2003 2:26:57 PM
We do a full backup of all the data every time, not interested in the log!

"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@cornerstone.se>
[quoted text, click to view]

Re: Transaction log 18 G and database 470MB Tibor Karaszi
11/4/2003 2:45:30 PM
Seems it would be easier to set the database to simple recovery then.

--
Tibor Karaszi


[quoted text, click to view]

Re: Transaction log 18 G and database 470MB GSX Neil
11/4/2003 3:04:09 PM
Quite right and will be done!

"Tibor Karaszi" <tibor.please_reply_to_public_forum.karaszi@cornerstone.se>
[quoted text, click to view]

AddThis Social Bookmark Button