Home » 2012 » July (Page 2)

Monthly Archives: July 2012

SQL Server 2008 || Parallel DBCC (Database Console Commands)

SQL Server 2008 Enterprise gives you the added boost to verify your data quickly and efficiently with multiprocessor support. Database console commands such as DBCC CHECKDB, DBCC CHECKFILEGROUP, and DBCC CHECKTABLE check the allocation and integrity of the database objects. In short, these commands are used to ensure that the database is free from corruption—pages … Continue reading

How to Recycle SQL Server error logs – 5 Types of logs

1) Recycle SQL Error log exec msdb..sp_cycle_errorlog 2) Recycle SQL Agent Error log exec msdb..sp_cycle_agent_errorlog 3) Recycle(rollover) SQL Server Default trace EXEC sp_configure ‘default trace’, 0 RECONFIGURE EXEC sp_configure ‘default trace’, 1 RECONFIGURE 4) Recycle SQLFT#.Log a. Before 2008 – restart the indexer b. After 2008 – no way to cycle to full text log … Continue reading

SQL Server 2005 Onwards – Mirrored Backup || Cool Feature

SQL Server 2005 onwards includes the mirroring of backup media sets to provide redundancy of your critical database backups. Mirroring a media set increases backup reliability by reducing the impact of backup-device malfunctions. These malfunctions are very serious because backups are the last line of defense against data loss. SQL Server 2005 Standard Edition supports … Continue reading

How to find current/particular transaction level?

There is 2 ways of finding current / particular transaction level :- 1) SELECT CASE transaction_isolation_level WHEN 0 THEN ‘Unspecified’ WHEN 1 THEN ‘ReadUncomitted’ WHEN 2 THEN ‘Readcomitted’ WHEN 3 THEN ‘Repeatable’ WHEN 4 THEN ‘Serializable’ WHEN 5 THEN ‘Snapshot’ END AS TRANSACTION_ISOLATION_LEVEL FROM sys.dm_exec_sessions where session_id = @@SPID 2) DECLARE @UserOptions TABLE(SetOption varchar(100), Value … Continue reading

Script to get details of permissions on Database objects

Script to get details of permissions on Database objects Script to get details of permissions on Database objects SELECT [UserName] = ulogin.[name], [UserType] = CASE princ.[type] WHEN ‘S’ THEN ‘SQL User’ WHEN ‘U’ THEN ‘Windows User’ WHEN ‘G’ THEN ‘Windows Group’ END, [DatabaseUserName] = princ.[name], [Role] = null, [PermissionType] = perm.[permission_name], [PermissionState] = perm.[state_desc], [ObjectType] … Continue reading

%d bloggers like this: