TempDB – Do This and Don’t Do That

Download PDF

Today I had the opportunity to present on TempDB to the Spokane SQL Server users group (PASS Chapter). The session was titled TempDB – Do This and Don’t Do That”, and it covers a bunch of tips and best practices around what to do and avoid relating to TempDB on your SQL Server.

Here is the download of the presentation and samples.

StedmanTempDbPresentation.zip

Some of the sample code from the session:

DECLARE @logInfoResults AS TABLE
(
[RecoveryUnitId] BIGINT, -- only on SQL Server 2012 and newer
[FileId] TINYINT,
[FileSize] BIGINT,
[StartOffset] BIGINT,
[FSeqNo] INTEGER,
[Status] TINYINT,
[Parity] TINYINT,
[CreateLSN] BIGINT
);

INSERT INTO @logInfoResults
EXEC sp_executesql N'DBCC LOGINFO WITH NO_INFOMSGS';
--SELECT AVG(FileSize) / 1024.0 / 1024.0 as AvgSizeMB, count(*) as VLFs FROM @logInfoResults ;
--SELECT FileSize / 1024 / 1024, [Status] FROM @logInfoResults ;
SELECT * FROM @logInfoResults ;

SELECT ISNULL(cast([Status] as nvarchar(10)), 'Total'),
COUNT(*)
FROM @logInfoResults
GROUP BY [Status] WITH ROLLUP;

I hope you enjoyed the session.

Posted in Uncategorized Tagged with: , , , , ,

Remastered Podcast Episodes

Download PDF

SQL Data Partners has been remastering some of the older podcast episodes, allowing for a better sound quality than what was originally done. These will be made available on YouTube as they are completed. Here is one of the more recent remastered podcasts.

An interview with Louis Davidson about database design. This one was recorded before I joined the show as the co-host, and was episode #8 originally aired on September 9th, 2015.

Related Links:

Posted in Podcast Tagged with: ,

Database Health Monitor – January 2017 Version Released

Download PDF

Today we released the Database Health Monitor January 2017 version. You can download it for free at http://DatabaseHealth.com/Download.

This update includes  some new branding with new logos, new icons, and a new splash screen, as well as the usual feature enhancements and bug fixes.

So far since we started tracking downloads there have been 11,100 downloads of Database Health Monitor worldwide.

As part of our goal of improving Database Health Monitor, and expanding it to meet the needs of more and more DBA’s, we have created a survey to solicit input on how people are using it, and what we can do better to improve the product.  The survey is located here: https://www.surveymonkey.com/r/TJLJDXH

Here is the list of changes in the latest release.

Read more ›

Posted in Database Health Tagged with: , , , , ,

Zero to SQL in 20 Lessons

Download PDF

My good friend and business partner Carlos L. Chacon has just completed an introduction to SQL book, that he has just published on Amazon.

He is offering the Kindle edition for free for 2 days, December 14th and December 15th, 2016.

I often get asked if I can recommend a good book for a beginner just learning to write SQL queries, and I haven’t had a really great answer for a long time. The Zero to SQL in 20 lessons is it for someone who hasn’t written SQL queries before and wants to get started.

Carlos is making the book available for FREE on Amazon today and tomorrow.  Only the kindle edition will be free.

Even if you have passed the basic stages, this book might be something you recommend to others.  I invite you to check it out.

If you find you like it, I invite you to leave a review on Amazon.  If you don’t like it, just give it 5 stars and them email Carlos what you don’t like about it.  :)

Posted in Uncategorized Tagged with: ,

When Database Corruption Strikes – Calgary SQL Users Group

Download PDF

Today I am presenting one of my favorite sessions “When Database Corruption Strikes” remotely for the PASS Calgary SQL Server Users Group.

corruptionstrikes

This is the same session that I presented at Pass Summit 2016, with a few minor additions, including a slide with information on corruption with Hekaton (In Memory OLTP).

 

This should be fun.

Here are the downloads

Posted in Corruption, PASS Chapter Tagged with: , ,

Linux commands for SQL DBA’s who don’t know Linux (yet)

Download PDF

With SQL Server now being available (pre-release) on Linux, I think we will see many SQL DBA’s who previously did not have Linux experience being forced into a new area. I am lucky in that I have had my share of Linux experience over my career, it has come easy to me. I figured I would share some Linux nuggets for those SQL DBAs diving into the Linux pool.

  • ls - List directory contents. Similar to dir on Windows.
  • top  - Sort of like the Windows task manager, shows you the top applications using cpu and memory.
  • sudo - runs a program or command with escalated user permissions.
  • apt-get - used to install a program. Kinda like the windows "add or remove programs" without the graphical interface.
  • ufwUncomplicated Firewall, is a front-end to iptables. Use this to allow or prevent port access to your Linux Server.
  • ps - processes.  Provides information on currently running process. For instance ps aux shows all running processes.
  • man - gets help on any of the Linux commands. For instance man ps provides the help page for the ps application.

 

That’s it for now, I will continue to grow this list as I have time.

Related Links:

Posted in SQL Linux Tagged with:

Allow Port 1433 Ubuntu Linux for SQL Server

Download PDF

