New to Sql Server, running SQL Server 2000.
Our transaction log file backups occasionally fail as the size of the
transaction log gets really huge. We'd like to schedule additional
transaction log backups. Does that require an exclusive on the database
or can the db be used during a transaction log backup?
Also, does switching to a bulk mode recovery model before a bulk
operation then switching back to full recovery mode after present any
issues?
Thanks in advance.
May 23 '06
16 3831
DataPro (da*******@yaho o.com) writes: Here is what the vendor is recommending:
1. Back up db and log via Windows Explorer or normal db backups 2. Stop services (application... EAS) 3. Disconnect/detach database 4. Delete log via Windows Explorer 5. Reconnect/reattach database.....lo g will dynamically be allocated
Does this make sense?
No! Never delete a log file, unless you are told so by a Microsoft
support professional. There are so many people who have lost their
database, because they deleted the log. I guess it's safe if you
detach first, but I would like to take a gamble with a production
database.
They also want autoshrink turned on but its my understanding some SQL DBA's don't want that. Your thoughts?
Shrinking a database file only make sense if there has been some
exceptional activity. Running a schema upgrade certainly counts as one.
But doing it as a matter of routine, or with autoshrink, only serves
to degrade the performance of the application in three different
ways:
1) The shrinking takes resources.
2) The autogrow takes resources.
3) The log file becomes fragmented on disk.
Autogrow is a mixed blessing. Up to SQL Server 6.5 there was no autogrow,
which meant that if the data or log segment was filled up, it was a
hard stop. Autogrow that was added in SQL 7 avoids these situations,
as long as the disk has space. However, for the DBA there is not
really any difference: he should should still monitor database size
amd increase the size in due time. A 10% autogrow in a 200 GB database
is very painfully noticeable fot the users.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx
DataPro (da*******@yaho o.com) writes: Well SQL Server definetely seems to be a different animal.
Here are some questions a newguy like myself would have about the logging.
The documentation says that once a backup log truncate only is done, a full backup should be taken as the recovery ability of the system has been degraded. Why is that, if that command merely archives committed transactions?
Up-to-the point recovery. You take a full backup at midnight, then
you backup the transaction log once an hour. at 10:23 you run an
UPDATE statement, but forget the WHERE clause. At this point you
can back up the transaction log.
You can the restore the full backup and reapply the transaction log
dumps but stop at 10:22, so you can recover the lost data. If you
somewhere along the line has backed up the transaction log with
NO_LOG or TRUNCATE_ONLY, the log chain is broken, and it's not
possible to continue to apply logs.
A SELECT @@TRANCOUNT yields a count of zero. dbcc opentran(eas) says zero also. dbcc loginfo yeilds 308 rows marked with a '2' which apparently implies that they are open transactions. Why don't they show up in trancount then?
If a log backup supposedly makes the log 'reusable' then why would a 12 gig log grow another Gig right within a few hours of the backup with minimal database use? Wouldn't most of that space be reusable.
I'm not really sure what you are talking about here. If the log file
grew, apparently there was some action going on in the database.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx
Thanks for your replies.
In regards to:
"> A SELECT @@TRANCOUNT yields a count of zero. dbcc opentran(eas) says zero also. dbcc loginfo yeilds 308 rows marked with a '2' which apparently implies that they are open transactions. Why don't they show up in trancount then?
If a log backup supposedly makes the log 'reusable' then why would a 12 gig log grow another Gig right within a few hours of the backup with minimal database use? Wouldn't most of that space be reusable.
I'm not really sure what you are talking about here. If the log file
grew, apparently there was some action going on in the database. "
1.) What I'm not clear on is this....a dbcc loginfo yeilds 308 rows
marked with a 2.
Are those 'active' uncommitted transactions? What do those rows
represent?
2.) If backing up a log makes the space within a log file 'reusable'
why did the log grow in size if the space in the log was made reusable?
Wouldn't the minimal activity I referenced use that reclaimed space
within the log instead of making it bigger?
3) And finally what is the relationship between the results of a dbcc
loginfo command, a dbcc opentran and a A SELECT @@TRANCOUNT
DataPro (da*******@yaho o.com) writes: 1.) What I'm not clear on is this....a dbcc loginfo yeilds 308 rows marked with a 2. Are those 'active' uncommitted transactions? What do those rows represent?
DBCC LOGINFO is not documented, but I learn a little from SQL Server
MVP Tibor Karasiz's article on shrinking: http://www.karaszi.com/SQLServer/info_dont_shrink.asp. (I recommend
that you read this article in whole, although I summarise some details
below.)
Each row represents a VLF, a virtual log file, and 2 indicates that
that VLF is in use. You cannot shrink the log past the last active
VLF. And if all VLF's have a 2, then all VLFs are in use, and obviously
nothing can be shrunk.
You should backup the transaction log, either to disk or just toss it
with TRUNCATE_ONLY.
2.) If backing up a log makes the space within a log file 'reusable' why did the log grow in size if the space in the log was made reusable?
As I discussed above, the log is apparently not reusable.
3) And finally what is the relationship between the results of a dbcc loginfo command, a dbcc opentran and a A SELECT @@TRANCOUNT
@@trancount only reflects the state of the current process.
DBCC OPENTRAN reveals if there are any open transactions. The log
cannot be truncated past the oldest active transaction.
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx
This has been a really usefull thread. I have the same problem, and
debated about starting new thread or continue this one:
DBCC LOGINFO shows my last log entry is in use (as indicated by STATUS
of 2)
DBCC OPENTRAN indicates no active open transactions
My file is 89% empty, Ive backed up the log files repeatedly (first one
was large 40+ GB, now they are < 500K)
I've tried taking the DB offline and back online. The last log entry
still shows in use and I cant shrink.
I read the article, which helps identify why I cant shrink (log file in
use) but now I'm stumped.
TIA
Rob
rcamarda (ro*****@hotmai l.com) writes: This has been a really usefull thread. I have the same problem, and debated about starting new thread or continue this one: DBCC LOGINFO shows my last log entry is in use (as indicated by STATUS of 2) DBCC OPENTRAN indicates no active open transactions My file is 89% empty, Ive backed up the log files repeatedly (first one was large 40+ GB, now they are < 500K) I've tried taking the DB offline and back online. The last log entry still shows in use and I cant shrink. I read the article, which helps identify why I cant shrink (log file in use) but now I'm stumped.
Is the last VLF the only that has status = 2? Or are there several?
Did you try running BACKUP TRANSACTION WITH NO_LOG? (Since you lose the
log chain, you need a full backup as well.)
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se
Books Online for SQL Server 2005 at http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at http://www.microsoft.com/sql/prodinf...ons/books.mspx This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Thiko |
last post by:
Hi
I take one nightly full database backup at 02:00 and backup the
transaction log to one backup set every 15mins.
The commands to do this are as follows and are set up to run as
database jobs:
-- Database Backup
BACKUP DATABASE TO WITH NOINIT ,
|
by: m3ckon |
last post by:
If someone could help me with this I will be in debt to you!
I am a .net developer who is working on a system that has a sql server
2000 backend. On the weekends, I work from home and I have MSDE on my
laptop. This morning I went to update the main SQL server as I added
some new views .. however I managed to import the data too!!
Therefore I have overwritten my local data to the main sql server
database, which has ressulted in loss of...
|
by: James Cheung |
last post by:
Is it possible to load both the SQL 7 database and transaction log
backups to SQL 2000 ? I assume it will perform the upgrade during the
load.
Thanks,
James
|
by: malcolm |
last post by:
In sql server 2000, how do you manually go and truncate the logs? Does
this only occur when you create a backup? all I want to do is manually
shrink the log files. I have backups, so I don't need them.
I actually backup the db once a week and back up the logs every day,
yet the logs are getting real big. I thought this was configured in
the backup and/or the maintanance plan. I've done a restore (from the
db backup) manually hundreds of...
|
by: francois1 |
last post by:
I am running a website with a SQL Server database attached.
My transaction logs are full and my hosting co. won't allocate more
disk space for me.
I need to delete my database transaction logs and asume I will need to
run an SQL script to do this.
Problem: I do not have MS Enterprise Manager of any database utility
on my website apart from MS Access. Where can I download a free SQL
tool that I can use to delete the transaction logs...
| |
by: yashgt |
last post by:
Hi,
We have created a SQL server 2000 database. We observe that the
transaction log keeps growing over time. We are now about to run out of
space. We have been periodically shrinking the database. Nevertheless
the size has increased. I would imagine that a transaction log can be
eliminated if we stop the database. Can that be done? Is there a way to
completely wipe off the transaction log?
Thanks,
|
by: flobroed |
last post by:
Hi,
I've a question regarding the transaction-log backup on SQL-Server
2000. We have implemented a low cost replication. Every evening we make
a full backup and beginning at 7 to 18 we make transaction-log backups
which are restore (no recovery) to the "standby-server". The full
backups are restored every evening.
Today i noticed something strange. Yesterday the last transaction log
was made at 19 and afterwards applied to the standby...
|
by: Trevor Best |
last post by:
I have a client with 150MB database, the transaction log file is
nearly 23GB. It's a PITA for me to backup his data and restore it on
my server as it takes about 30 minutes to restore as it re-creates a
23GB file with no transactions in it :-\
As well as the space taken up by it, does it do any harm being that
size? e.g. does it decrease performance?
While it's there, considering the database is backed up daily, does it
actually do...
|
by: Brian D |
last post by:
In MS SQL 2005 when you do a Full Backup does it also backup and
truncate the transaction logs or do I need to back the transaction
logs up separately?
Thanks.
Brian
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |