桃子视频

Categories
Policy Based Management Syndication Tips

Policy Based Management: Against All Databases Condition

Recently after one of my presentations a Twitter-buddy of mine, Argenis Fernandez ( | ), showed me something interesting. By default when you create a new policy the against targets default says 鈥楨very Database鈥 (see screenshot below).

all-databases1

Well this is a tad misleading as it apparently means 鈥渆very鈥 in the sense that it will apply this policy against every USER database. This means if you want to ensure autoshrink is not enabled on your system database (master, msdb, model, tempdb), for example, applying this policy with this default target setting won鈥檛 work. So how do we create a new condition/target that allows us to run a policy against both user AND system databases? We鈥檙e going to create a new custom condition that allows us to look at both types of targets.

First click on the down arrow next to Every and go down to the bottom of the list and select 鈥楴ew condition鈥︹

First you want to give this condition a new name. For this demo we鈥檒l call it 鈥楨very database – User and System鈥. The next step is choosing the Facet as well as the property we want to look at. For this particular condition we want to use the 鈥楧atabase鈥 facet (which is the default facet selected). Next click on the box under Field and click the down arrow to view all of the properties available under that facet.

The field we want to select for this is the @IsSystemObject property. Once you select it, make sure your Operator value is set to 鈥=鈥, then click on the field under Value. Once again, when you click on the field and click on the arrow you are given pre-set options. For this value select 鈥楾rue鈥.

Now that you鈥檝e selected your first clause that states to apply to system object, we will create a second clause that applies to user objects as well. To start click on the next line where it says 鈥楥lick here to add a clause鈥. When you click on it you鈥檒l notice you get a new row to be able to create a new expression. For the first column (AndOr) we want to select 鈥極R鈥. This is important because if you select AND in this instance, you鈥檒l never return a valid entry since an object is either a system object OR a user object, never both. Next select the @IsSystemObject again from Field value and finally set the value to FALSE. Your Expression should now look like this:

Click OK and you should now see your new 鈥楨very database 鈥 User and System鈥 in the Against Targets box. Click OK to close your policy. To test it apply your policy against your database via your Central Management Server (CMS). To do that drill down to your server, right-click the database click 鈥楨valuate Policies鈥︹

From the Evaluate Policies box click on the ellipses box to select your Source. Your source is where your policies are located. With PBM you can either select individual policies (XML file) or you can select a SQL 2008 Server that has the policy you want. In my case I am selecting a server that contains the policies so all of the policies on that server will appear in my list. Select the policy we modified with the new target.

To verify we鈥檙e using the right target click on the policy name (in this case 鈥楧atabase Auto Shrink鈥). This will open the policy itself and you can verify that the correct target is in place. You should see your 鈥楨very database 鈥 User and System鈥 in the Targets window. Click Close to close the policy. With your policy checked click on the Evaluate button to proceed. The policy will then run and show you your results. In the target details box you should see your policy has run against all your databases, both user and system.

There is also a way to create this through a script. I created this particular via the SSMS gui but if you want to export it you can let SSMS create the T-SQL Script for you and share the code. To do this right-click on the condition in SSMS, Script Condition as, CREATE TO. To have it go directly to creating the .SQL script file for you select 鈥楩ile鈥︹ otherwise lets select the 鈥楴ew Query Editor Window鈥 so we can see our result.

For this particular policy you should see something similar to this be output to SSMS:

Declare @condition_id int
EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'System and User', @description=N'Allows you to select both user databases as well as all system databases.', @facet=N'Database', @expression=N'<Operator>
  <TypeClass>Bool</TypeClass>
  <OpType>OR</OpType>
  <Count>2</Count>
  <Operator>
    <TypeClass>Bool</TypeClass>
    <OpType>EQ</OpType>
    <Count>2</Count>
    <Attribute>
      <TypeClass>Bool</TypeClass>
      <Name>IsSystemObject</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>IsSystemObject</Name>
    </Attribute>
    <Function>
      <TypeClass>Bool</TypeClass>
      <FunctionType>False</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

And that鈥檚 it! You now have your T-SQL Code to create your new condition on other SQL 2008 Servers. Note of caution, however, be careful about how you use this as messing with system databases can be disasterous if you’re not careful.

Categories
PASS Virtualization Syndication Syndication Windows

Remote Server Administration Tools for Windows 7 (RTM)

