DBPedias

Your Database Knowledge Community

Tim Edwards

  1. OneNote 2010 Sort Utility

    These days, I live and die by OneNote.  I read a ton of technical blogs and come across a number of great scripts and when I do, I save them to OneNote.  I take notes from meetings in OneNote and I even save videos and webcasts that I feel are especially pertinent to what I do in OneNote.  I have a ton of notebooks in OneNote each with a bunch of sections and pages (in fact, my OneNote notebooks are about 15GB in size!).  But the problem I have always had was that unless I wanted to search through my OneNote notebooks (which, I have to say, Microsoft certainly has included a very capable search functionality in this product), it was hard to find specific things because there didn’t seem to be a way to sort your OneNote sections and pages; basically, they just showed up in the order you created them unless you wanted to manually sort them (but who has the time for that!).

    This was a problem until I came across this little lifesaver tool that makes keeping my OneNote notebooks tidy and in order.  It is a little program called the “OneNote 2010 Sort Utility.”  You can read more about this little golden nugget here.

    If you decide that this little free utility might make your life easier, you can download it here.

    And by the way, if you are using Microsoft Office 2010 Professional and you haven’t tried OneNote 2010 to organize your life (or at least your personal life). I strongly recommend giving it a spin. At first, it may seem a little daunting, just like writing your first SSIS package, being stared at by that blank screen. But, rest assured, there is help out there and a fairly active community of users. Once you understand it’s metaphor to a physical binder (if you are my age, you might even insert “Trapper Keeper” hereJ), with notebooks for different subjects and then sections within each notebook and then pages within the sections and the fact that you can actually print documents to OneNote 2010 as well as attach any kind of file, it becomes one of those tools that is hard to live without. In fact, it integrates so well with Outlook that if you have OneNote installed, your Outlook meetings will have a OneNote button on them and clicking that creates a page that contains all of the information from the Outlook invitation and then lets you take meeting notes. I could go on and on and, in fact, have because I intended this blog post to really only be about this OneNote 2010 Sort Utility, but OneNote is, unfortunately, one of those things that I am quite passionate about because it has saved my bacon a number of times. At any rate, if you don’t use OneNote or want to know how to use OneNote, here are some links to get you started (some of these might apply to OneNote 2007, which some of you may still be on, but the concepts generally also apply to OneNote 2010):

    http://blogs.msdn.com/b/chris_pratley/archive/2009/03/10/i-heart-onenote.aspx

    http://blogs.office.com/b/microsoft-onenote/

    http://office.microsoft.com/en-us/onenote-help/getting-started-with-onenote-2010-HA010370233.aspx

    http://office.microsoft.com/en-us/onenote-help/basic-tasks-in-onenote-2010-HA101829998.aspx

    http://www.onenotepowertoys.com/

     


     

  2. Events in July – Edwards’ Style

    July is definitely a painful time to be in Tucson.  It’s hotter than all get out and monsoon season has usually started, so for awhile we have heat AND humidty.  Oh joy.  Fortunately we have some SQL

    At least this calendar has green on it...

    At least this calendar has green on it...

    Server based events coming up to take our mind off of the disagreeable weather.

     

    Tim’s heading up the new incarnation of the PASS Performance VC.  On July 6, Jason Strate (Twitter/Blog)  is going to be presenting a webcast for them entitled: ‘Performance Impacts Related to Different Function Types’.  It should be a great session.

     

    On July 17, Phoenix is having it’s first SQLSaturday.  That in and of itself is pretty exciting, but Tim and I are going to be presenting two sessions there.  This is our first time presenting, so it’ll be a great learning opportunity for us and a potential opportunity for up and coming hecklers.   If you’re somewhere around Phoenix, you should take advantage of the opportunity.  If you’re not around Phoenix, but want to see what it would feel like to step into an oven, come on out.

     

    Then on July 21st, Quest is holding another Virtual Training Event on Performance Monitor and Wait Events.  Brent Ozar (Twitter/Blog), Kevin Kline (Twitter/Blog), Buck Woody (Twitter/Blog) and Ari Weil (Twitter) will be presenting.   It should make for an interesting and potentially hilarious training event.  Aside from it being a great training event, it’s relevant here because they’ll be presenting live from beautiful Tucson.  Hopefully we’ll be able to meet them for dinner and take them to another top-notch Old Pueblo eatery.

     

    One final note – the final session lineup for the PASS Summit 2010 will be finalized in July.    This is due to a huge amount of great work by the volunteers from the Program Committee.  If it’s June and you’re reading this, send some good thoughts their way – they’re busy.

  3. Locking pages in memory – Standard Edition

    The ability to lock pages in memory is used on 64-bit systems to help prevent the operating system from paging out SQL Server’s working set.  This may be enabled when the DBA starts seeing errors like the following:

     

    "A significant part of sql server process memory has been paged out. This may result in a performance degradation."

     

    If you’re running SQL Server 2005/2008 Enterprise, you would take the steps to lock pages in memory and you’re done with it.   If you’re on SQL Server 2005/2008 Standard Edition, you still have a ways to go.  The ability to lock pages in memory for standard

    This flag will not help in this situation

    This flag will not help in this situation

    edition is handled through  a trace flag.  For SQL Server 2005 SP3, you need to apply CU4 .  For SQL Server 2008 SP1, you need to apply CU2.    Once those CUs have been applied, set trace flag 845 as a startup parameter.  Here’s a good ServerFault question that explains how to set a trace flag as a startup parameter.

     

    Once the trace flag was enabled, the memory issues were solved.   Day saved, once again. :)  

     

    As with anything, this has the potential to degrade system performance.   In this article, scroll to the section entitled “Important considerations before you assign “Lock Pages in memory” user right for an instance of a 64-bit edition of SQL Server”.  Read it thoroughly prior to making any changes to your production systems.

  4. Queries are from Mars, Men are from Venus

    I always thought that Mars was a planet, but apparently it also has to do with multiple pending requests within a single SQL Server connection.  MARS (Multiple Active Result Sets) was introduced in SQL Server 2005 and provided the ability to handle these multiple requests.  Like

    Apparently this isn't the only Mars out there

    Apparently this isn't the only Mars out there

    anything else, though, it has to be used correctly.

     

    About a week ago, I started seeing the following error on one of my servers:

     

    DESCRIPTION:  The server will drop the connection, because the client driver has sent multiple requests while the session is in single-user mode. This error occurs when a client sends a request to reset the connection while there are batches still running in the session, or when the client sends a request while the session is resetting a connection. Please contact the client driver vendor.

     

    After digging around and talking to some of the developers in house, I found that they were making use of MARS, but not always correctly.  To avoid the error above,  ”MultipleActiveResultSets=True” needs to be added to the connection string.  Adding that seems to have fixed the issues.

  5. SQL Server 2008 Installation Failure, Or You Are A Stupid MOF!

    I ran across an installation issue with SQL Server 2008 on a Windows Server 2008 server the other day that baffled me a little bit.  I was installing an additional instance of SQL Server 2008 on a server that already had a SQL Server 2008 instance and right before the installation completed, it died with the error:  “A MOF Syntax error occurred.”  Further investigation into the Setup Bootstrap logs gave this detail:

    An error occurred while processing item 1 defined on lines 14 – 16 in file D:\Program Files\Microsoft SQL Server\MSSQL10.TMS_MODELING\MSSQL\Binn\etwcls.mof.transformed:

     

    2010-05-18 13:41:02 Slp: Compiler returned error 0×800700a4Error Number: 0×800700a4, Facility: Win32

     

    2010-05-18 13:41:02 Slp: Description: No more threads can be created in the system.

     

    2010-05-18 13:41:02 Slp:

     

    2010-05-18 13:41:02 Slp: Sco: Compile operation for mof file D:\Program Files\Microsoft SQL Server\MSSQL10.TMS_MODELING\MSSQL\Binn\etwcls.mof.transformed failed. Exit code 3

     

    2010-05-18 13:41:02 Slp: Configuration action failed for feature SQL_Engine_Core_Inst during timing ConfigNonRC and scenario ConfigNonRC.

     

    Much investigation on the internet turned up a lot of people that have been having this issue, but very few answers.  After many installs and uninstalls, I finally tried the following, which seemed to work:

     

    • I ran the setup.exe as an administrator (right click on setup.exe and click “Run as administrator) even though I am a local administrator on the box.
    • I installed SQL Server using the Network Service account instead of the normal domain service account.
    • The installation succeeded and I just went into Configuration Manager and changed the service account to the domain account after the installation.
  6. You Got Your Query on My Server! You Got Your Temp Table on My Server!

    Unlike the similar Reese’s dilemmas, these results were far less favorable…

    Reese's are yummy

    Reese's are yummy

     

    As many of these issues begin, a developer put together a procedure.  When he ran it locally, it ran in a matter of seconds.  For some reason, though, he wanted the procedure run from a remote server.  When he attempted to run that same procedure from the remote server, it took a number of minutes.    It was apparent that it wasn’t the result set being returned, as there were OLEDB waits while the query was processing.

     

    In looking at the query, it wasn’t anything spectacular.  It dumped some data into a temp table and then joined that table to an existing table and displayed the result.    The problem ended up being the temp tables.  While the query was being executed against the remote server, the temp tables were being created on the server the query was running on.  So, pulling the data into the temp table and joining the two tables all had to occur with data being pulled across the network.

     

    The fix was pretty simple – change the procedure to create a table on the remote server and drop it once the procedure was finished.  The procedure ran in the expected time period.

  7. PASS Volunteer Awesomeness

    The SQL Server community never ceases to amaze me.  The number of people that are willing to take time out from their jobs and families to volunteer is especially impressive.

     

    I’ve had the good  fortune to be able to volunteer for the Program Committe this year.  My job is to pull together special projects and whatever other slave work Allen thinks up for me.   I’ve had a number of volunteers that have put great work into our current project.  This project has multiple steps and has required a ton of coordination between the volunteers – but it is all coming together.   It’s something that’s been needed for awhile  and now it’s going to be a reality.   I’d name names, but I know that I’d forget someone.   So thank you to everyone that’s helped out.

     

    A big (virtual) cake for all of you!

    A big (virtual) cake for all of you!

    It’s not just me, though.  Tim’s in the process of re-starting the Performance VC.  He had mentioned the need for volunteers through our blog, Twitter and Blythe Morrow(Blog/Twitter) put out a call for volunteers on the PASS blog.  He’s been overwhelmed at the number of people that have asked to help out.

     

    For all of you that volunteer for PASS – kudos to you!  For those of you that are thinking of volunteering, but haven’t yet,  get ahold of Tim or me or go here for additional volunteer opportunities.

  8. Generate Scripts Gotcha in SQL Server 2008

    The Generate Scripts task in SSMS is insanely handy.  A few quick clicks and you can have tables, stored procedures, users, etc. scripted out.  I’ve used it quite a bit, but I ran into an unusual situation yesterday.

     

    I needed to create a database schema and thought I’d use the handy dandy Generate Scripts task.  Popped through the wizard, clicked finish and it errored!  Here was the error message:

     

    I was thoroughly confused – I was running SSMS 2008 against a SQL Server 2008 server.  I wasn’t sure where SQL Server 2005 even came into play.

     scripts_error

     

    I went through the process again, this time paying closer attention and noticed this:

    script_option

    Apparently the Script Wizard defaults to SQL Server 2005.  I changed it to SQL Server 2008 and everything ran as expected.  While I had run this task against other SQL Server 2008 instances, apparently none of them made use of the new data types in 2008 and, as a result, didn’t generate errors.  Now why it would default to SQL Server 2008 is an entirely different question….

     

    baby_facepalm

  9. Dynamic SQL and why it’s so enjoyable

    Okay, maybe I’m being a little sarcastic.  I don’t troubleshoot dynamic SQL very often, so I don’t always see potential issues right away.  For those dear readers who work with it regularly, you should stop reading now – this is all pretty basic – but it took a few minutes out of my day.

     

    This is the only dyna- that I like

    This is the only dyna- that I like

    My troubleshooting methods consist of displaying the command created by the dynamic SQL and seeing if it runs correctly or if I’m missing a quotation mark or something along the way.  There is probably a better way to troubleshoot, but again, I play with it so rarely that I’m stuck in a rut.

     

    Evaluating Dynamic SQL commands

    Late last week, a developer sent the following block of dynamic SQL code because he was having issues getting it to work:

    EXEC
    ('
    USE [master];
    BEGIN
    ALTER DATABASE [random_dbname] SET ONLINE;
    WAITFOR DELAY ''00:01'';
    END
    USE [random_dbname];
    '
    )

     

    I followed my normal troubleshooting methods and everything worked fine.  Trying to execute it as above, I received the following error message:

     

    Msg 942, Level 14, State 4, Line 7
     Database 'random_dbname' cannot be opened because it is offline.

     

    On first glance, I was confused, because it was obvious that I brought the database online.  I soon realized, though, that everything within the parentheses was being evaluated prior to being executed.  Apparently SQL Server  has a shorter memory than I do.

     

    Breaking it into two separate statements like below accomplishes what needed to happen

    EXEC

    (

    – Bring the database online

    USE [master];

    BEGIN

    ALTER DATABASE [random_db] SET ONLINE;

    WAITFOR DELAY ”00:01”;

    END


    )

    go

    EXEC

    (‘ USE [random_db];

    /*blah blah blah*/


    )

    Thinking that this ‘emergency’ had been handled, I went back to my other tasks. 

     

    Database Context and Dynamic SQL

    As these thing happen, though, received another call because after he ran all of this, the database context remained Master.  Fortunately, this was easy to explain.  The database context switching exists only during the execution of the EXEC statement and does not persist after its completion. 

     

    None of this is rocket science or even deep SQL knowledge, but maybe it’ll save a minute or two for some other DBA out there.

  10. PASS Performance Virtual Chapter

    The Professional Association for SQL Server is restarting a Virtual Chapter focusing on SQL Server performance.  The goal of the PASS Virtual Chapters is to provide free and timely training focused on a particular SQL Server area or set of functionality (in this case SQL Server performance).  I have been honored to have been chosen to lead this particular Virtual Chapter, but, as you can imagine, this can’t happen without volunteers from the community.  We are looking for individuals to serve on the Performance Virtual Chapter steering committee that are:

     

    • Passionate about SQL Server (and who isn’t right? ;)
    • Interested in helping and serving the SQL Server community
    • Either have a blog or a Twitter presence
    • Willing to put in a couple of hours of work a week on such things as arranging speakers, putting together presentations, etc.  Generally, working to help get good education out to our SQL Server community on performance related topics.

    If this sounds like you and you are interested in serving on the Performance Virtual Chapter steering committee, we want you!  Please contact Tim Edwards at sqlservertimes2@gmail.com.

  1. 1
  2. Next ›
  3. Last »