Policy Based Management (PBM) in SQL Server
1: To restrict users to prefix "sp_" for User Defined Stored procedure
To restrict users to prefix "sp_" for User Defined Stored procedure due to following reasons:For performance:
Possible conflict of user created stored procedures with system stored procedures:
2. To follow a particular naming convention for procedures Eg ‘usp_’
3. A company policy prohibits enabling Database Mail or SQL Mail. A policy is created to check the server state of those two features. An administrator compares the server state to the policy. If the server state is out of compliance, the administrator chooses the Configure mode and the policy brings the server state into compliance.4. The AdventureWorks2012 database has a naming convention that requires all stored procedures to start with the letters AW_. A policy is created to enforce this policy. An administrator tests this policy and receives a list of stored procedures that are out of compliance. If future stored procedures do not comply with this naming convention, the creation statements for the stored procedures fail.
5. Enforce SQL Server Database Naming Conventions. Standard naming convention for databases would likely include the following rules:
- Does not include any special characters CREATE DATABASE [embedded.period]
- Does not start with a number; Eg: CREATE DATABASE [1_start_number];
- Does not have embedded or trailing spaces; CREATE DATABASE [trailing_space ]
- On demand policy to ensure that all the databases have the Auto Shrink option set to True. By default, a database that is created has Auto Shrink set to False, as shown in the figure below.
Benefits:
- Policy Based Management is considered as one of ‘standard’ method to administer database proactively.
- It allows DBAs to create various policies to enforce certain rules to single database, to group of databases or to whole server.
- It is possible to combine more than one condition into one policy.
- Policy based management is loaded with several advantages. It can help you implement various policies for reliable configuration of the system.
- It also provides additional administration assistance to DBAs and helps them effortlessly manage various tasks of SQL Server across the enterprise.
Limitation:
- Policies can affect how some SQL Server features work.For example, change data capture and transactional replication both use the systranschemas table, which does not have an index. If you enable a policy that all tables must have an index, enforcing compliance of the policy will cause these features to fail.
- Certain policies can’t be enforced i.e. they will not have the option “On Change : Prevent” applied to them and so you won’t get the option in evaluation Mode drop down at the bottom
Comments
Post a Comment