| Author |
Topic |
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 09:51:33
|
| what can I do?all queries that used to work are taking forever now???what can I do?is there a max size for the db that I may have reachedplease advise asap |
|
|
ratheeshknair
Posting Yak Master
129 Posts |
Posted - 2007-08-23 : 10:05:20
|
| If u r using sql 2k5 express the max size limit of a database is 4Gb.RKNAIR |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 10:07:12
|
| and how can I see how much I have used? |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-23 : 10:40:19
|
sp_spaceusedshow information per database. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 12:57:39
|
| master has .91 mb unallocated -- could this be the problem?would this make queries slow?when i restarted the computer the queries went back to normal but this keeps happening. these queries used to work fine and not much has changed. (except more info added but to different tables and not even the tables being queried) |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-23 : 12:58:54
|
What kind of queries?INSERTS? DELETES? UPDATES? Check you logfile size too. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 12:59:03
|
| besides for master i see reserved 3160 KB data 1416 KB index size1080 KB unused 664 KBhow can I compact this? can i delete logs like i used to in sql 7? |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 13:05:02
|
| how can i check the log filesproblem is in queries such asselect count(id) from users where registration in(select distinct reg from reglist where reg is not null) and registration not in(select distinct registration from permits)used to work but now can take 20 minutes to execute |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-23 : 13:10:58
|
[code]-- Alternative 1SELECT COUNT(u.ID)FROM Users AS uWHERE EXISTS (SELECT * FROM RegList AS rl WHERE rl.Reg = u.Registration reg) AND NOT EXISTS (SELECT * FROM Permits AS p WHERE p.Registration = u.Registration) -- Alternative 2SELECT COUNT(DISTINCT u.ID)FROM Users AS uINNER JOIN RegList AS rl ON rl.Reg = u.Registration regLEFT JOIN Permits AS p ON p.Registration = u.RegistrationWHERE p.Registration IS NULL[/code] E 12°55'05.25"N 56°04'39.16" |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-08-23 : 13:18:47
|
| esthera, ignore the master database for now. Also, there aren't any log files to delete that would help with performance. Have you checked Performance Monitor to determine if there is a hardware bottleneck? Have you check sp_who/sp_who2 to see if there is any blocking? When was the last time you ran ALTER INDEX (if SQL 2k5) to defragment indexes? When was the last time you ran UPDATE STATISTICS?Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 13:22:41
|
| i will try this but this is happening with every query.if i restart the machine it seems to work but then slows downwhat else could it be? |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 13:30:40
|
| thanks for your help... can you help me with how to do what you suggest belowHave you checked Performance Monitor to determine if there is a hardware bottleneck?how? Have you check sp_who/sp_who2 to see if there is any blocking? yes and each time i run one of these queries i end up killing it as it hangs the computer.When was the last time you ran ALTER INDEX (if SQL 2k5) to defragment indexes? please guide me -- how do I do this?When was the last time you ran UPDATE STATISTICS?again how??thnaks again for your help and I would appreciate if you can guide me how to do these as I think they will help |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-08-23 : 13:55:34
|
| Restarting the machine is not a solution since it isn't helping in the long run. Since sp_who/sp_who2 is taking forever, you've got an issue with locks. Have you run SQL Profiler to determine what is running when the slow down occurs?For the things that I mentioned in my last post, you'll need to do some reading. Check out the two commands in SQL Server Books Online. Also check out my blog that contains code for these: http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspxFor Performance Monitor, check out CPU and memory to start with.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 14:02:15
|
| sql server is on the web server so i guess yes to other servicesince sp_who/sp_who2 works - it's just that i keep stopping the processes and doesn't help.Have you run SQL Profiler to determine what is running when the slow down occurs? - How do I run this on express?now everything is working fine (since i restarted a few hours ago) but something must be causing all this and I'm trying to figure out what.at the time when the server is slow the cpu goes to 99%any other suggestions? i'll read your links. |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-08-23 : 14:05:33
|
| I just don't have the time to explain all of the things that I asked about. They are complex tools and I've learned to use them over several years. I'd suggest reading all of the performance articles over at www.sql-server-performance.com that has to do with SQL Profiler and Performance Monitor. That's what I did, plus I bought several books on the subject matters.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 14:10:37
|
| tara -- your alter index looks like it may helpcan you explain me the difference between @statsMode types @defragType typeswhich would you suggest in this case? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-08-23 : 14:18:09
|
| I usually use SAMPLED for @statsMode. You can also use DETAILED, but that'll cause it to run for a while.I'd suggest REBUILD for @defragType.REBUILD equates to DBCC DBREINDEX in SQL Server 2000. REORGANIZE equates to DBCC INDEXDEFRAGMENT in SQL Server 2000. If you are interested in the differences, then you've got a lot of reading to do: http://www.microsoft.com/technet/prodtechnol/sql/2000/maintain/ss2kidbp.mspxTara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
esthera
Master Smack Fu Yak Hacker
1410 Posts |
Posted - 2007-08-23 : 14:48:29
|
| no plenty of room free on hard drive.no reduntant backups.i reindexed and i'm going to see what happens and look into performance more tomorrow but any more suggestions will be helpful |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-08-23 : 15:39:05
|
Using IN in queries increases the possiblities of locking.Try to run the two alternatives to your query, as posted above. E 12°55'05.25"N 56°04'39.16" |
 |
|
|
Next Page
|