• Skip to main content
  • Skip to primary sidebar

DallasDBAs.com

SQL Server Database Consulting

  • Services
  • Pocket DBA®
  • Blog
  • Testimonials
  • Contact
  • About

Kevin3NF

December 16, 2008 by Kevin3NF Leave a Comment

A series of conversations from several days…compacted into one nightmare. Enjoy:

Front line dude: Acme has a drive space issue…can I shrink the log file?

Kevin3NF: Give it a shot (this is SOP for Acme on this drive)

FLD: Didn’t work

Kevin3NF: Give me the ticket, I’ll take a look.

Kevin3NF: Hey ACME developer…you have a 2 day old transaction taking up all your T-log space…

Acme: ok…let me truncate the log

Kevin3NF: WAIT A SECOND!

Acme: Did that help?

Kevin3NF: No. You just invalidated the T-log backup stream and started causing the backup to fail

Acme: Why?

Kevin3NF: Cuz that big open transaction is still there, and SQL Server thinks there is no full backup now.

Kevin3NF: Hello?

Kevin3NF: (Sees pictures of crickets in his Inbox)

Acme: (hours later): go ahead and run a full backup tomorrow afternoon

Kevin3NF: You know you don’t have a valid backup to recover to, right?

Acme: Yes, but we can’t backup now…

(tomorrow afternoon):
Acme: Hey…who told you to run a full backup?!?!?

Kevin3NF: You did…I have the email.

Acme: (complaint to Kevin3NF’s bosses)

Time passes…repeat scenario.

Big transaction, full log file, fill drive, lather, rinse, repeat.