Earlier I had blogged about the toolkit being available for Windows 7 RC but now Microsoft has officially released the RTM version of the tools. Big thanks to my co-worker Nick Piccone ( ) for bringing this to my attention. The new tools are available at the Microsoft site at the link below:

Overview

Remote Server Administration Tools for Windows 7 enables IT administrators to manage roles and features that are installed on remote computers that are running Windows Server 2008 R2 (and, for some roles and features, Windows Server 2008 or Windows Server 2003) from a remote computer that is running Windows 7. It includes support for remote management of computers that are running either the Server Core or full installation options of Windows Server 2008 R2, and for some roles and features, Windows Server 2008. Some roles and features on Windows Server 2003 can be managed remotely by using Remote Server Administration Tools for Windows 7, although the Server Core installation option is not available with the Windows Server 2003 operating system.

This feature is comparable in functionality to the Windows Server 2003 Administrative Tools Pack and Remote Server Administration Tools for Windows Vista with Service Pack 1 (SP1).

Categories
SQL Quiz Syndication

Database Mirroring Freak Show 鈥 SQL Quiz from Chris Shaw

Chris Shaw ( | ) started another . He tagged , Brent tagged and Tom tagged me. This particular quiz is a two-part question and here are my responses. Excuse my lack of wit and charm. It鈥檚 late, my caffeine supply is running low and my cat is eyeballing me in a most peculiar fashion.

Do you feel that you have a reliable SAN solution? If so, what鈥檚 the secret?

It鈥檚 hard for me to answer this one given that just a few weeks ago our data center (SAN included) came crashing down hard. Now given that the problem was a faulty generator test and not the SAN itself that was the problem I can鈥檛 really place blame there. Honestly I can鈥檛 say anything really bad about our SAN. Tons of disk space, tons of cache, it does what its supposed to do. We鈥檙e also in the middle of finding a replacement for a SAN administrator so what SAN solutions we have in place now could radically change in the coming months. As far as secrets go I鈥檇 say you just need to make sure you have an open line of communication with your SAN administrator. They have no idea what鈥檚 going on in your world and you have no idea what鈥檚 going in theirs. Clear communication of needs need to be there as a SAN admin worth his salt is going to know what they need to do on their end to make sure you get the best performance on your end (i.e. proper RAID levels for your LUNs depending on needs, I/O throughput, etc.).

Explain Database Mirroring in layman鈥檚 terms

Everyone else seems to be giving off-the-wall answers to this so I鈥檒l give it a go as well. Not going to lie, took me a good portion of my drive to Melbourne last week to finally come up with an example.

Think of clustering as a conjoined twin. You鈥檙e talking to the same body. Both heads can hear the conversation but ultimately the two are stuck together because they have to share the same base trunk. Now if you were to punch one twin in the face and knock him out you鈥檇 still be able to talk to the other head but you鈥檙e still lugging around that base. Now, imagine a set of regular twins (non-conjoined). This is your database mirroring in that you have two separate entities. You knock one out but the other is still chugging along just fine. Only difference being that the location of the second one doesn鈥檛 really matter because he doesn鈥檛 have a shared trunk to deal with. I鈥檓 sorry if that explanation sucks, if you鈥檙e bored written by someone who doesn鈥檛 have a fascination for using genetic defects to compare feature sets. Ok time for me to tag a couple of unwilling victims fellow bloggers:

Categories
Events PASS Review Syndication

SQL Saturday #16 – Recap

Last Saturday was the event at in Miramar, Florida. First off I have to say it was a great event with over 400 attendees! It was also my very first SQL Saturday speaking event. The speaker evaluations haven鈥檛 come back yet but I have a feeling I鈥檒l definitely should have some dings as my presentation started off well but towards the end the presentation Gods reared their ugly heads and it ended on a not-so-great note with my demo not going so well. The good news is that one attendee, Argenis Fernandez ( ), gave me some good feedback as well as told me that he got some good ideas from the presentation and was excited to go back to work and implement Policy Based Management in his environment. Honestly that kind of response makes the effort all worthwhile.

From my session I went to check out Kendal Van Dyke鈥檚 ( | ) session on . Kendal and I interact pretty frequently on Twitter so I was glad to get a chance to finally meet him as well attend his sessions. This was a good intro level talk on how to configure web application authentication methods in both classic ASP and ASP.NET. Some nice tricks come out of this session including how to properly add a user to the IIS_WPG group (hint: the proper way ISN鈥橳 to just add them to the group in computer management!). I鈥檓 no developer but this was really useful to me, especially as a DBA tasked with implementing Sharepoint in to our environment. I say this because Sharepoint has its share of permission issues especially if you run the app pools or web apps under a different account such as a custom AD account.

