17.06.2013 Views

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

Beginning Microsoft SQL Server 2008 ... - S3 Tech Training

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 19: Playing Administrator<br />

Policy Based Management<br />

This is a relatively advanced feature that is new with <strong>SQL</strong> <strong>Server</strong> <strong>2008</strong>. The idea is fairly simple: Modern<br />

relational systems are all about proactive management of your data — why not proactively manage the<br />

objects and rules applied to the server?<br />

With Policy Based Management, you establish a set of rules to govern your server or even all servers in<br />

your domain. There is a wide list of items that can have policies attached to them, for example:<br />

❑ Object names: Want to enforce that all stored procedures begin with “sp”? No problem. You can<br />

establish such a rule using Policy Based Management.<br />

❑ All databases should have the ANSI ARITHABORT option set to true by default.<br />

How exactly these are enforced is set by rule — treatment options include:<br />

❑ On Demand: Only check for violations of policy when an administrator has specifically<br />

requested the policy audit.<br />

❑ Scheduled: Run an audit of policy violations according to some schedule (creating a list of violations,<br />

but not changing anything).<br />

❑ On Change: Prevent: This proactively prevents the policy violation from being allowed. Under<br />

our earlier example, any stored procedure that didn’t start with sp would fail during creation.<br />

❑ On Change – Log: This notes the violation, but simply logs it (facilitating later reporting).<br />

Most installations will not need the power behind Policy Based Management, but it is a tremendous leap<br />

forward in manageability for larger, multi-server environments.<br />

Summary<br />

584<br />

Well, that gives you a few things to think about. It’s really easy to, as a developer, think about many<br />

administrative tasks and establish what the increasingly inaccurately named Hitchhiker’s Guide to the<br />

Galaxy trilogy called an “SEP” field. That’s something that makes things like administration seem invisible<br />

because it’s “somebody else’s problem.” Don’t go there!<br />

A project I’m familiar with from several years ago is a wonderful example of taking responsibility for<br />

what can happen. A wonderful system was developed for a non-profit group that operates in the Northwestern<br />

United States. After about eight months of operation, an emergency call was placed to the company<br />

that developed the software (it was a custom job.) After some discussion, it was determined that<br />

the database had somehow become corrupted, and it was recommended to the customer that the database<br />

be restored from a backup. The response? “Backup?” The development company in question missed<br />

something very important. They knew they had an inexperienced customer that would have no administration<br />

staff — who was going to tell the customer to do backups and help set it up if the development<br />

company didn’t? I’m happy to say that the development company in question learned from that experience,<br />

and so should you.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!