I thought you took the tree!
Ian Dennis
Posts
-
silly puzzle(s) of the day [SOLUTION ADDED] -
How to keep yourself together...I'd been a smoker since I was about 18 (I'm 58 now). I'd tried to give up several times ... I'd tried the patch, just smoking cigars or pipes, even tried snuff. Nothing worked and each time I tried to stop, I was quickly back to 30 a day. About nine and a half years ago, I was in England on business. On the day I was due to fly back to California, I woke up feeling like death warmed up ... coughing and spluttering and hacking. I didn't tell anyone because I was scared they wouldn't let me fly. And, of course, I kept on smoking. After I'd flown non-stop from Gatwick to LAX, the first thing I did when I got out of the terminal building was ... to light up, which started me off again. I really felt like death warmed over, my chest ached, and I was half convinced that I had angina. I cought a shuttle from LAX to Orange County / John Wayne. My roomie was there to pick me up and I threw my pack at him, saying "You finish these, I don't want any more cigarettes today." By this time, I was a friend of Bill W, and so I never actually said that I'd given up smoking. I simply kept saying "I'm not going to have a cigarette just for today, but I might have one tomorrow". I've been saying that now for 9 years, 6 months and 2 days. Some days other people's smoke really bothers me, sometimes I still take a deep sniff, but most of the time I don't notice it, and it doesn't bother me at all. I miss the ability to use tobacco to think through a problem (like Sherlock Holmes) and I find I go through ball-point pen caps at an alarming rate. I also miss the occasional post-prandial cigar, but I know that even one and I'd be back to 30 a day again, or worse.
-
Just once I want one of those Nigerian emails to be realThat looks frightening!!!
-
Excessive unused spaceI've finally figured it out. See my other post in this thread. Thanks for all your help!
-
Excessive unused spaceThe problem seems to be centered around bugs reported by Microsoft as articles 934378 and 924947. Additionally, someone had set the database autogrowth setting to 10% and so towards the end of the conversion run the autogrow was taking longer and longer (resizing by 10% of 39Gb takes a lot longer than 10% of 6Gb) and therefore my inserts were timing out - to add misery to confusion. My eventual solution was: (1) Initially size the database to 40Gb. This solved the problem mentioned above (2) Make sure each table inserted into had at least one clustered index. This worked around the bug mentioned in article 924947 (3) When the conversion was finished, run a routine to rebuild ALL the indexes for ALL the tables. This worked around the bug mentioned in article 934378. (4) Finally, do a DBCC SHRINKDATABASE Without these fixes, the conversion left database = 39Gb, unused = 27Gb. With these fixes, the conversion left database = 12Gb, unused = 4Gb. It took me a long time to find (each run of the conversion takes 10 hours) but I ended up learning a lot about SQL Server!
-
Excessive unused spaceI've been running a series of further tests. My first thought is that my problem was connected with deleting records, as that is something I'm doing that is, perhaps, unusual. For instance, I delete 25,000 sewer records out of a table and insert 25,000 new sewer records, then I delete 27,000 water records out of the same table and insert 27,000 new water records, etc. But I'm checking the progress of my program with
sp_spaceused @updateusage='true'
and it shows the unused area of my database growing when I am inserting records only ... i.e., no deleting is taking place!!! Basically, what I am seeing is the unallocated size diminishing at the same speed as the unused area grows, but when the unallocated size gets to zero, it just increases the datafile size (at which point, the unallocated space gets big again). It never releases any of the unused area, nor can I claw any of that back from any of the maintenance routines I've described above. The only thing to add is the application is written in VB.Net. I've recently learnt that a colleague wrote another VB.Net conversion program which exhibited the same symptoms, even although his was operating on an Oracle database, not a SQL Server one. Does that make any lightbulbs go off in anyone's brain? -
Excessive unused spaceI don't remember now. I've got some more info which I'll post in a new message in this same thread so, please view that. Thanks
-
Excessive unused spaceI've used @updateusage = 'TRUE' and it doesn't make any difference. I've totally killed the database, reloaded it, and started testing my program again. It's growing already ... Reload database - DbSize:06,033, Unalloc:0,515, Reserved:05,341, Data:3,786, Index:1,493, Unused:0,061 Run conversion. - DbSize:18,558, Unalloc:3,511, Reserved:14,869, Data:5,049, Index:1,815, Unused:8,006 (sizes in Mb)
-
Excessive unused spaceI'm using a simple recovery model (I've just discovered!) but I need to state that it is the data file (mdf) that is growing out of control, not the log file (ldf).
-
SQL triple-join questionIsn't it :
SELECT userID FROM tblUsers,tblTeams,tblOffices WHERE officeID='XYZ' AND teamOfficeID=officeID AND userTeamID=teamID
? -
inserting a row into table from the form dataTry
SQLstr="insert into books ({col1}, {col2}) values ('" & textBox1.Text & "', '" & textBox2.Text & "')";
(This is VB ... I'm not sure what language you're using ... the important thing is the {col1} and {col2} which are the names of the table colums that @textBox1 and @textBox2 are going to be inserted into) I find that a good debug tip is to use Query Analyser to test the structure of my SQL statement before I insert it into code. So I would try something likeINSERT INTO books VALUES ('SQL Programming', 'Robert Vieira')
and when that didn't work I'd tryINSERT INTO books (title, author) VALUES ('SQL Programming', 'Robert Vieira')
-
Excessive unused spaceI am currently testing a data import program which deletes records from files in a SQL 2000 database, and then inserts new ones. The database has over 2000 tables, my program affects about 30 of them and there are over one million records that get deleted and reinserted. During repeated testing, I noticed two events: (1) that the database would expand to fill the space allocated for it, and (2) that after several runs I would start getting SQL timeouts. I also noticed that these two events seem to be linked – when I increased the allocated space, the timeouts would disappear until such point that the database had filled the allocated space again. When I investigated further (using ‘sp_spaceused’) I found the following: 07.80 Gb Data 01.70 Gb Index 27.10 Gb Unused 36.60 Gb Reserved 01.00 Gb Unallocated 38.60 Gb Database Size It seems to me that the culprit is that ‘unused’ space. If I could eliminate that, I should be able to get the database down to a manageable size … about 10.5 Gb. I spent some time researching how to do that. I tried various procedures, including DBCC SHRINKFILE, SHRINKDATABASE, UPDATEUSAGE and DBREINDEX scripts, but nothing works. I ran a third-party SQL defrag utility but, although it reported that some tables/indexes could benefit by defragging, after I ran the defrag routine I noticed that nothing actually got defragged. (This could be because it is an eval version - even tho its supposed to be fully functioning, or it could be symptomatic of a larger problem with the database). At this point I'm stymied. Can anyone help me? Ian Dennis Business Analyst, Assets HANSEN
-
The Cat/Code PrincipleThe Eqyptians used to worship cats. Cats have never forgotten this.
-
Programmers of the pastI've also known a number of musicians who have become programmers. They tell me it's because of the similarities between writing a symphony and writing code (artistry while conforming to rules), also programmers can see exactly how their code runs, but musicians will probably never be able to hear how their symphany is supposed to sound (unless they can afford to hire a full orchestra).