My next session was Andy Warren鈥檚 ( | | ) session on . I鈥檝e attended other sessions with Andy and they鈥檝e all been great. This one was no exception. Andy is an excellent presenter and makes it look so easy. One thing that was great about this, for me, is that this is the first weekend was the first time I鈥檝e gotten a chance to really meet and talk to Andy. It was funny because at the speaker dinner he asked 鈥淗ey, aren鈥檛 you that SQLChicken guy?鈥 which made me laugh. I guess my self-branding is working! Anyhow, this session was really interesting as it was more of an open discussion with the group rather than a straight forward presentation. Andy brings up important things to think about in terms of networking such as don鈥檛 start building your network only when you need something (aka job search). Networking is something that can benefit you far beyond simple job searches and opportunities. In the session some of us shared how simply being connected on social networks like Twitter have actually helped improve ourselves in our current jobs. If you ever get a chance to attend this session I highly recommend you do. In fact, if you鈥檙e attending the in Seattle in November, Don Gabor will be holding a Pre-Conference session called . Andy highly recommends anyone attending the summit to check this session out as it will help you not only build your network professionally but help you network in general at events like and .

At lunch I got to sit down and have lunch with Andy Warren, Kendal Van Dyke and a few other attendees. I only mention this in the blog because I we got a chance to talk with some people who ranged from first-timers to the SQL world as well as others who鈥檝e been doing it for awhile. Also it was interesting to get feedback on little things like how sometimes the session descriptions were a little too vague so it made it difficult to decide if the topic or level was the right one to attend. Based on this I know I鈥檒l be tweaking my abstracts for future events. The other cool thing was getting a chance to sit and pick Andy鈥檚 brain a bit about the direction of PASS. Personally I鈥檓 excited to see what PASS has in store to continue bringing the community together. So far its been fantastic to be a part of it.

Next up was another session with Kendal with topic being .聽 Honestly I鈥檓 currently not using transaction replication in my shop but after attending this session I feel like I gleaned enough knowledge to be able to tackle that task if it were asked of me. Great overview of different topologies that were clearly and easily explained, as well as going over some possible pitfalls you might encounter. Very interesting topic and presented very well. Kendal will actually be doing this presentation this year at (first time presenter, congrats to him!) so again if you鈥檒l be at PASS Summit this year I suggest you .

After that I went over to Jeffrey Garbus鈥 ( ) session on which drew quite the crowd. Packed house with a bunch of people (myself included) taking a seat on the floor along the walls to check this topic out! I鈥檝e attended Jeffrey鈥檚 session before at the last SQL Saturday in Tampa and he is a great speaker. This particular talk was actually kind of a part 2 to his earlier talk on . Even if you didn鈥檛 catch the first session this one alone is a treasure trove of great information. For instance do you know why join orders matters? Do you know the difference in performance between doing a join using the old ANSI syntax and the new? You鈥檇 be surprised. Again I highly recommend you check out any session by Jeffrey if given the opportunity.

Last, but most definitely not least, was Chad Miller鈥檚 ( | ) session on . Chad not only covers basic Powershell commands and tricks but he covers using a cool project he鈥檚 developed called . What PSX gives DBAs is a base set of functions that covers most common DBA tasks. One of the coolest demonstrations I saw during this presentation was the use of Powershell as an ETL tool. Chad shows you how you are able to copy data from table to another using only 3 lines of code! This presentation truly made me excited to really start learning Powershell and applying it at work.

Overall I thought it was a great event, as any SQL Saturday I鈥檝e attended, and I had an absolute blast presenting and meeting a bunch of folks I鈥檝e interacted with on Twitter. If you get a chance to make it to a SQL Saturday event I couldn鈥檛 recommend聽 it enough. You get top-notch education, great networking opportunities, awesome swag and all for free! If you don鈥檛 have a SQL Saturday event in a city near you, and you won鈥檛 be making it to the PASS Summit this year then don鈥檛 fret! The good folks at PASS have put together an exciting free training event called . For more details on this great event check my previous post on it.

Categories
Events Policy Based Management Presentation Review Syndication

Spacecoast SQL User Group Meeting: Review

After writing up my review for my presentation at OPASS I realized I hadn’t done one for my visit to Melbourne for the ! A thousand apologies Bonnie and crew!