If you have just installed SQL Server on Ubuntu Linux and you are trying to connect remotely you may have some difficulty connecting if port 1433 is not available.

Here is how you do it, using the UFW, or Uncomplicated Firewall on Ubuntu.

sudo ufw enable
sudo ufw allow 1433

While you are at it you may want to enable port 22 for SSH if that has not been allowed already. I also allowed 1434 for the dedicated admin console assuming that it is available on the Linux version of SQL Server v.next.

sql_on_linux_firewall

I hope this helps!  Enjoy.

Related Links:

Posted in SQL Linux Tagged with: , , , ,

SQL Server on Linux

Download PDF

This week Microsoft made the v.next version of SQL Server for Linux available in the public preview. It has been a couple of years since I have worked with Linux, but I am excited and going to give it a try.

SQL Server Linux

Also this week we released the SQL Data Partners weekly podcast, and this weeks episode was with Travis Wright. Travis is the program manager for the SQL Server transition to SQL Server on Linux.

Some of the topics covered in the podcast:

  • Why are they adding a Linux version of SQL Server.
  • What features are going to be supported.
  • The version of Linux supported.
  • What type of integrations are now possible – think WordPress on SQL Server.
  • How do I kick the tires on this?

podcastlogo

Personally I am looking forward to this. I just installed Ubuntu Linux, the next step is to install SQL Server on Linux. I will follow up with more details once I have it working on Linux.

Related Links

Posted in SQL Linux Tagged with:

Getting Started with SQL Server on Linux

Download PDF

With the recent public availability of the SQL Server Linux release, I figured I should give it a try, and it went well. Here is all that it took.

  • Download and install to a VM Ubuntu Linux Server 16.04.  (1 hour)
  • Allow port 22 through the firewall to be able to connect to the server with Putty.  (1 min)
  • Follow the SQL Server install steps from Microsoft.  (15 min)
  • Allow port 1433, and 1434 through the firewall to be connect to sql server remotely. (1 min)
  • Connect to the Ubuntu linux box from SSMS on a computer running Windows.

Victory!  I am now connected to a fresh brand new SQL Server running on Ubuntu Linux.

sql_on_linux1

 

Related Links:

Posted in SQL Linux Tagged with: , , ,

SQL Summit 2016 Session Feedback.

Download PDF

I was extremely excited to get my session feedback from my SQL PASS Summit 2016 session on Database Corruption today. I have been waiting, and was very please with the feedback.  Being the last time slot of the entire conference, I wasn’t quite sure what to expect.  Here is the overall evaluation.

speakerfeedback1

Then on to the actual feedback, which I would like to say thanks to everyone who commented. This will help me prepare for my next session.

  • All logistics were good but I suggest a larger room for this session next year (this one should definitely be repeated next year!).
  • Room was packed and as a result was a bit warm.
  • Really good session, nice to have a base of knowledge of what to do or not to do when corruption occurs.
  • Great presentation
  • Wish it was longer so much info that is essential
  • This should be a precon!
  • I came back specifically from lunch for this session… was actually by the space needle. I’m glad I did. Excellent session, well laid out. Examples were great.
  • This was a great session. Steve was very detailed and explained things well.
  • Great information
  • Dude…..
  • If you would do a whole day precon…. i would come in a heartbeat!
  • One of my favourite sessions at Summit 2016. Steve is a great speaker and very engaging. A little rushed towards the end, but it didn’t spoil what was a great session.
  • Wasnt sure i was going to go to a session in the last slot. Turned out to be the best session. Well put together good examples and moral of the story is check for corruption and have lots of backups!!
  • Great session!
  • Extremely informative. Great material. Hopefully I will never need to use it but I feel much more knowledgeable on the subject.
  • Very good presentation and the samples are all good.
  • Gime more time to complex recover corruptions
  • Great demo, lots of detail. Lots of good information.
  • Steve was a great speaker and a great teacher. The corruption challenges were outstandingly presented. I learned a lot. This was my favorite session at PASS.
  • Great session, thanks. Probably the best I attended all week! I can’t even imagine being able to recover from a problem like those you presented, tho’, especially being the only SQL Server DBA in-house. Maybe next time show more simplified examples…
  • Steve demonstrated ways to handle three different types of corruption, including one that was a fascinating dive into the world of DBCC PAGE. Despite being the last session of the week, it was very well attended, and there were many questions after the session.
  • This presentation exceeded my expectations. I’ve been to Paul Randal’s session on fixing corruption using a hex editor in past years and thought nothing could come close but this one did. Excellent!! Huge thank you to the presenter.
  • Excellent session. My only gripe is that for a session of this level (and for this topic), the speaker reviewed some very basic topics which caused him to run out of time. This is a shame, because the final corruption reproduction was the most involved.

Here is photo of the room and the presentation from my perspective about 10 minutes before we got started.

20161028_152745_pano

Given all this feedback, I think that I am going to grow, or expand the session into some different sessions:

  • Basics of corruption, what it is, detection, and tracking of corruption issues.
  • Basic techniques for repairing corruption.
  • Advanced database corruption repair and recovery.

We will see where it goes, but I certainly had a good time with the presentation.

If you have any other feedback to send my way, please do. Thanks to all that attended.

Posted in Summit 2016 Tagged with: , , ,