SQLChicken.com

SQL Server DBA Tips & Tricks

By

Business Objects on Linux and SQL Server

This is just a quick post to share a lesson learned while I was on an engagement where the client’s reporting environment was using SAP Business Objects (BO)running on Linux for reporting. We were doing a test to move the underlying data warehouse from another database platform to SQL Server 2008 R2.

As we changed connections over, however, we quickly ran into a roadblock. It seems when we tried to make a connection to SQL Server via BO we got the error of ‘Unable to bind to Configuration Objects WIS 10901′. What made this situation strange is that from a Windows box you could connect but from Linux itself, it wasn’t having any of it. After some digging around we found we needed a third party ODBC driver to make this connection work.

It was suggested to us by the folks at SAP that we use a third party driver for ODBC connectivity. We were pointed to drivers by DataDirect (NOTE: This is not an endorsement for said product, this is simply the solution we tried and went with. There are several third party vendors that offer Linux ODBC connectivity so please evaluate and choose what works for your environment). Have you run in to this issue before? How’d you handle it? Feel free to share your solutions in comments.

Share

By

Speaking at PASS Summit 2013!

I’m happy to officially announce that I’ll be presenting at this year’s PASS Summit in Charlotte, NC! I’ll be presenting my talk “What is a BI DBA?” as a Spotlight Session (90 minutes). This is the second time I’ll have presented at the Summit and I’m honored and beyond excited to have a Spotlight Session so we can cover more material!

This year the conference runs from October 15-18. I hope to see you at the Summit this year! http://www.sqlpass.org/summit/2013/

Share

By

Magnify SQL Text with SSMS 2012

This is just a quick tip to help with folks who present SQL code at events such as SQL Saturday. While most presenters use tools like ZoomIt (which if you present, please please learn to use this wonderful, free tool) sometimes it can get nauseating for attendees to watch you constantly zooming in and out, especially on code.

A quick way around this is by using the magnification feature in SQL Server Management Studio 2012. To do this simply hold down the Ctrl button on your keyboard and with your mouse scroll the mouse wheel up to increase the magnification and scroll down to decrease it.  Alternatively you can simply click on the magnification dropdown, which is located at the bottom left of the query window (by default) and select your desired level of magnification.

That’s it! Now you can quickly magnify your code to make it easier for your audience to see and you can reserve the zooming to highlight other areas as needed.

Share

By

Policy-Based Management and Local Password Policy

This post is based on an interesting question/situation that was posted over at ASKSSC.com today. The user asked how to create a policy condition that enforces local sql accounts to adhere to password expiration policies.

First off, to create the condition itself is relatively easy. Below I’ve provided the T-SQL code so that you can create the condition that way. I’ve also included a quick list on how to create it via SSMS GUI.

T-SQL method:

Declare @condition_id int
EXEC msdb.dbo.sp_syspolicy_add_condition
    @name=N'Password Policy Enforced', @description=N'', @facet=N'Login',
    @expression=N'<Operator>
  <TypeClass>Bool</TypeClass>
  <OpType>AND</OpType>
  <Count>2</Count>
  <Operator>
    <TypeClass>Bool</TypeClass>
    <OpType>EQ</OpType>
    <Count>2</Count>
    <Attribute>
      <TypeClass>Bool</TypeClass>
      <Name>PasswordExpirationEnabled</Name>
    </Attribute>
    <Function>
      <TypeClass>Bool</TypeClass>
      <FunctionType>True</FunctionType>
      <ReturnType>Bool</ReturnType>
      <Count>0</Count>
    </Function>
  </Operator>
  <Operator>
    <TypeClass>Bool</TypeClass>
    <OpType>EQ</OpType>
    <Count>2</Count>
    <Attribute>
      <TypeClass>Bool</TypeClass>
      <Name>PasswordPolicyEnforced</Name>
    </Attribute>
    <Function>
      <TypeClass>Bool</TypeClass>
      <FunctionType>True</FunctionType>
      <ReturnType>Bool</ReturnType>
      <Count>0</Count>
    </Function>
  </Operator>
</Operator>', @is_name_condition=0, @obj_name=N'',
@condition_id=@condition_id OUTPUT

Select @condition_id

GO

SSMS method:

  1. Under PBM node, right-click conditions folder and select New Condition
  2. Name your new condition something useful
  3. Select Login facet from drop-down menu
  4. Click on field box and select @PasswordExpirationEnabled from properties list
  5. Set the operator value to True
  6. Click on ‘Click here to add clause’ to add another clause to policy
  7. Click on field box and select @PasswordPolicyEnforced from properties list
  8. Set the operator value to True
  9. Click OK. You’ve now just created a new condition!