I arrived early in Melbourne so I spent some quality time at Starbucks for a bit before the meeting which gave me the opportunity to test and retest some of the policy demos so I didn’t repeat my blunders from the previous weekend at SQL Saturday in South Florida. When the time came around I got over to the Spacecoast Federal Credit Union headquarters building where the meeting was held (which is a beautiful building btw). The group is small but very enthusiastic crowd in that they ask a LOT of good questions. The PBM presentation went without a hitch which was nice and the presentation actually took a positive unexpected turn when we started discussing virtualization. I wound up giving a mini presentation on and virtualization and how it all worked which was pretty cool.

Afterwards a few of us went over to the questionably-named sports bar called The Rendezvous in the Holiday Inn聽to socialize and talk shop a bit. It was interesting to hear about how Bonnie got started in the SQL world and how she came about establishing the User Group. Want to hear the story yourself? Then get over to one of their meetings! They meet on the second Thursday of each month so if you’re in the Melbourne/Cocoa Beach/Titusville area go check them out!

Categories
PASS Presentation Syndication

Spacecoast SQL Server User Group Meeting Tonight!

I just wanted to send out a quick note to say that I’ll be presenting tonight at the . I’ll be doing my presentation on Policy Based Management. After last weekend I’ve learned a few things and added a small demo of to the end of it so hopefully this goes well. If you’re in the tonight come check it out!

Categories
Events PASS Syndicated Syndication

24 Hours of SQL PASS

Call Chloe and the rest of the CTU gang, grab a giant pot of coffee and your 9mm and get ready for 24 hours of pure, free SQL hotness: ! The good folks at PASS have put together another fabulous free training opportunity for us in 24 hours of webcasts from the world’s leading SQL Server experts!

Using the latest in advanced hacking technology I’ve managed to access the PASS mainframe and get . Uploading to your screen now…

Session 01 (Dev) 鈥 Start time: 00:00 GMT
10 Big Ideas in Database Design
Presenters: Louis Davidson and Paul Nielsen

Session 02 (DBA) – Start time: 01:00 GMT
Using Powershell to Get the Most Out of SQL Server
Presenter: Allen White

Session 03 (PD) – Start time: 02:00 GMT
Team Management Fundamentals
Presenter: Kevin Kline

Session 04 (BI) 鈥 Start time 03:00 GMT
Delivering Good Performance Consistently with SSIS
Presenter: John Welch

Session 05 (DBA) 鈥 Start time 04:00 GMT
Using SQLdiag to Troubleshoot SQL Server Problems
Presenter: Brad McGehee

Session 06 (DBA) – Start time 05:00 GMT
The SQL Server 2008 Vanishing Act
Presenter: Peter Ward

Session 07 (BI) 鈥 Start time 06:00 GMT
Text Mining
Presenter: Dejan Sarka

Session 08 (Dev) 鈥 Start time 07:00 GMT
Tips and Tricks for Writing SET Based Queries
Presenter: Jacob Sebastian

Session 09 (DBA) 鈥 Start time 08:00 GMT
Mirrored Databases
Presenter: Thomas Grohser

Session 10 (Dev) 鈥 Start time 09:00 GMT
Working with Spatial Data in SQL Server 2008
Presenter: Greg Low

Session 11 (DBA) 鈥 Start time 10:00 GMT
Effective Indexing
Presenter: Gail Shaw

Session 12 (BI) 鈥 Start time 11:00 GMT
Reporting Services inside out the things you should know
Presenter: Simon Sabin

Session 13 (DBA) 鈥 Start time 12:00 GMT
Query Performance Tuning 101
Presenter: Grant Fritchey

Session 14 (BI) 鈥 Start time 13:00 GMT
Reporting from Analysis Services Cubes Using Excel 2007
Presenter: Peter Myers

Session 15 (BI) 鈥 Start time 14:00 GMT
Data Warehousing: Laying the Foundation to Success
Presenter: Erik Veerman

Session 16 (DBA) 鈥 Start time 15:00 GMT
Database Compatibility Settings: What They Really Do… and Don鈥檛 Do
Presenter: Don Vilen

Session 17 (PD) 鈥 Start time 16:00 GMT
Building a Better Blog
Presenter: Steve Jones

Session 18 (Dev) 鈥 Start time 17:00 GMT
Building Flexible Data Services for the Web Using the ADO .NET Data Services Framework
Presenter: Artemakis Artemiou

