Wednesday, March 30, 2011

Seven tiers of disaster recovery


1 Tier 0: No off-site data – Possibly no recovery
2 Tier 1: Data backup with no hot site
3 Tier 2: Data backup with a hot site
4 Tier 3: Electronic vaulting
5 Tier 4: Point-in-time copies
6 Tier 5: Transaction integrity
7 Tier 6: Zero or near-Zero data loss
8 Tier 7: Highly automated, business integrated solution

http://en.wikipedia.org/wiki/Seven_tiers_of_disaster_recovery

Tuesday, March 22, 2011

user's permissions in SQL Server 2005

Example - list current login user's permissions

select object_name(major_id) as object_name,permission_name,state_desc
from sys.database_permissions
where major_id >0 and grantee_principal_id !=0

Example - SQL Server Instance Rights

USE AdventureWorks;
SELECT *
FROM fn_my_permissions(NULL, 'SERVER');
GO

Example - Database Rights

USE AdventureWorks;
SELECT *
FROM fn_my_permissions('AdventureWorks', 'DATABASE');
GO

Example - Table Rights

USE AdventureWorks;
SELECT *
FROM fn_my_permissions('HumanResources.Employee', 'OBJECT')
ORDER BY subentity_name, permission_name ;
GO

Thursday, March 10, 2011

Reporting Services Scripter for SQL Server 2000/2005/2008

http://www.sqldbatips.com/showarticle.asp?ID=62

Tuesday, March 8, 2011

Limit Concurrent Database Connections by SQL Server User Account

SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TRIGGER [connection_limit_trigger] ON ALL SERVER
WITH EXECUTE AS 'tfs4dba' FOR LOGON
AS
BEGIN
IF ORIGINAL_LOGIN()= 'tfs4dba' AND
(SELECT COUNT(*) FROM sys.dm_exec_sessions
WHERE is_user_process = 1 AND
original_login_name = 'tfs4dba') > 3
ROLLBACK; END;
GO
SET ANSI_NULLS OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
ENABLE TRIGGER [connection_limit_trigger] ON ALL SERVER

Thursday, March 3, 2011

SQL SERVER – 2005 – Find Stored Procedure Create Date and Modified Date

This post demonstrates the script which displays create date and modify date for any specific stored procedure in SQL Server.



USE AdventureWorks;
GO
SELECT name, create_date, modify_date
FROM sys.objects
WHERE type = 'P'
AND name = 'uspUpdateEmployeeHireInfo'
GO

Tuesday, March 1, 2011

Oracle Database AL32UTF8

AL32UTF8 is the Oracle Database character set that is appropriate for
XMLType data. It is equivalent to the IANA registered standard UTF-8 encoding, which
supports all valid XML characters.

Do not confuse Oracle Database database character set UTF8 (no hyphen) with
database character set AL32UTF8 or with character encoding UTF-8. Database
character set UTF8 has been superseded by AL32UTF8. Do not use UTF8 for XML data.
UTF8 supports only Unicode version 3.1 and earlier; it does not support all valid XML
characters. AL32UTF8 has no such limitation.

Using database character set UTF8 for XML data could potentially cause a fatal error or affect security negatively. If a character that is not supported by the database character set appears in an input-document element name, a replacement character (usually "?")is substituted for it. This will terminate parsing and raise an exception.

Tuesday, February 22, 2011

SQL Server [Version and Edition Upgrades ] And [Backward Compatibility]

SQL Server Version and Edition Upgrades
http://msdn.microsoft.com/en-us/library/ms143393(v=SQL.100).aspx


SQL Server Backward Compatibility
http://msdn.microsoft.com/en-us/library/cc707787(SQL.105).aspx