Now we’re left with another question: Where does this password policy come from? For details on that you can refer to the Books Online article about it (link). If your box is on a domain that has Active Directory policies regarding password expiration, when you select the box for ‘Enforce password policy’ as well as ‘Enforce password expiration’, these settings will come from that policy. Don’t have an Active Directory policy? No problem! If a policy isn’t provided from Active Directory, Windows then looks to its local security policies for these values.

image

To see the local values, click on your Start button, then type in ‘secpol.msc’ (don’t type type the single-quotes). This will open up the Local Security Policy MMC Snap-in. Expand the Account Policies folder and then click on the Password Policy folder. In the right side pane you will see the various password-related options you can set such as Maximum password age or password length.

image

While policy-based management can help you check whether or not the accounts have the option enabled to enforce the policy checks, Policy-based management itself has not bearing on the Local Security Policy settings. This is something you, as an administrator, will have to set and configure outside of SQL Server.

Share

By

SQL University: Parents Just Don’t Understand

Welcome to the second week of SSIS this semester at SQL University. Today we’re going to talk about the relationship between children and parents. Ever had communication issues with your kids when you ask them to complete a chore? When they’re done, wouldn’t it be nice if they always came back and let you know they took what you said, applied it, and completed the job? What does that have to do with SSIS? Read on and find out!
Read More

Share

By

Be the Master of your Data Warehouse Universe at SQLRally!

Do you have a data warehouse initiative in your current organization and looking for a way to learn how to properly build and support it? Would you like to learn how to do this straight from the Masters of the BIverse themselves? Well you’re in luck! Next month at SQLRally there’s going to be a great pre-conference session held by the following:

Mike Davis (Blog | Twitter)

Devin Knight (Blog | Twitter)

Adam Jorgensen (Blog | Twitter)

Patrick LeBlanc (Blog | Twitter)

In this full-day workshop, you’ll learn from the author team of Mike Davis, Adam Jorgensen, Devin Knight, and Patrick LeBlanc how to build a data warehouse for your company and support it with the Microsoft business intelligence platform. We’ll start with how to design and data model a data warehouse including the system preparation. Then, we’ll jump into loading a data warehouse with SSIS. After SSIS, you’re ready to roll the data up and provide the slice and dice reporting with SSAS. The team will walk through cube development and data enrichment with things like key performance indicators, which are essential for your future dashboards.  Lastly, we will cover how to report against the data warehouse with SSRS, including a primer in how to write MDX queries against the SSAS cube.

What you can expect to take away from this session:

  1. Practical knowledge of building a Dimensional Model
  2. Designing a simple ETL process using SSIS
  3. Designing a Cube
  4. Designing simple SSRS Reports
  5. Building an integrated process that fully leverages the entire MS BI stack to load a Data Warehouse.

You can register here and pre-con fee is $199 (which includes lunch). This is a great deal so what are you waiting for? Sign up today as slots are filling up fast! See you at SQLRally!

Share

By

Find Table Heaps Using Policy-Based Management

This is just a quick post in regards to a conversation I just had via Twitter. If you don’t already use Twitter, the SQL Community has setup a great resource on there using the hashtag of #sqlhelp.

Today a conversation came up due to a forum question over at SQLServerCentral regarding applying policies to databases with tables that have heaps. If you’re not familiar with the term, a heap is a table that has no clustered index on it. This can be problematic from a performance stand point so it might benefit you to find a way to identify these potential problem children. Enter Policy-Based Management.

This is a simple policy that you can run against your servers and it will identify your tables that are heaps. Just to clarify this policy identifies if your table has a clustered index on it. If it doesn’t then it will fail policy check. I’ve provided two ways to get the policy.

Download policy by clicking here

OR (Updated 4/15/11 to include creation script for condition)

--CREATE CONDITION
Declare @condition_id intEXEC msdb.dbo.sp_syspolicy_add_condition @name=N'Find heaps', @description=N'', @facet=N'Table', @expression=N'<Operator>  <TypeClass>Bool</TypeClass>  <OpType>EQ</OpType>  <Count>2</Count>  <Attribute>    <TypeClass>Bool</TypeClass>    <Name>HasClusteredIndex</Name>  </Attribute>  <Function>    <TypeClass>Bool</TypeClass>    <FunctionType>True</FunctionType>    <ReturnType>Bool</ReturnType>    <Count>0</Count>  </Function></Operator>', @is_name_condition=0, @obj_name=N'', @condition_id=@condition_id OUTPUTSelect @condition_id
GO