Session 19 (Dev) 鈥 Start time 18:00 GMT
SQLCLR or T-SQL? A Brief Survey of Performance Options
Presenter: Adam Machanic

Session 20 (BI) 鈥 Start time 19:00 GMT
Loading a Data Warehouse in SSIS
Presenter: Brian Knight

Session 21 (DBA) 鈥 Start time 20:00 GMT
What’s Simple about Simple Recovery Model
Presenter: Kalen Delaney

Session 22 (Dev) 鈥 Start time 21:00 GMT
What’s New, Harder, and Easier in SQL Server 2008 Security
Presenter: Don Kiely

Session 23 (DBA) 鈥 Start time 22:00 GMT
Analyzing File and Wait Statistics
Presenter: Andrew Kelly

Session 24 (BI): Start time 23:00 GMT
Embed Reporting Services into your Applications
Presenter: Jessica Moss

*Depending on your location, sessions may also be broadcast on Sept. 1 and Sept. 3, 2009. Please be sure to check our time zone guide for exact times. When you register using our LiveMeeting interface, sessions will be sent to your Outlook calendar for the correct time in your region.

Excellent. So your priority should now to be to head over to the event site and opportunity. I highly suggest you hurry up and do so as doesn’t take kindly to not taking advantage of such awesome opportunities. Here’s the last guy who didn’t take advantage…

Please, for your sake, don’t be that guy.

Categories
Documentation Rambling Syndicated Syndication

System Documentation: What’s Your Method?

As a system administrator it’s your job to know the ins and outs of the systems you manage. But are you the only cog keeping that particular wheel turning? If you were to leave your current position, or God forbid, something were to happen to you would your company be able to move forward without you without ill effect? This is where proper documentation becomes a crucial part of your job.

Now some would argue that if you document your responsibilities/job/systems/etc you become dispensable. While yes that could be true I dare to say that you really shouldn’t have to worry about that. In my opinion if you’re doing your job, and doing a good job at it, those who matter will notice and this becomes a non-issue. Properly documenting your system if anything then becomes an aid to you to help you do your job better. Yesterday Jonathan Kehayias ( | ) wrote a great article on the . If you get a chance I highly suggest you give that a read since it brings up some great points that include turnover, management, and compliance auditing.

Currently I’m trying to get a handle on the documentation of my systems at work. At the moment my current thought is to create a Word document template that simply has fill-in-the-blank type fields and for every new system that comes online I simply fill out a new form. These forms will be kept in our Sharepoint site and that way those who need access to them (i.e. on-call personnel, Help Desk staff, other system admins, etc.) know where to find them. Of course one could argue the problem with this method is that people who don’t necessarily NEED to see everything in that documentation have access to it. To that I say this, why not? I may take a little flack for saying this but here goes nothing. I believe the world of IT has drastically changed in the last few years (duh). Granted I’m still young but from what I’ve witnessed we are coming from shops where mainframes were king and jobs and knowledge were extremely siloed. Now before you start blasting me on silos, I know they still exist but go with me on this.

In today’s IT world there are simply so many things flying at us at all times. With the rate of new technologies coming out and with organizations trying to do more with less in this economy I think its more important than ever to make knowledge transparent across the enterprise. If someone wants to know what I do as a DBA why not let them know? That person could be interested in jumping in the administration world themselves and just need the basic knowledge and understanding to do so. Another example would be explaining to a project manager the technical pieces of the project they’re managing. How many times have you seen a project dumped in your lap and the necessary components are things that you either A) Don’t support B) Have no in-house knowledge of the necessary technologies.

From my experience knowledge dissemination becomes all the more vital as systems become more tightly integrated. Look at the Microsoft suite of products. Sharepoint is a collaborative portal designed to let people across teams and enterprises share and disseminate (damn I love this word) knowledge with ease. Well in order to stand this product up you’ll need someone who understands databases and their management/administration, someone who understands architectures and how best to implement them, maybe a trainer to let end users understand how this new technology works, desktop personnel to understand the technology and how to troubleshoot it, etc, etc.

As I’m writing I’m realizing I’m really digressing from my original point which is about documentation methodologies. I’ve laid out my general plan for documentation of systems but my original intention of this post (besides my slight soapbox rant up there) was to see how the rest of you guys/gals handle your documentation. Strict methodology and templates? Random documents thrown out on a shared drive or somewhere on your drive? None? Let me hear from you in the comments.