After lots of confusion between DMF (Dynamic Management Functions) and DMF (Declarative Management Framework), a new name is given to be clear – Microsoft SQL Server 2008 Policy Based Management.
Policy Based Management allows to define and enforce the polices for configuring and managing SQL Servers across the enterprise. Here is just a brief description of the terminology.
Target – Object to be managed
Facet – Property of the object(target)
Condition – list of criteria for target’s facets
Policy - Set of conditions on the facets of a target
Evaluation Modes
On Demand – policy is evaluated only when manually run by admin
On change: Prevent – DDL triggers prevent policy violations
On Change: log only – Event notifications are used to check the policy when changes are made
On Schedule – SQL Agent job checks the policies for periodical violations
Sometimes in a production environment you may want to give developers read access to the text of the stored procedures but not be able to modify or execute them. In SQL Server 2005, you can grant VIEW DEFINITION permissions. Here are different ways to it
To grant view permissions to the entire schema
GRANTVIEW DEFINITION ONSCHEMA::dbo TO [UserName]
To grant permissions to specific stored procedure
GRANTVIEW DEFINITION ON YourStoredProcedureName TO [UserName]
To grant view definition on all the stored procedures in the database
Database snapshot is a read-only static database which provides the view of data at a point in time.Snapshots use the process of copy on write operation. If a page in the source database is modified for the first time, the original page is copied from the database to the snapshot. Updates after that don’t affect the contents of the snapshot.
Snapshots are very useful to off load historical reports from the OLTP systems. If mirroring is used for high availability, snapshots can be created on the mirror database.
SQL server management studio does not provide an option to create snapshots. The following T-SQL creates a snapshot named ProductSnap_0100 (0100 is the time stamp of when the database is created i.e. 1am) on the Products database with its sparse file named Products_data.ss.