How can I fix tempdb?

How can I fix tempdb?

Post by Stan » Tue, 08 Apr 2003 14:14:55



My tempdb has the allocation errors

(Extent xxx in database ID 2 is marked allocated in the
GAM, but no SGAM or IAM has allocated it)

I moved tempdb to another drive and SQL created it from
the scratch, but it still has the same errors.

In order to fix the database, I need to put it into single-
user mode, but I cannot do this for tempdb.

What should I do?

Thanks,

-Stan

 
 
 

How can I fix tempdb?

Post by Tibor Karasz » Tue, 08 Apr 2003 15:14:16


If you specified a new drive for tempdb and it actually has moved, then you have some problem.
You could always try to stop SQL Server, delete tempdb files and start again. You now know that
you get new fresh files. (Do a backup first, of course.)

If problems are re-introduced then you either have some bug in SQL Server (MS Support) or HW
problems.

--
Tibor Karaszi, SQL Server MVP
For help on TSQL, please provide code we can execute in Query Analyzer


> My tempdb has the allocation errors

> (Extent xxx in database ID 2 is marked allocated in the
> GAM, but no SGAM or IAM has allocated it)

> I moved tempdb to another drive and SQL created it from
> the scratch, but it still has the same errors.

> In order to fix the database, I need to put it into single-
> user mode, but I cannot do this for tempdb.

> What should I do?

> Thanks,

> -Stan


 
 
 

How can I fix tempdb?

Post by Andrew J. Kell » Tue, 08 Apr 2003 15:16:21


Stan,

Moving it should not be necessary since it is created from scratch eachtime
you restart sql server.  When do you get these errors?  Is tempdb
accessible?  Only thing I can think of off hand is to attempt to shrink
tempdb down to it's smallest size and see if that helps.  If not then I
would give MS PSS a call.

http://support.Microsoft.com/default.aspx?scid=fh;EN-US;sql    SQL Support
http://www.mssqlserver.com/faq/general-pss.asp   MS PSS

--

Andrew J. Kelly
SQL Server MVP


Quote:> My tempdb has the allocation errors

> (Extent xxx in database ID 2 is marked allocated in the
> GAM, but no SGAM or IAM has allocated it)

> I moved tempdb to another drive and SQL created it from
> the scratch, but it still has the same errors.

> In order to fix the database, I need to put it into single-
> user mode, but I cannot do this for tempdb.

> What should I do?

> Thanks,

> -Stan

 
 
 

How can I fix tempdb?

Post by Greg Linwoo » Tue, 08 Apr 2003 15:35:34


Hi Stan.

The easy way is simply to stop / start SQL Server if you can afford to
because tempdb is rebuilt upon each restart of SQL Server.

Regards,
Greg Linwood


Quote:> My tempdb has the allocation errors

> (Extent xxx in database ID 2 is marked allocated in the
> GAM, but no SGAM or IAM has allocated it)

> I moved tempdb to another drive and SQL created it from
> the scratch, but it still has the same errors.

> In order to fix the database, I need to put it into single-
> user mode, but I cannot do this for tempdb.

> What should I do?

> Thanks,

> -Stan

 
 
 

How can I fix tempdb?

Post by Stan » Tue, 08 Apr 2003 21:47:06


Andrew,

I get these errors when I run DBCC. Specifically,
"Extent (1:473160) in database ID 2 is marked allocated in
the GAM, but no SGAM or IAM has allocated it."

I shrunk it, but still have 3532 allocation errors....

Quote:>-----Original Message-----
>Stan,

>Moving it should not be necessary since it is created

from scratch eachtime
Quote:>you restart sql server.  When do you get these errors?  
Is tempdb
>accessible?  Only thing I can think of off hand is to
attempt to shrink
>tempdb down to it's smallest size and see if that helps.  
If not then I
>would give MS PSS a call.

>http://support.Microsoft.com/default.aspx?scid=fh;EN-

US;sql    SQL Support
>http://www.mssqlserver.com/faq/general-pss.asp   MS PSS

>--

>Andrew J. Kelly
>SQL Server MVP



>> My tempdb has the allocation errors

>> (Extent xxx in database ID 2 is marked allocated in the
>> GAM, but no SGAM or IAM has allocated it)

>> I moved tempdb to another drive and SQL created it from
>> the scratch, but it still has the same errors.

>> In order to fix the database, I need to put it into
single-
>> user mode, but I cannot do this for tempdb.

>> What should I do?

>> Thanks,

>> -Stan

>.

 
 
 

How can I fix tempdb?

Post by Andrew J. Kell » Tue, 08 Apr 2003 22:00:00


If you stop and restart sql server and the error is still there I would call
MS PSS.  I have never seen a situation like this where a restart didn't fix
the problem with tempdb.

--

Andrew J. Kelly
SQL Server MVP


> Andrew,

> I get these errors when I run DBCC. Specifically,
> "Extent (1:473160) in database ID 2 is marked allocated in
> the GAM, but no SGAM or IAM has allocated it."

> I shrunk it, but still have 3532 allocation errors....

> >-----Original Message-----
> >Stan,

> >Moving it should not be necessary since it is created
> from scratch eachtime
> >you restart sql server.  When do you get these errors?
> Is tempdb
> >accessible?  Only thing I can think of off hand is to
> attempt to shrink
> >tempdb down to it's smallest size and see if that helps.
> If not then I
> >would give MS PSS a call.

> >http://support.Microsoft.com/default.aspx?scid=fh;EN-
> US;sql    SQL Support
> >http://www.mssqlserver.com/faq/general-pss.asp   MS PSS

> >--

> >Andrew J. Kelly
> >SQL Server MVP



> >> My tempdb has the allocation errors

> >> (Extent xxx in database ID 2 is marked allocated in the
> >> GAM, but no SGAM or IAM has allocated it)

> >> I moved tempdb to another drive and SQL created it from
> >> the scratch, but it still has the same errors.

> >> In order to fix the database, I need to put it into
> single-
> >> user mode, but I cannot do this for tempdb.

> >> What should I do?

> >> Thanks,

> >> -Stan

> >.

 
 
 

1. Need help fixing TEMPDB

The tempdb on my database was 452 MB consisting of a 402 MB data_segment
of which 2 MB was on Master device and 400MB was on tempdb device and
the log_segment was 50MB on templog device.

After trying to shrink the database using 'DBCCshrinkdb' I was unable to
connect to the server in Enterprise manager getting a message 'Cannot
allocate space for object syslogs in tempdb because the logsegment
segment is full'

On the advice of the error message I ran SP_extendsegment logsegment,
tempdb.  This did allow me to connect to the server through enterprise
manager but I now have a 2MB data_segment and a 400MB log_segment. When
I try to expand the data_segment to any device it just adds to the log
size.  

What can I do to get my tempdb back to a single device with a 200MB
data_segment and a 50MB logsegment??

Any help would be greatly appreciated!!  

Sincerely,


2. Internet Question

3. How to fix tempdb?

4. Set Default value in ADO Update statement

5. MDX : Canned Report or OLAP

6. Access Help

7. Anyone know of some canned (cheap or free) DB performance testing software

8. Select returns -1

9. canned code to get db on web quickly via perl or

10. Cans access2.0 engine access btrieve files?

11. bcp canned app

12. if you will promise Allahdad's swamp against cans, it will angrily depart the unit

13. Switching from inhouse to canned package.