--CREATE POLICY
Declare @object_set_id int
EXEC msdb.dbo.sp_syspolicy_add_object_set @object_set_name=N'Find Table Heaps_ObjectSet', @facet=N'Table', @object_set_id=@object_set_id OUTPUT
Select @object_set_id

Declare @target_set_id int
EXEC msdb.dbo.sp_syspolicy_add_target_set @object_set_name=N'Find Table Heaps_ObjectSet', @type_skeleton=N'Server/Database/Table', @type=N'TABLE', @enabled=True, @target_set_id=@target_set_id OUTPUT
Select @target_set_id

EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database/Table', @level_name=N'Table', @condition_name=N'', @target_set_level_id=0
EXEC msdb.dbo.sp_syspolicy_add_target_set_level @target_set_id=@target_set_id, @type_skeleton=N'Server/Database', @level_name=N'Database', @condition_name=N'', @target_set_level_id=0

GO

Declare @policy_id int
EXEC msdb.dbo.sp_syspolicy_add_policy @name=N'Find Table Heaps', @condition_name=N'Find heaps', @policy_category=N'', @description=N'Heaps are tables without clustered indexes. Read the link below to learn more about heaps.', @help_text=N'Fragmentation (part 4):what are heaps? by Paul Randal', @help_link=N'http://blogs.msdn.com/b/sqlserverstorageengine/archive/2006/09/19/761437.aspx', @schedule_uid=N'00000000-0000-0000-0000-000000000000', @execution_mode=0, @is_enabled=False, @policy_id=@policy_id OUTPUT, @root_condition_name=N'', @object_set=N'Find Table Heaps_ObjectSet'
Select @policy_id

GO
Share

By

Meme Monday: 11 Words or Less

Looks like time for another meme, this time from Tom LaRock (Blog | Twitter). He challenged us to write a blog post in 11 words or less, so here’s my entry:

With a hammer, everything looks like a nail. Use tools appropriately.

If you’re reading this then I’m tagging you! If you don’t blog then add you 11 word post in comments below!

Share

By

SQL University Lecture Series: Women in Tech

This week SQL University is on Spring Break but we’ve lined up some activities to help keep students busy (you know what they say about idle hands and whatnot!). In continuation of Women’s History Month, and properly coming off of the heels of the 24 Hours of PASS event, we’re proud to have our next talks in our Lecture Series this Friday at 1pm EST featuring the ladies of WIT Week here at SQL University.

Our Live Lecture will be happening over at SQLLunch, and as always it’s free, so make sure you go register for the event. If you enjoyed reading all of the fantastic posts from WIT week you’ll love this event. The session is going to be a round table discussion about what WIT means to them as well as discussing some of the issues they’ve faced and would like to address in the field. Audience participation is encouraged via Q&A in LiveMeeting so come join the panel. See you at the SQLLunch!

Share

By

24 Hours of PASS: Day 1

Yesterday was the first day of PASS’ 24 Hours of PASS event. For those not familiar, 24 Hours of PASS is an event that brings together 24 different presenters and they present on various topics on SQL Server ranging from performance tuning, internals to business intelligence and previews at vNext of SQL Server. This month’s event is quite special since March is Women’s History Month, PASS is celebrating it by having this event all delivered by women!

So far the event has been absolutely awesome and the awesomeness continues today with the last 12 hours of the event, starting at 8am EST. If you missed yesterday, don’t fret, all of the sessions are being recorded and will be available on the PASS website within a month. Yesterday’s sessions went well, we had some sessions that actually had over 750 attendees (or as Tom LaRock refers to it as, the Jetliner line)! There were a few surprises as well, such as in Isabel de la Barra’s session, where we were treated to a presentation in Spanish (and translated by moderator Jesus Gil). At first we thought it was going to be a big issue but it turns out that over 300 attendees stuck around for the session and feedback from the Twitter stream seemed positive.

Speaking of Twitter, if you wish to follow along with the event you can do so by following the event hash tag of #24HOP. We are also using #sqlpass as well as #passwit to help promote and discuss the event. Day one is in the book and day two is looking to be fantastic as well, see you in the sessions!

Share

By

Oh Yes It’s Ladies Ni…errr…Month

Making WIT awesome since 1993

It’s March and this month sees a lot of celebration, amongst the parties are Mardi Gras and St. Patrick’s Day. This month we also celebrate women as it is Women’s History Month as well! If you’ve spent any time in the SQL Community you may have noticed that we have an especially strong support for Women in Technology and so this month there are some great things happening to help celebrate that fact.

