TempDB Log File Running Out Of Free Space While Running DBCC CheckDB On Large Database
May 28, 2015
In my environment, there is maintenance plan configured on one of the server and while running DBCC checkdb on a database of size around 200GB, log file usage of tempdb is increasing and causing the maintenance job to fail.
What can I do to make the maintenance job run successfully, size of the tempdb database is only 50GB and recovery model is set to simple. It cannot be increased as the mount point on which it is residing is 50GB.
View 3 Replies
ADVERTISEMENT
Jan 22, 2008
Hi everybody,
I have a very strange problem. I have installed MS WS2003 SP2 and MS SQL 9.0.3054 SP2.
I have database dbTraceIT with data file on D drive and log file on E drive. If I run T-SQL command:
use dbTraceIT
go
dbcc checkdb
or Integration Services Package (task: Check Database Integrity Task, developed with MS VS)
this comand/or task has generated the hard disk errors on D drive. The chkdsk tool reports errors when hdd index verification has been completed. After hdd errors€™ repairing, if I run checkdb T-sql command the situation is repeated again.
Question: is it a bug or something different? Do you have similar disk error if you use e.g. Integration Service Packages (for instance index rebuild or whatever)?
Regards,
Dariusz
PS
Steps to reproduce
Find any DB on your MS SQL. Run chkdsk command on hard drive where DB€™s data file is stored. Verify that everything is OK.
Run t-sql command
use dbTraceIT
go
dbcc checkdb
3. Run chkdsk again. It should show hdd errors.
View 20 Replies
View Related
Feb 12, 2015
What is the use of running DBCC FREESESSIONCACHE.
How frequently can we do this on all the databases.
What happens if we schedule to run it every 1min.
Are there any advantages/disadvantages of running this on all databases.
View 5 Replies
View Related
Apr 26, 2001
hello everyone,
I have a question about the under what circumstances will a large database with mostly free space not shrink?
thanks
View 2 Replies
View Related
Dec 5, 2007
During the night I run a checkdb that reported a error in tempdb, log down in post for more info.
Table error: Object ID 1109769969, index ID 0, partition ID 72057595983888384, alloc unit ID 72057596039200768 (type LOB data). The off-row data node at page (6:459), slot 0, text ID 296853831680 is not referenced.
If run a checkdb know it€™s not finding any problem. I€™m bit confused what to do restart the server to get new tempdb? I check with for SQL Server 2005 Books Online for the €œMSSQLSERVER_8974€? error, it tells me to look after a €œLook for Hardware Failure€?. In the sql server log its stands that its have found 82 errors
DBCC CHECKDB (tempdb) executed by AIR5MSSQLService found 82 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 3 seconds.
Directly after this a stackdump are generated. Somewhere in the middle of my dbcc script.
After the i get the result of the next databases.
DBCC CHECKDB (model) executed by AIR5MSSQLService found 0 errors and repaired 0 errors. Elapsed time: 0 hours 0 minutes 0 seconds.
This is compress version of the log of dbcc job
NEW COMPONENT OUTPUT
Microsoft(R) Server Maintenance Utility (Unicode) Version 9.0.3042
Report was generated on "FLEFSE".
Maintenance Plan: Underhåll
Duration: 00:12:55
Status: Warning: One or more tasks failed..
Details:
Check Database Integrity (FLEFSE)
Execute TSQL on Local server connection
Execution time out: 1800
Task start: 2007-12-05T02:00:01.
Task end: 2007-12-05T02:12:57.
Failed-1073548784) Executing the query "DECLARE AllDatabases CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT name FROM sys.databases WHERE state_desc='ONLINE'
OPEN AllDatabases
DECLARE @DBNameVar NVARCHAR(128)
DECLARE @Statement NVARCHAR(300)
FETCH NEXT FROM AllDatabases INTO @DBNameVar
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT N'CHECKING DATABASE ' + @DBNameVar
SET @Statement = N'USE ' + @DBNameVar + CHAR(13)
+ N'DBCC CHECKDB (' + @DBNameVar + N')'
EXEC sp_executesql @Statement
PRINT CHAR(13) + CHAR(13)
FETCH NEXT FROM AllDatabases INTO @DBNameVar
END
CLOSE AllDatabases
DEALLOCATE AllDatabases
" failed with the following error: "Table error: Object ID 1109769969, index ID 0, partition ID 72057595983888384, alloc unit ID 72057596039200768 (type LOB data). The off-row data node at page (6:459), slot 0, text ID 296853831680 is not referenced.
Table error: Object ID 1109769969, index ID 0, partition ID 72057595983888384, alloc unit ID 72057596039200768 (type LOB data). The off-row data node at page (6:459), slot 1, text ID 296853897216 is not referenced.
... to ...
Table error: Object ID 1109769969, index ID 0, partition ID 72057595983888384, alloc unit ID 72057596039200768 (type LOB data). The off-row data node at page (6:459), slot 81, text ID 296871985152 is not referenced.
CHECKING DATABASE master
DBCC results for 'master'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'master'.
DBCC results for 'mssqlsystemresource'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'mssqlsystemresource'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE tempdb
DBCC results for 'tempdb'.
.... removed lines ...
CHECKDB found 0 allocation errors and 82 consistency errors in table '#4225BEF1' (object ID 1109769969).
.... removed lines ...
CHECKDB found 0 allocation errors and 82 consistency errors in database 'tempdb'.
repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (tempdb).
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE model
DBCC results for 'model'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'model'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE msdb
DBCC results for 'msdb'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'msdb'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE ReportServer
DBCC results for 'ReportServer'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'ReportServer'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE ReportServerTempDB
DBCC results for 'ReportServerTempDB'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'ReportServerTempDB'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE caisqlp
DBCC results for 'caisqlp'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'caisqlp'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE BKALKYL
DBCC results for 'BKALKYL'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'BKALKYL'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE distribution
DBCC results for 'distribution'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'distribution'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE DMVstatsDB
DBCC results for 'DMVstatsDB'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'DMVstatsDB'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE BALDATA
DBCC results for 'BALDATA'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'BALDATA'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE VirtualCenterDB
DBCC results for 'VirtualCenterDB'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'VirtualCenterDB'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE BINGE01
DBCC results for 'BINGE01'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'BINGE01'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE BMATINK
DBCC results for 'BMATINK'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'BMATINK'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE BORDE01
DBCC results for 'BORDE01'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'BORDE01'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE BSTATISTIK
DBCC results for 'BSTATISTIK'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'BSTATISTIK'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE MPSmartDB
DBCC results for 'MPSmartDB'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'MPSmartDB'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE SmarTeamPilot
DBCC results for 'SmarTeamPilot'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'SmarTeamPilot'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE STATISTIK
DBCC results for 'STATISTIK'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'STATISTIK'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE VBAS
DBCC results for 'VBAS'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'VBAS'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE MDataMM_0F
DBCC results for 'MDataMM_0F'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'MDataMM_0F'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE DLDB
DBCC results for 'DLDB'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'DLDB'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
CHECKING DATABASE ILDB
DBCC results for 'ILDB'.
.... removed lines ...
CHECKDB found 0 allocation errors and 0 consistency errors in database 'ILDB'.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.
Command:USE master;
GO
SET NOCOUNT ON;
GO
DECLARE AllDatabases CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT name FROM sys.databases WHERE state_desc=''ONLINE''
OPEN AllDatabases
DECLARE @DBNameVar NVARCHAR(128)
DECLARE @Statement NVARCHAR(300)
FETCH NEXT FROM AllDatabases INTO @DBNameVar
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT N''CHECKING DATABASE '' + @DBNameVar
SET @Statement = N''USE '' + @DBNameVar + CHAR(13)
+ N''DBCC CHECKDB ('' + @DBNameVar + N'')''
EXEC sp_executesql @Statement
PRINT CHAR(13) + CHAR(13)
FETCH NEXT FROM AllDatabases INTO @DBNameVar
END
CLOSE AllDatabases
DEALLOCATE AllDatabases
GO
SET NOCOUNT OFF;
GO
This is the top of the stack-dump
=====================================================================
BugCheck Dump
=====================================================================
This file is generated by Microsoft SQL Server
version 9.00.3042.00
upon detection of fatal unexpected error. Please return this file,
the query or program that produced the bugcheck, the database and
the error log, and any other pertinent information with a Service Request.
Computer type is AT/AT COMPATIBLE.
Current time is 02:00:08 12/05/07.
8 Unknown CPU 9., 2333 Mhz processor (s).
Windows NT 5.2 Build 3790 CSD Service Pack 2.
Memory
MemoryLoad = 98%
Total Physical = 8189 MB
Available Physical = 163 MB
Total Page File = 9795 MB
Available Page File = 1527 MB
Total Virtual = 8388607 MB
Available Virtual = 8373732 MB
DBCC RESULTS
--------------------
... lines removed ....
**Dump thread - spid = 107, PSS = 0x00000000EE497BC0, EC = 0x00000000EE497BD0
***Stack Dump being sent to C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGSQLDump0009.txt
* *******************************************************************************
*
* BEGIN STACK DUMP:
* 12/05/07 02:00:08 spid 107
*
* DBCC database corruption
*
* Input Buffer 510 bytes -
* DECLARE AllDatabases CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
* SELECT name FROM sys.databases WHERE state_desc='ONLINE' OPEN AllDatab
* ases DECLARE @DBNameVar NVARCHAR(128) DECLARE @Statement NVARCHAR(30
* 0) FETCH NEXT FROM AllDatabases INTO @DBNameVar WHILE (@@FETCH_STATU
* S = 0) BEGIN PRINT N'CHECKING DATABASE ' + @DBNameVar SET @Stat
* ement = N'USE ' + @DBNameVar + CHAR(13) + N'DBCC CHECKDB (' + @DB
* NameVar + N')' EXEC sp_executesql @Statement PRINT CHAR(13) + C
* HAR(13) FETCH NEXT FROM AllDatabases INTO @DBNameVar END CLOSE A
* llDatabases DEALLOCATE AllDatabases
*
* *******************************************************************************
* -------------------------------------------------------------------------------
* Short Stack Dump
PSS @0x00000000EE497BC0
-----------------------
My DBCC script looks like this
USE master;
GO
SET NOCOUNT ON;
GO
DECLARE AllDatabases CURSOR LOCAL FAST_FORWARD READ_ONLY FOR
SELECT name FROM sys.databases WHERE state_desc='ONLINE'
OPEN AllDatabases
DECLARE @DBNameVar NVARCHAR(128)
DECLARE @Statement NVARCHAR(300)
FETCH NEXT FROM AllDatabases INTO @DBNameVar
WHILE (@@FETCH_STATUS = 0)
BEGIN
PRINT N'CHECKING DATABASE ' + @DBNameVar
SET @Statement = N'USE ' + @DBNameVar + CHAR(13)
+ N'DBCC CHECKDB (' + @DBNameVar + N')'
EXEC sp_executesql @Statement
PRINT CHAR(13) + CHAR(13)
FETCH NEXT FROM AllDatabases INTO @DBNameVar
END
CLOSE AllDatabases
DEALLOCATE AllDatabases
GO
SET NOCOUNT OFF;
GO
View 2 Replies
View Related
Jul 21, 2015
I am currently SQL admin since our ordinary SQL folks are at summer vacation.
Yesterday SCOM alerted that File Group is running out of space on one not so critical database "The file group "PRIMARY" for the database "loganalys" in SQL instance "MSSQLSERVER" on computer "sqlserver2" is running out of space".
I logged in to the SQL server and checked the database in question. It is a very large DB with a size  of 577 GB.The storage on which the database files resides has 123 GB free space so that isn't the issue.
The database is set to autogrowth 1 MB at a time (unrestricted) so that doesn't seem to be the issue either.However, in the database properties under General, it says Space avaliable: 570 MB.
I guess that this may be the issue, that this is under some treshold for SCOM to alert on.I have looked at the other databases and they have everything between 0,25MB to 270MB space avaliable (they are all set to autogrowth 1 MB, unrestricted).
I am not sure what this means and if I have to do something about it?
View 6 Replies
View Related
Sep 1, 2015
We are receiving following alerts frequently about 1:40 AM in the morning. We have backups running on 11:00 PM everyday and rebuild job running at 2:00 AM. Not sure the exact cause of this error.
Error:
The file group "PRIMARY"Â for the database "tempdb" in SQL instance "MSSQLSERVER" on computer "XYZ" is running out of space.Â
tempdev Initial size : 133,100 MB Growth: By 10 percent, Limited to 140000 MBÂ
templog  Initial Size : 5,475 MB   Growth: By 10 percent, Unlimited
View 8 Replies
View Related
Mar 5, 2002
Hi,
I have some space available in the database, I tried dbcc shrink database and srrink file. I am not getting the disk space. But the amount of free space on the database sometime get increased.
Any help please
Thanks
John Jayaseelan
View 1 Replies
View Related
Jun 30, 2015
what is the best way to make free space in tempdb?
View 5 Replies
View Related
Nov 29, 2000
does anyone know if tempdb can be physically moved to a different partition on a disk drive on SQL Server 7.0? Since it can't be backed up I'm hesitant to use the sp_detach/sp_attach procedure because I don't want to crash it. If nothing else is available, I can attempt moving it this way at the end of the day and then just reboot to get tempdb back up again if the server fails, but I'd really appreciate a suggestion from someone who has more know-how than I do about system table operations. Thanks again
View 1 Replies
View Related
Sep 1, 2015
We are receiving following alerts frequently about 1:40 AM in the morning. We have backups running on 11:00 PM everyday and rebuild job running at 2:00 AM. Not sure the exact cause of this error.
Error:
The file group "PRIMARY" for the database "tempdb" in SQL instance "MSSQLSERVER" on computer "XYZ" is running out of space.
tempdev Initial size : 133,100 MB Growth: By 10 percent, Limited to 140000 MB
templog Initial Size : 5,475 MB Growth: By 10 percent, Unlimited
View 9 Replies
View Related
Aug 13, 2014
I have a tempdb split into 4 files (5 if you include the log).
Autogrowth is disabled on the mdf/ndf files so that they can be used round robin (1 file per logical CPU).
Is there a way to be alerted when there is x% of free space left?
I know hwo to check the free space via t-sql but want to be able to be alerted. I could run a sql job that reports the free space and send a database mail message if under x% but wondered if there was a built in (or better) method?
I also have SQL Sentry.
SQL 2012 Standard
View 9 Replies
View Related
Feb 4, 2008
Hi all
Iam working in Prodcution ENV,Please help how make space
The log file for database 'Home_alone' is full. Back up the transaction log for the database to free up some log space.
View 10 Replies
View Related
Aug 28, 2001
I have a question on database size, specifically, what difference would I expect in the size of a db (the space actually used for data, not indexes) if I have one single data device vs. multiple data devices spanned across different physical drives. I have 2 customers that have identical database tables (all columns are integers), customer A has 27 million rows and customer B has 36 million rows. If I do an sp_spaceused on the table, customer A's data takes up 9.7 gig, whereas customer B only takes up 3.2 gig, even though it has 9 million more rows. Statistics have been updated, so I'm confident the sp_spaceused is accurate on both databases.
The only differences I can see between the 2 databases is that customer B has 5 separate data files (6 gig each) for the database which are part of the Primary filegroup. These files are all on the D: drive, which is a partition on a RAID 5 array. Customer A has a single large data file (24 gig), which is also on a RAID 5 array.
Any ideas?
View 4 Replies
View Related
Jun 3, 2015
We carried out an in-place upgrade on our production server on Saturday - going from 2008 R2 to 2014.
We had tested this method out in dev/test and pre-production with only minor post issues to fix.
However, on production we had an issue whereby checkdb was hitting 100% CPU and caused overnight processes to hang. The checkdb statement was terminated and disabled by a colleague at 1 am.
Since then we have restored this database to a dev server and ran checkdb against it with no_infomsgs and all_errormsgs but it still hasn't finished since Monday morning!
The database is just over 800 GB and whilst checkdb was crippling the cpu, logical reads are less than one. However, sp_whoisactive is showing that it has done 56 million reads so far and this number increases periodically so it looks like it keeps going back to re-check the database with a deep dive.
Also, on a different environment, we ran check table statements and one of them took over 9 hours for a single table but came back clean (see attachment).
We need to wait for the output but the database is still in use in production and the mess will just get worse if it is indeed corrupted.
View 5 Replies
View Related
Apr 19, 2007
How to check the free space in a DB file using TSQL?
------------------------
I think, therefore I am - Rene Descartes
View 20 Replies
View Related
Nov 6, 1998
Has anyone had experience in running DBCC in a 24x7 environment. The only time that I can run them is after a server crash. I have had the server lock up when the results page returned. It almost immpossible to go down for more than hour, because we have international clients. The database is 1.2 GB but it is in constant use because we run reports from Crystal Info server and through an ASP for client use. I have consider dump the database to another site, running DBCC, copying back to the original and restoring the logs until the current time. Any suggestions will be greatly appreciated.
Lisa Bodine
Systems Analyst/DBA
Cyntergy Corp
View 3 Replies
View Related
Jul 8, 2015
I would like to know if it is possible to date stamp the output file for the DBCC integrity check?
The following cmd works fine however I tried different ways to date stamp the output file with no luck.
sqlcmd -U backup -P Password -S Server -Q"DBCC CHECKDB('DatabaseName') WITH ALL_ERRORMSGS" -o"G:LOGSDBCCResults.txt"
View 5 Replies
View Related
Jan 30, 2007
Hi all
I have a database that is being restored to another instance of SQL server 2000 sp4 by attatching the mdf and ldf files. I then run EXEC sp_change_users_login to sync the users. When I try to run some delete commands on the new restored database I get 'Fatal error 8908'
I then run a DBCC CHECKDB on the database and told to run it again with REPAIR_ALLOW_DATA_LOSS
I have noticed that when I create a new databse and restore a .bak over this the delete commands work.
Am I correct in thinking that I can get rid of the corruption on the original database by creating a new database then restoring a valid .bak backup on this new database.
View 3 Replies
View Related
Oct 17, 2007
I've read the bad news in other post but hopefully I misunderstood them. We have a database on an old sql 2000 server which had a data drive failure. The last backup is a year old. They told me they stopped doing backups because nothing was going to change. Well, changes were made to structures and stored procedures on the production (only) server and they want to try to recover the database. Should I bother opening a support call with MS? I'm embarred to even post the question but you never know. The database is currently in emergency mode. I can't see any of the user tables or stored procedures in Mangement Studio.
Msg 8966, Level 16, State 1, Line 1
Could not read and latch page (1:17913) with latch type SH. sysobjects failed.
View 5 Replies
View Related
May 23, 2000
Hi,
In sql 7.0 , i would like to create a database with the size of 10Gb, in my server couple of databases already exist.
How do i know how much free space is there in File group.
we are having only one file group i.e PRIMARY.
Could anyone pls tell me about this.
Thank u.
--kavira
View 2 Replies
View Related
Sep 24, 2007
We've got an alert setup on our production database to warn us when the log file(s) exceeds 7 gigs. The Alert is triggering:
"The SQL Server performance counter 'Log File(s) Size (KB)' (instance 'Lexus') of object 'SQLServer:Databases' is now above the threshold of 7000000.00 (the current value is 7057656.00)."
However, according to the file system, the database properties screen files, and properties tabs, the log files combined are at under 5 gigs so this alert should not be going off.
The scary part is, when going to right-click on the database, choosing "tasks" and going to "Shrink > Files", the "Free Space" shows negative numbers for the first log file:
Log 1
Currently Allocated space: 118.69 MB
Available Free Space: -5323.24 MB (-4485%)
Log 2
Currently Allocated space: 4853.13 MB
Available Free Space: 411.20 MB (7%)
Has anybody ever run into this? Should I be worried that there is a bigger issue at hand?
Thanks!
View 20 Replies
View Related
May 30, 2001
One of our databases seems to be looking dodgy as some scheduled jobs are failing, but DBCC CHECKDB is no use since it has been running for over 1/2 hour without giving me any results, just the spinning globe.
How do I find out what is wrong without resorting to backups?
View 3 Replies
View Related
May 16, 2000
I am trying to reindex a large table, and cannot because there isn't enough room on the the primary filegroup. the database consistes of one physical file in the primary filegroup. the table is over 50% of the size of the database. When the table is less than 50% of the size of the database, I do not see this problem.
BTW, the only index on the table is the primary key which consists of two columns, one is an integer and the other datetime.
It seems as if SQL server needs 1x the current size of the table to be free in order to reindex? Is this the case?
It is not an option for me to allow the database to autogrow. Is there anything else I can do?
Thanks for your help!
View 3 Replies
View Related
Feb 13, 2006
SQL2000 Server, SP4, a database with a 17Gb log file. It has been backed up so all transactions should be validated, now the real file size needs to be shrunk because I need the diskspace plus I want to speed up the backup process.
http://support.microsoft.com/kb/272318/ Tells me what to do but not where to do it.
So I need to run this code : DBCC SHRINKFILE(pubs_log, 2)
but from what console do I run it?
View 4 Replies
View Related
Dec 14, 2000
According to the books online:
In earlier versions of SQL Server, it was recommended that DBCC statements be made a regular part of a database backup strategy.
It was recommended that databases be checked before being backed up. In SQL Server 7.0, this is no longer necessary.
Are integrity checks really no longer necessary in SQL Server 7? I have a third-party book in which the author states that he still does them
anyway. Should I continue to do DBCC CHECKDB?
Also, I am using database maintenance plans for several SQL Servers. When the integrity checks are performed will it log any errors
in the output log generated during the execution of the maintenance plan? The logs I receive look like the following:
[2] Database CPMCC_GL: Check Data and Index Linkage...
** Execution Time: 0 hrs, 39 mins, 54 secs **
If an error is detected would it be recorded here, or is this just a log to let me know that the checks were performed?
Tony
View 1 Replies
View Related
Jul 8, 1999
Hi
Our supplyer of application we use say that dbcc checkdb or dbcc newalloc can
give corrupt database (use version 6.5). I wonders about this statement. Are ther some how have explanation about this
Kent vahlen
View 2 Replies
View Related
Mar 29, 2007
Let me start off by saying that under normal circumstance I would just restore from the last good backup. However in this case it appears as though the last good backup was sometime last August ... arg! After much yelling at the person responsible I've been attempting to get my blood pressure below 200 and see what data is recoverable.
First off, this was a RAID5 system that failed 1 drive. Secondly, before we got someone in there to replace said drive it failed a second drive and the system went down. We managed to massage the system back online but it appears that there is some corruption as a result which is no surprise.
I've done DB repairs in the past and it hasn't been too bad, but this time it is looking a little gnarly.
I've kicked everyone off the server and tried starting SQLServer several different ways.
I tried starting the service normally and then flagging the bad DB into single user mode with "ALTER DATABASE foo SET SINGLE_USER". I then did a select * from sysdatabases to make sure it took, which it did. I also tried starting the whole SQLServer in single user mode from the command line, "SQLServr -m".
I can run "DBCC CHECKDB('foo')" and I get a long ugly list of allocation errors. I posted it to a link as the 1349 lines returned is a little long:
http://chrisnet.net/sqlbad/dbcc_checkdb.txt
But when I attempt to bite the bullet and destroy data in an attempt to put things back together with:
"DBCC CHECKDB('foo', REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS"
I get:
Server: Msg 7919, Level 16, State 2, Line 1
Repair statement not processed. Database needs to be in single user mode.
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
But yet the database is in single user mode, according to everything I check check on. Is this just SQL's way of telling me the corruption is too severe to be repaired? No output is displayed in the shell cmd window like it is for a successful DBCC either (when running sqlservr -m).
Ideas? Or do I put a bullet through it's brain?
-Chris
View 7 Replies
View Related
Jul 26, 2007
When I try to delete a job from Enterprise Manager Console I get the following error:
Erro 644: Could not find the index entry for RID '163bd10000010000' in index page (1:553), index ID 0 database 'msdb'
Oh and this is on MSDE.
Here is my complete output of DBCC CHECKDB
DBCC results for 'msdb'.
DBCC results for 'sysobjects'.
There are 280 rows in 6 pages for object 'sysobjects'.
DBCC results for 'sysindexes'.
There are 143 rows in 6 pages for object 'sysindexes'.
DBCC results for 'syscolumns'.
There are 1567 rows in 26 pages for object 'syscolumns'.
DBCC results for 'systypes'.
There are 26 rows in 1 pages for object 'systypes'.
DBCC results for 'syscomments'.
There are 357 rows in 108 pages for object 'syscomments'.
DBCC results for 'sysfiles1'.
There are 2 rows in 1 pages for object 'sysfiles1'.
DBCC results for 'syspermissions'.
There are 116 rows in 1 pages for object 'syspermissions'.
DBCC results for 'sysusers'.
There are 13 rows in 1 pages for object 'sysusers'.
DBCC results for 'sysproperties'.
There are 0 rows in 0 pages for object 'sysproperties'.
DBCC results for 'sysdepends'.
There are 1635 rows in 8 pages for object 'sysdepends'.
DBCC results for 'sysreferences'.
There are 12 rows in 1 pages for object 'sysreferences'.
DBCC results for 'sysfulltextcatalogs'.
There are 0 rows in 0 pages for object 'sysfulltextcatalogs'.
DBCC results for 'sysfulltextnotify'.
There are 0 rows in 0 pages for object 'sysfulltextnotify'.
DBCC results for 'sysfilegroups'.
There are 1 rows in 1 pages for object 'sysfilegroups'.
DBCC results for 'backupset'.
There are 1045 rows in 44 pages for object 'backupset'.
DBCC results for 'sysjobschedules'.
There are 7 rows in 1 pages for object 'sysjobschedules'.
DBCC results for 'syscategories'.
There are 19 rows in 1 pages for object 'syscategories'.
DBCC results for 'systargetservers'.
There are 0 rows in 0 pages for object 'systargetservers'.
DBCC results for 'backupfile'.
There are 1451 rows in 24 pages for object 'backupfile'.
DBCC results for 'systargetservergroups'.
There are 0 rows in 0 pages for object 'systargetservergroups'.
DBCC results for 'systargetservergroupmembers'.
There are 0 rows in 0 pages for object 'systargetservergroupmembers'.
DBCC results for 'restorehistory'.
There are 1 rows in 1 pages for object 'restorehistory'.
DBCC results for 'sysalerts'.
There are 9 rows in 1 pages for object 'sysalerts'.
DBCC results for 'sysoperators'.
There are 0 rows in 0 pages for object 'sysoperators'.
DBCC results for 'sysnotifications'.
There are 0 rows in 0 pages for object 'sysnotifications'.
DBCC results for 'restorefile'.
There are 2 rows in 1 pages for object 'restorefile'.
DBCC results for 'systaskids'.
There are 0 rows in 0 pages for object 'systaskids'.
DBCC results for 'syscachedcredentials'.
There are 0 rows in 0 pages for object 'syscachedcredentials'.
DBCC results for 'restorefilegroup'.
There are 1 rows in 1 pages for object 'restorefilegroup'.
DBCC results for 'logmarkhistory'.
There are 0 rows in 0 pages for object 'logmarkhistory'.
DBCC results for 'sysdtscategories'.
There are 3 rows in 1 pages for object 'sysdtscategories'.
DBCC results for 'sysdtspackages'.
There are 0 rows in 0 pages for object 'sysdtspackages'.
DBCC results for 'sysdtspackagelog'.
There are 0 rows in 0 pages for object 'sysdtspackagelog'.
DBCC results for 'sysdtssteplog'.
Server: Msg 8935, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1. The previous link (1:343) on page (1:371) does not match the previous page (1:382) that the parent (1:300), slot 32 expects for this page.
Server: Msg 8978, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1. Page (1:371) is missing a reference from previous page (1:343). Possible chain linkage problem.
There are 0 rows in 0 pages for object 'sysdtssteplog'.
DBCC results for 'sysdtstasklog'.
There are 0 rows in 0 pages for object 'sysdtstasklog'.
DBCC results for 'sysdbmaintplans'.
There are 4 rows in 1 pages for object 'sysdbmaintplans'.
DBCC results for 'sysdbmaintplan_jobs'.
There are 4 rows in 1 pages for object 'sysdbmaintplan_jobs'.
DBCC results for 'sysdbmaintplan_databases'.
There are 12 rows in 1 pages for object 'sysdbmaintplan_databases'.
DBCC results for 'sysdbmaintplan_history'.
There are 724 rows in 23 pages for object 'sysdbmaintplan_history'.
DBCC results for 'log_shipping_primaries'.
There are 0 rows in 0 pages for object 'log_shipping_primaries'.
DBCC results for 'log_shipping_secondaries'.
There are 0 rows in 0 pages for object 'log_shipping_secondaries'.
DBCC results for 'mswebtasks'.
There are 0 rows in 0 pages for object 'mswebtasks'.
DBCC results for 'sqlagent_info'.
There are 0 rows in 0 pages for object 'sqlagent_info'.
DBCC results for 'sysdownloadlist'.
There are 0 rows in 0 pages for object 'sysdownloadlist'.
DBCC results for 'backupmediaset'.
There are 1045 rows in 11 pages for object 'backupmediaset'.
DBCC results for 'sysjobhistory'.
Server: Msg 8935, Level 16, State 1, Line 1
Table error: Object ID 2073058421, index ID 1. The previous link (1:382) on page (1:564) does not match the previous page (1:371) that the parent (1:300), slot 33 expects for this page.
There are 626 rows in 208 pages for object 'sysjobhistory'.
CHECKDB found 0 allocation errors and 3 consistency errors in table 'sysjobhistory' (object ID 2073058421).
DBCC results for 'sysjobs'.
There are 7 rows in 1 pages for object 'sysjobs'.
DBCC results for 'backupmediafamily'.
There are 1045 rows in 20 pages for object 'backupmediafamily'.
DBCC results for 'sysjobservers'.
There are 7 rows in 1 pages for object 'sysjobservers'.
DBCC results for 'sysjobsteps'.
There are 9 rows in 1 pages for object 'sysjobsteps'.
CHECKDB found 0 allocation errors and 3 consistency errors in database 'msdb'.
repair_rebuild is the minimum repair level for the errors found by DBCC CHECKDB (msdb ).
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
View 1 Replies
View Related
Mar 9, 2007
This script can be used to shrink a database file in small increments until it reaches a target free space size.
It will loop to execute the DBCC SHRINKFILE command to shrink the database file by the desired increment until it reaches the target free space.
It is often better to shrink database files in small increments so that it can make continuous, incremental progress, instead of trying to shrink by a large amount in one command. This makes it easier to shrink a database that must be shrunk by a large amount, and makes it easier to interrupt without losing all progress.
-- Shrink_DB_File.sql
/*
This script is used to shrink a database file in
increments until it reaches a target free space limit.
Run this script in the database with the file to be shrunk.
1. Set @DBFileName to the name of database file to shrink.
2. Set @TargetFreeMB to the desired file free space in MB after shrink.
3. Set @ShrinkIncrementMB to the increment to shrink file by in MB
4. Run the script
*/
declare @DBFileName sysname
declare @TargetFreeMB int
declare @ShrinkIncrementMB int
-- Set Name of Database file to shrink
set @DBFileName = 'MyDatabaseFileName'
-- Set Desired file free space in MB after shrink
set @TargetFreeMB = 1000
-- Set Increment to shrink file by in MB
set @ShrinkIncrementMB = 50
-- Show Size, Space Used, Unused Space, and Name of all database files
select
[FileSizeMB]=
convert(numeric(10,2),round(a.size/128.,2)),
[UsedSpaceMB]=
convert(numeric(10,2),round(fileproperty( a.name,'SpaceUsed')/128.,2)) ,
[UnusedSpaceMB]=
convert(numeric(10,2),round((a.size-fileproperty( a.name,'SpaceUsed'))/128.,2)) ,
[DBFileName]= a.name
from
sysfiles a
declare @sql varchar(8000)
declare @SizeMB int
declare @UsedMB int
-- Get current file size in MB
select @SizeMB = size/128. from sysfiles where name = @DBFileName
-- Get current space used in MB
select @UsedMB = fileproperty( @DBFileName,'SpaceUsed')/128.
select [StartFileSize] = @SizeMB, [StartUsedSpace] = @UsedMB, [DBFileName] = @DBFileName
-- Loop until file at desired size
while @SizeMB > @UsedMB+@TargetFreeMB+@ShrinkIncrementMB
begin
set @sql =
'dbcc shrinkfile ( '+@DBFileName+', '+
convert(varchar(20),@SizeMB-@ShrinkIncrementMB)+' ) '
print 'Start ' + @sql
print 'at '+convert(varchar(30),getdate(),121)
exec ( @sql )
print 'Done ' + @sql
print 'at '+convert(varchar(30),getdate(),121)
-- Get current file size in MB
select @SizeMB = size/128. from sysfiles where name = @DBFileName
-- Get current space used in MB
select @UsedMB = fileproperty( @DBFileName,'SpaceUsed')/128.
select [FileSize] = @SizeMB, [UsedSpace] = @UsedMB, [DBFileName] = @DBFileName
end
select [EndFileSize] = @SizeMB, [EndUsedSpace] = @UsedMB, [DBFileName] = @DBFileName
-- Show Size, Space Used, Unused Space, and Name of all database files
select
[FileSizeMB]=
convert(numeric(10,2),round(a.size/128.,2)),
[UsedSpaceMB]=
convert(numeric(10,2),round(fileproperty( a.name,'SpaceUsed')/128.,2)) ,
[UnusedSpaceMB]=
convert(numeric(10,2),round((a.size-fileproperty( a.name,'SpaceUsed'))/128.,2)) ,
[DBFileName]= a.name
from
sysfiles a
CODO ERGO SUM
View 5 Replies
View Related
Jun 25, 2006
Any idea of a function or procudure the returns the free space of a data file so I can see when I need to reclaim free space.
View 3 Replies
View Related
Nov 26, 2001
I am trying to insert 2 fields of about 9 million records into a table and i keep getting this message
Server: Msg 1101, Level 17, State 10, Line 1
Could not allocate new page for database 'TEMPDB'. There are no more pages available in filegroup DEFAULT. Space can be created by dropping objects, adding additional files, or allowing file growth.
Server: Msg 1101, Level 17, State 1, Line 1
Could not allocate new page for database 'TEMPDB'. There are no more pages available in filegroup DEFAULT. Space can be created by dropping objects, adding additional files, or allowing file growth.
I have unrestricted file growth and over 200 mb of space left, what else can i do?
View 6 Replies
View Related
Jul 20, 2005
I'm running a simple DBCC DBREINDEX ('myTable') and I receive thefollowing error:"Server: Msg 169, Level 15, State 2, Line 2A column has been specified more than once in the order by list.Columns in the order by list must be unique. DBCC executioncompleted. If DBCC printed error messages, contact your systemadministrator."I can successfully reindex other tables in this database. I thoughtthat perhaps I had objects in the database that ended up with the samename, but I've pretty much ruled that out.Any suggestions?ThanksJohn D. Morrismailto://jmorris_42@hotmail.com
View 2 Replies
View Related