Customer: FAIL. >:(

Acme me owes ME some fries…but I get paid to deal with stuff like this every day 🙂

Kevin3NF

https://dallasdbas.com/287-2/

Filed Under: Uncategorized

PASS Summit 2008 in review

November 25, 2008 by Kevin3NF 1 Comment

SQL PASS Community Summit 2008

Wow. What a load of information! Almost an overload, but managed to keep my head above the water in almost every session.

The breakdown:

Day 1:

SQLCAT – Overall Lessons Learned from SQL 2008 Experiences
Quite a good bit of variety here, touching on:

   Data Compression

   Backup Compression

   Performance Tuning (Extended Events)

   SQL Server Reporting Services

   Database Mirroring (compressed LogStream)

   Encryption

 

Capitalizing on the SQL Server 2005 System Information
Way more info here than I was able to process…took a few notes to look up after Thanksgiving

 

Understanding and Troubleshooting Transactional Replication Performance
Lots of discussion on subscription streams/mutli-threading and read/write activity of the Log Reader and Distribution Agents. Got a few things to play with.

 

SQL Server 2008 Policy-Based Management – Sharon Dooley
Not a whole lot here I didn’t pick up at the SQL 2008 launch in LA…still a very cool feature I won’t get to use much in our environment.

 

Day 2:

Guiding your Query Plans (by Kalen Delaney)
Guiding query plans didn’t actually enter the picture until late in the presentation, but it was fantastic nonetheless. Most of this session was about Hints…Table, Index, Option, etc. A BUNCH of stuff that never crossed my monitor before. 3 pages of notes worth. Being able to force a recompile of a portion of the overall query is really slick. And the very simple new feature of assigning a value in the declare:

 

DECLARE @MyID INT = 123

 

Smart Database Design – MVPs DrSQL and Paul Nielson
Well outside of what I do from day to day, but pretty cool anyway, since I was a developer many moons ago. Worth the lack of elbow room just to hear from DrSQL and Paul live…too bad my on call phone went a little nuts and I had to leave early

 

Advanced Troubleshooting with SQL Server Extended Events
So far over my head I’m still not sure what I learned…good thing I have notes

 

Business Continuity with Backup and Restore – Peter Ward
I could probably have taught this session. Should have been labeled 200 level, but still good solid information on backup/restore and some of the new (05/08) options (Online restore, Partial, COPY_ONLY, etc.). Thought about arguing a point with Peter, but decided the way he presented his wasn’t likely to cause harm.

 

Day 3:

Data and Backup Compression Lessons Learned
Some fairly impressive numbers here…300GB DB compressed to 45GB, 50% time savings, etc.

Money-maker: use sp_estimate_data_compression to do custom analysis for customers considering whether to move to SQL compression. Assuming you have the install to do it on.

Collecting and Analyzing Performance Metrics in SS2005/8
Got here late, stuck in the back, couldn’t see or hear very well. Saw a little perfmon on the screen I think…


Writing Technical Articles (Kathi Kellenberger)

The only Personal Development session I attended, since I was on the company nickel. Interesting stuff. I’ve thought about teaching and writing a SQL Basics series for new or accidental DBAs that really will never do more than backup/restore or set up Dev systems. Kathi Kellenberger did a fine presentation, including various places to publish to, and what they pay (if anything). I’m completely convinced to NEVER get in on a book project 🙂

End-to-end troubleshooting for SQL Server 2005
Kevin Kline rocks. Many others have blogged this presentation, so I won’t repeat here.

 

 

 

 

 

 

Filed Under: Uncategorized

SQL Injection sucks…

November 11, 2008 by Kevin3NF Leave a Comment

I hate it when that happens…

A good friend of mine has a fairly simple community site, with 30K members, about 7K active.

SQL Server 2000, ASP Classic. DB and site on separate servers.

KerBam! SQL Injected last Monday. Major trashing of data.

Problem 2: No backup since October 2, as the SQL Agent password had changed so the Agent wasn’t started.

Problem 3: Started the agent and it deleted the last full backup because it was older than 4 weeks.

SO: I get the call for help.

Time passes.

More time passes.

After a dozen uploads and downloads of .mdf/.ldf and backup files (from August), I am able to recover much of the data using the fantastic tools from Red-Gate software:

Log Rescue: Identified what got injected, into where and when
SQL Compare: enabled me to create a schema script to replace the relationships I had to remove to fix the data
SQL Data Compare: Helped me replace the trash data with what it looked like in August.

Also, a shout-out to Narayana Vyas Kondreddi for his Search and Replace code that at least got the bad URL out of the data we couldn’t fix.

The site is back up in read-only, and my buddy is reviewing all the code one page at a time.

Lessons learned:
Validate your inputs!
Back up your data, and verify it!

Not only does this one get fries, he gets 10+ hours of recovery effort at no charge, just for having a really cool site I want to see come back up 🙂

Kevin3NF

Filed Under: backup, red gate, sql injection

Gum and bailing wire

June 26, 2008 by Kevin3NF Leave a Comment

I can’t make stuff up this good…

Scenario:

Major website in the IT industry, very well known. Perf issue, most likely related to inefficient queries and/or indexes and stats. Site timeouts all over the place.

Sent customer a list of long running queries and got this:

{Customer} says they are in the process of getting rid of the site. He said use gum and bailing wire for the time being. Thanks for you hard work.

Sadly, I am out of gum and bailing wire. Will spit and duct tape do?

Simply amazing.

Kevin3NF

Filed Under: Uncategorized

Count your zeros….Or, “I want that system”

January 25, 2008 by Kevin3NF Leave a Comment

I was asked to give a once over to a system not built by my team. SQL 2000 32-bit on Windows 2003 64 bit. 40GB RAM.

Min and Max set to 32gb, yet Perfmon is showing 40gb used by SQL Server. Hmm.

Freakshow noticed that the Min and Max Server memory settings seemed a little high at 33000000. 33000000/1024 = 31.4 Terabytes of RAM. Sweet.

Linchi Shea from the .server newsgroup noticed it as well.

We set it to a more conservative 36gb.

You want room for the O/S with that?

Kevin3NF

Filed Under: Uncategorized

SQL 101 – Clustered index vs. Non-clustered

January 17, 2008 by Kevin3NF Leave a Comment

More translating of SQL stuff into less technical terms for the new folks…

SQL Server (and most other database systems) offer the option of using indexes on your data to help queries go faster. The purpose of this post is to give the new SQL dude a quick mental connector while learning the concept.

Clustered Index:

Think of the White pages phone book you have at the house. Now, find the entry that has your phone number in it. Mentally, you think of your last name (parameter 1 in a query), then your first name (parameter 2). So if your last name is Gates, you flip directly to the G section. If your first name is Bill, you go to the B section within the Gates area. At that point, there may be more than one Gates, Bill entry, so your eyes start scanning through them for some other piece of identifiable info, such as a street or city (parameter 3) until you find the correct entry. You then slide over to the right, look at the phone number and return that to your brain.

The White pages are a “Two-column” clustered index on lastname, firstname in alphabetical order (Ascending). The data itself (the names) IS the index. No extra pages at the back of the book. Speaking of extra pages….

Non-clustered index:

Think of every technical book or textbook you’ve ever read. There is almost always a collection of additional pages at the back of the book called the index. These pages do not contain any of the data about the topic at hand…just pointers to where in the book you can find what you are looking for.

Imagine you are holding a SQL Server 2005 administrators book, and you want to find every reference to “Replication.” Yes, you can look in the table of contents but that may leave out an entry found in the Backup/Restore chapter, or Performance troubleshooting. So, you go to the back of the book, look through the alphabetical list of Keywords for “Replication” and now you know that the word exists on pages 45, 255-298, and 453. You have a collection of pointers to the specific data pages in your book that may contain the information you need.

What if I don’t have any indexes?

No clustered index: Imagine finding your name in a white pages that was not sorted alphabetically. You would have to start at the first entry and read every single row until you hit it (a table scan in SQL speak). Ugh.

No non-clustered index: Imagine me telling you to find the phrase “SQL Profiler” in that SQL book you bought, after I rip the table of contents and index pages out. Sounds like a fraternity hazing ritual for IT geeks 😉

How many can I have?

Clustered: 1. How many ways can you sort and print the data in the SAME book? 1.

Non-clustered: More than one, depending on the database platform and version.

That’s all for today…what indexes to have is not a 101 level discussion, other than to say…whatever you join or search on is a good candidate.

Now you are ready for part of your interview 😉

Kevin3NF

Filed Under: Beginner

  • « Go to Previous Page
  • Go to page 1
  • Interim pages omitted …
  • Go to page 39
  • Go to page 40
  • Go to page 41
  • Go to page 42
  • Go to page 43
  • Go to page 44
  • Go to Next Page »

Primary Sidebar

Search

Sign up for blogs, DBA availability and more!

Home Blog About Privacy Policy
  • Home-draft
  • Blog
  • About Us

Copyright © 2026 · WordPress · Log in