I was going to do a rundown of all the cool WIT stuff going on this month but it looks like Wendy Pastrick (Blog | Twitter) beat me to the punch! Check out her post about all the events going on this month, including next week’s SQL University WIT week which will feature our second Live Lecture Series via SQLLunch.com. We’re having the ladies of SQLU WIT week hosting a WIT panel so make sure to join us for that!

Update: Also, for those on Twitter, check out my WIT list: http://twitter.com/#!/list/SQLChicken/women-in-technology

And since the title of this post probably got the song in your head, as a bonus, here’s the video: http://www.youtube.com/watch?v=J1oU9_hy3mA

Share

By

Pragmatic Transition: Lighthouses and Shipwrecks

Sometimes your mistakes are the greatest lessons...

This is the next post in my series about transitioning from a DBA to a BI consultant for Pragmatic Works. This post is a particularly sensitive one as it pertains to a lesson I had to learn the hard way. My hopes are that by writing and publishing this maybe you can spare yourself or someone else from making the same mistakes. This post is basically to teach one thing: Sometimes you’re a lighthouse, shining your light and showing people the way to safety. The lighthouse is steady and helps others through with a clear message and action. The other half is the shipwreck. Sometimes seeing the wrecks on the rocks gives others a warning about what NOT to do in a given situation. Throughout your life you will probably play both roles many times. For me, in this particular situation, I’m playing the role of shipwreck.

Before I begin let me quickly set the stage for my current position in life. For the last few years I’ve been a SQL Server DBA in shops where I was pretty much the only one. Due to this, along with very lenient bosses, I was allowed to leverage social networking on a daily basis. If you follow me on Twitter then you know I tend to tweet more than any human being should a lot. I’ve come to think of the network of fellow SQL professionals on Twitter as my extended DBA team. I would consume tons of knowledge via conversations, monitoring (and participating) in the #sqlhelp channel, reading blog posts and checking out all the various webcasts and events. This was before taking on the role of a consultant.

As a consultant you have to remember one thing: you’re no longer on YOUR time, you’re on your CLIENT’S time. When someone hires you the expectation is that you’re there to do a job and focus on that job. When you deviate from that, especially on a public platform like social networking sites, the perception is that you’re using up their time. And by using up their time, I mean wasting it. While I may be working hard on whatever client work I’m doing, yet tweeting throughout the day, the perception is that I’m not really working and my focus isn’t where it should be. Even if I scheduled every single tweet throughout the day the perception is still the same, and this is the key: perception is reality. That being the case, the “reality” I was broadcasting by tweeting all the time (as a consultant) is that I was not busy, not focused and to some extent not caring about my client. While none of these are true the fact is I should’ve been more cognizant of the perception I put out to the public, and for that I apologize to the community as a whole.

So now what do we do? Well, we move forward and learn! I now understand a little better what’s expected of me in my new role. The beauty of mistakes is it gives us a chance to learn from them. The important part of mistakes is that you DO learn from them and most importantly: MOVE ON! Mistakes happen. Not only do they happen, they happen to everyone. What matters is how you deal with it and move forward. A really great example of a shipwreck-turned-lighthouse would be a recent situation with Brent Ozar (Blog | Twitter) and his business partnership at SQLSkills. You can read the saga here, here and here. Brent’s public dealing with his situation also helped inspire this post. He took what could have percieved as a terrible situation and turned around and made it a fantastic learning opportunity for anyone looking to pursue a similar partnership in the future. He turned a shipwreck into a lighthouse!

Just remember if you make a mistake that it’s okay. Stuff happens. It’s how we deal with those mistakes that matters in the end. How about you? Have you had a shipwreck/lighthouse moment? Share your stories in the comments!

Share

By

BIxPress 3.0: DBAs Welcome!

Much like the USA Network here in the States welcomes characters, I’d like to formally let the world know that BIxPress also welcomes folks, and this time it’s looking at you DBAs out there!

You may be thinking, “But Jorge, the product is called BIxpress, why as a DBA would I give a flip about it?!?” Glad you asked! I’ve recently made the transition from a DBA to a BI consultant and as part of my learning process for learning the BI stack I decided to take a crack at creating an SSIS package that would take a bunch of video files from a conference, compare the file names to the actual session titles (files came down named with their session codes, not names) and rename the files according to their formal session titles. If you’re interested in that, I’ll be posting another blog post soon detailing how I did it as well as you’ll be able to download the package yourself and try it out!

Read More

Share