Wednesday, October 5, 2011

PowerPivot for Excel with SQL Server Code Name "Denali" CTP3

Try these new features in Excel and powerful Pivoting, Mostly for reporting & analysis services.
You may also go through the belw blogs
http://blogs.technet.com/b/dataplatforminsider/archive/2011/09/28/what-s-new-in-powerpivot-for-excel-with-sql-server-code-name-quot-denali-quot-ctp3.aspx

Have you download the new PowerPivot for Excel with SQL Server Code Name Denali CTP3? Check out our latest video blog to learn about the new PowerPoint features that are available with CTP3! http://cot.ag/p2ucjk



...Happy SQLing / Thanks for Visiting and Sharing your Views

PASS Summit 2011 by SQL Server Team

SQL Server Team at PASS Summit 2011

Microsoft is once again delighted to be a premier sponsor of the PASS Summit in Seattle from Oct 11 – 14, 2011. We are committing our top resources to the most value-packed SQL Server and Business Intelligence event of the year. This event includes informative keynotes from Microsoft executives as well as Microsoft Customer Service and Support (CSS), SQL Server Clinic to program sessions, Hands-On-Labs, and products on display at the Microsoft Product Pavilion.
The following is where you can find Microsoft’s most knowledgeable experts and top speakers:
  • Keynotes from top Microsoft SQL Server executives: Ted Kummert, Quentin Clark, and technical fellow David J. DeWitt
  • Expert Pods - Meet Microsoft SQL Server Engineering team members and SQL Server MVPs in an informal area on the 6th floor of the conference center
  • SQL Server Clinic - Work through your technical issues with SQL Server CSS and get architectural guidance from SQLCAT
    • SQL Server Kinection – Come to the SQL Server Clinic and sign up to control a SQL Server environment via an Xbox Kinect
  • Hands-On Labs - Get experience through self-paced & instructor-led labs on our cloud based lab platform – bring your laptop or use Hewlett Packard-sponsored hardware
    • Bare Metal Labs – Instructor led labs
      • Learn how to build out your SQL Server Code Name “Denali” based environment from scratch
      • Install SQL Server on Windows Server Core and how to implement AlwaysOn Availability groups
      • Learn new manageability capabilities in SQL Server Code Name “Denali”
  • Microsoft Product Pavilion - Talk with Microsoft SQL Server and BI experts to learn about the next version of SQL Server, check out our new appliances, and make sure you stop in and attend our Solutions Theater sessions
    • Variety of Solutions Theatre Sessions – stop by the Microsoft Product Pavilion to check out the current list of Theatre sessions
  • Microsoft Regular Sessions - Attend 75-minute to 90-minute technical sessions with an excellent lineup of Microsoft speakers
  • Focus Groups - Have your say and share your feedback on SQL Server technologies in the many focus groups that are available. Be sure to sign up now as these fill up VERY quickly! The following is just one of the many focus groups available at the event:
    • Masters, Maestros and Architects
Microsoft Learning wants to deliver quality, meaningful certifications and training to help you get to the highest levels of your profession. You will have an opportunity to ask questions about the advanced certification programs while providing valuable feedback to help us deliver the programs and training you need to reach that next level. Agenda is flexible and will flow with the direction of the discussion. Topics on the table include:
· SQL Server Master Certification (Microsoft Learning)
· SSAS Maestro Certification (SQL CAT)
· SQL Server BI Master Certification (rumored)
· SQL Server Architect Certification (Microsoft Learning)

***You can also follow them on Facebook, Twitter & MSDN Blog****


...Happy SQLing / Thanks for Visiting and Sharing your Views

Thursday, September 29, 2011

Blog on Mobile

Dear Visitors,

This blog is now compatible for all mobile editions. You may also access the page from your Mobiles.

...Happy SQLing / Thanks for Visiting and Sharing your Views

Thursday, September 22, 2011

Is your Database having Too many VLFs? (Tuning Log File Auto Growth doesnt help ?)

Too many VLFs will cause to slow down the operations on the database.
As the Virtual log files grows, the time taken to read the log file will also grow.

So watch on the virtual log files on your databases.

Analyse
Count of VLFs can be either pulled using

DBCC LOGINFO
OR
Try to shrink the log file and it will provide you the number of files
DBCC SHRINKFILE ('MSDBLOG') -- Check the "UsedPages" value from the resultset.

Too many virtual log files can be seen in one among the below cases

1) When there is no transaction log backup and the database is in Full Recovery Model
2) Where the database is acting as a replication Publisher and is either in Full or Simple Recovery model. Frequent periodic T-log backups are still recommended
3) where there is a large / older Open transaction on a Database

Solution:-

1) Try to take periodic regular T-log backups
2) Issue Checkpoint
3) Shrink the log file

Try to apply the proceedure in the given series and mostlikely issuing a continous checkpoint will also help when the database is in Simple Recovery model.

Hope it helps

...Happy SQLing / Thanks for Visiting and Sharing your Views

Tuesday, August 9, 2011

SQL Server Internal Memory Notifications


Below Query helps you to read the notifications that SQL Server has generated internally.



SELECT CONVERT (varchar(30), GETDATE(), 121) as runtime,

DATEADD (ms, -1 * (sys.ms_ticks - a.[Record Time]), GETDATE()) AS Notification_time,

a.* , sys.ms_ticks AS [Current Time]

FROM

(SELECT x.value('(//Record/ResourceMonitor/Notification)[1]', 'varchar(30)') AS [Notification_type],

x.value('(//Record/MemoryRecord/MemoryUtilization)[1]', 'bigint') AS [MemoryUtilization %],

x.value('(//Record/MemoryRecord/TotalPhysicalMemory)[1]', 'bigint') AS [TotalPhysicalMemory_KB],

x.value('(//Record/MemoryRecord/AvailablePhysicalMemory)[1]', 'bigint') AS [AvailablePhysicalMemory_KB],

x.value('(//Record/MemoryRecord/TotalPageFile)[1]', 'bigint') AS [TotalPageFile_KB],

x.value('(//Record/MemoryRecord/AvailablePageFile)[1]', 'bigint') AS [AvailablePageFile_KB],

x.value('(//Record/MemoryRecord/TotalVirtualAddressSpace)[1]', 'bigint') AS [TotalVirtualAddressSpace_KB],

x.value('(//Record/MemoryRecord/AvailableVirtualAddressSpace)[1]', 'bigint') AS [AvailableVirtualAddressSpace_KB],

x.value('(//Record/MemoryNode/@id)[1]', 'bigint') AS [Node Id],

x.value('(//Record/MemoryNode/ReservedMemory)[1]', 'bigint') AS [SQL_ReservedMemory_KB],

x.value('(//Record/MemoryNode/CommittedMemory)[1]', 'bigint') AS [SQL_CommittedMemory_KB],

x.value('(//Record/@id)[1]', 'bigint') AS [Record Id],

x.value('(//Record/@type)[1]', 'varchar(30)') AS [Type],

x.value('(//Record/ResourceMonitor/Indicators)[1]', 'bigint') AS [Indicators],

x.value('(//Record/@time)[1]', 'bigint') AS [Record Time]

FROM (SELECT CAST (record as xml) FROM sys.dm_os_ring_buffers

WHERE ring_buffer_type = 'RING_BUFFER_RESOURCE_MONITOR') AS R(x)) a

CROSS JOIN sys.dm_os_sys_info sys

ORDER BY a.[Record Time] ASC



...Happy SQLing / Thanks for Visiting and Sharing your Views


Sunday, July 17, 2011

Important support changes for SQL Server 2000 and SQL Server 2005


What is happening:

SQL Server 2000
On 4/9/2013, Extended Support for SQL Server 2000 will come to an end, and SQL Server 2000 will no longer be supported.
After this date:
·         Updates to this software will stop and so you will no longer receive patches including security updates.
·         Self-Help Online Support will be available for a minimum of 12 months.

SQL Server 2005
On 4/12/2011, SQL Server 2005 will transition from Mainstream Support to Extended Support, which includes:
·         Paid support (charged on an hourly basis per incident). Customers will no longer receive no-charge incident support and warranty claims, and won’t be able to request design changes or features.
·         Security update support at no additional cost.
·         Non-security related hotfix support will require a separate Extended Hotfix Support Agreement to be purchased within 90 days of the end of Mainstream Support – July 11th, 2011.

Microsoft Support Lifecycle Policy
The Microsoft Support Lifecycle policy took effect in October 2002, and applies to most products currently available through retail purchase or volume licensing and most future release products.

Through the policy, Microsoft will offer a minimum of:
·         10 years of support (5 years Mainstream Support and 5 years Extended Support) at the supported service pack level for Business and Developer products
·         5 years Mainstream Support at the supported service pack level for Consumer/Hardware/Multimedia products
·         3 years of Mainstream Support for products that are annually released (for example, Money, Encarta, Picture It!, and Streets & Trips)
  

Phases of the Support Lifecycle
clip_image002

Your options in moving forward:
SQL Server 2000
·         Upgrade to a supported version of SQL Server.
·         Find out more about a Custom Support Agreement (CSA).
·         Run SQL Server 2000 unsupported with access to Self-Help Online Support only (not recommended)

SQL Server 2005
·         Remain on SQL Server 2005 with Extended Support. You can still open support incidents and receive support, however you will not be able to request specific fixes.
·         Remain on SQL Server 2005 with Extended Support and purchase Extended Hotfix Support. You can then open support incidents and request specific fixes.
·         Upgrade to a supported version of SQL Server

Get more details on how to stay supported along with other important resources at: http://www.microsoft.com/sqlserver/en/us/support/support-updates.aspx

Source: Microsoft SQL Server Team Blog

...Happy SQLing
Thanks for Visiting and Sharing your Views

Saturday, July 16, 2011

SQL Server Developer Tools "Juneau" CTP3 bits available now!

Are you a wanted Developer?
Take a look at the Pre-release SQL Server developer tools from Denali CTP3.
Donot forget to Provide your feedback to Microsoft.

http://www.microsoft.com/web/gallery/install.aspx?appid=JUNEAU10


...Happy SQLing
Thanks for Visiting and Sharing your Views

SQL Server Code Name “Denali” CTP3 and SQL Server 2008 R2 SP1 are HERE!

Denali's Community Technology preview 3 Bits are now available. Start downloading and have fun with Denali (the most hiped and awaited product from Microsoft SQL Server team)

https://www.microsoft.com/betaexperience/pd/SQLDCTP3CTA/enus/

...Happy SQLing
Thanks for Visiting and Sharing your Views

Friday, July 1, 2011

Unable to Shrink Log File?

Log File Can only be Shrunk when :-

1) There are no Open Transactions in the Database

USE DB
DBCC OPENTRAN

2) When the Log File is not in use

DBCC LOGINFO
Verify that the File status <> 2 for all the Virtual log files.
 Backup the Log file to mark the file status to inactive.

3) Check if the Database is involved in Transactional Replication
If your database is involved in Transactional replication and you see there are no undelivered transactions, then execute the below

USE [database]
go
exec sp_repldone @xactid = NULL, @xact_seqno = NULL, @numtrans = 0, @time = 0, @reset = 1
go
DBCC Shrinkfile ('logfilename')

Increase in the Virtual Log files and Size will also lead to fail replication from delivering the transactions to the Subscriber.




...Happy SQLing
Thanks for Visiting and Sharing your Views

Review CPU Utilization history from SQL Server

There will be at times where we would be wondering as what happened in the history that caused the SQL Server slow down or poor performance.
one such clue to look at initially is the CPU pressure.

using the Below Query we can pull the CPU Utilization history for the last 30 minutes.
You can see CPU Utilized by SQL Server and Other Windows Processes.

DECLARE @ts_now bigint SET @ts_now = (SELECT cpu_ticks/(cpu_ticks/ms_ticks)FROM sys.dm_os_sys_info); SELECT
SystemIdle
100
TOP(50) SQLProcessUtilization AS [SQL Server Process CPU Utilization], AS [System Idle Process], - SystemIdle - SQLProcessUtilization AS [Other Process CPU Utilization], DATEADD(ms, -1 * (@ts_now - [timestamp]), GETDATE()) AS [Event Time] FROM ( SELECT
record
record.value('(./Record/@id)[1]', 'int') AS record_id, .value('(./Record/SchedulerMonitorEvent/SystemHealth/SystemIdle)[1]', 'int') AS
record
[SystemIdle], .value('(./Record/SchedulerMonitorEvent/SystemHealth/ProcessUtilization)[1]', 'int') AS [SQLProcessUtilization], [timestamp] FROM ( SELECT [timestamp], CONVERT(xml, record) AS [record] FROM sys.dm_os_ring_buffers WHERE ring_buffer_type = N'RING_BUFFER_SCHEDULER_MONITOR' AND record LIKE '%<SystemHealth>%') AS x ) AS y ORDER BY record_id DESC;

...Happy SQLing
Thanks for Visiting and Sharing your Views

Generate Scripts of all SQL Server Objects

...Happy SQLing
Thanks for Visiting and Sharing your Views

Identify bad / Unused Indexes

While tuning the performance of a query or Stored Procedure, we might want to first look at the bad and required indexes.

Bad Indexes:- There are indexes that are not being used and are resulting to bad execution plan.
These indexes are noted as Unused Indexes. Below Query helps you to find the unused indexes based on the last Usage Statistics. basically Indexes that are not used for Seek / Scan operations and used under inserts/updates in the Columns are treated as Unused Indexes.


FOR A SINGLE DATABASE

SELECT DB_NAME() AS [Database], o.name AS Table_name, i.name AS index_name, i.type_desc, SUM(s.used_page_count) * 8   AS IndexSizeKB, u.user_seeks, u.user_scans, u.user_lookups, u.user_updates,

u.last_user_seek, u.last_user_scan, 'Drop index ' + i.name + ' on ' + o.name as DropIndexStatement
FROM sys.indexes i JOIN sys.dm_db_partition_stats  AS s ON s.[object_id] = i.[object_id] AND s.index_id = i.index_id
JOIN sys.objects o ON  i.object_id = o.object_id
LEFT JOIN  sys.dm_db_index_usage_stats u ON i.object_id = u.object_id
AND i.index_id = u.index_id AND u.database_id = DB_ID()
WHERE o.type <> 'S' and isnull(u.user_updates,0) > 0and i.type_desc <> 'HEAP' AND U.user_seeks < 100
GROUP BY
o.name , i.name, i.type_desc, u.user_seeks, u.user_scans, u.user_lookups, u.user_updates,
u.last_user_seek, u.last_user_scan, i.name, o.name
ORDER BY
(convert(decimal(19,4),ISNULL(u.user_seeks, 0)) + ISNULL(u.user_scans, 0) + ISNULL(u.user_lookups, 0))/ISNULL(u.user_updates, 0) asc, user_updates desc, o.name, i.name


RUN THIS IF REQUIRED FOR FOR ALL DATABSES
 declare @db_name varchar(100), 
@str varchar(5000) , @str1 varchar(5000)

DECLARE cur_user_db CURSOR FOR 
 SELECT name  
 FROM master..sysdatabases  
 where name not in ('tempdb', 'model', 'master', 'msdb', 'maintenance', 'distribution', 'litespeedlocal', 'litespeedcentral') 
        and databasepropertyex(name,'Updateability') = 'READ_WRITE'  
        and databasepropertyex(name,'Status') = 'ONLINE' 
        and databasepropertyex(name,'Useraccess') = 'MULTI_USER' 

OPEN cur_user_db 

FETCH NEXT FROM cur_user_db into @db_name 
WHILE @@FETCH_STATUS = 0 
BEGIN 
set @str = 'use [' + @db_name + ']' + char(13) + char(10) +
'SELECT DB_NAME() AS [Database], o.name AS Table_name, i.name AS index_name, i.type_desc, SUM(s.used_page_count) * 8   AS IndexSizeKB, u.user_seeks, u.user_scans, u.user_lookups, u.user_updates,
u.last_user_seek, u.last_user_scan, ''Drop index '' + i.name + '' on '' + o.name as DropIndexStatement
FROM sys.indexes i
JOIN sys.dm_db_partition_stats  AS s ON s.[object_id] = i.[object_id] AND s.index_id = i.index_id
JOIN sys.objects o ON  i.object_id = o.object_id
LEFT JOIN  sys.dm_db_index_usage_stats u ON i.object_id = u.object_id         
AND i.index_id = u.index_id AND u.database_id = DB_ID()
WHERE o.type <> ''S'' and isnull(u.user_updates,0) > 0and i.type_desc <> ''HEAP'' AND U.user_seeks < 100
GROUP BY
o.name , i.name, i.type_desc, u.user_seeks, u.user_scans, u.user_lookups, u.user_updates,
u.last_user_seek, u.last_user_scan, i.name, o.name
ORDER BY
(convert(decimal(19,4),ISNULL(u.user_seeks, 0)) + ISNULL(u.user_scans, 0) + ISNULL(u.user_lookups, 0))/ISNULL(u.user_updates, 0) asc, user_updates desc, o.name, i.name'
exec (@str) 
FETCH NEXT FROM cur_user_db into @db_name 
END 
CLOSE cur_user_db 
DEALLOCATE cur_user_db

The Query also provides the Command to drop the Unused Indexes. So its easy to remove them.



...Happy SQLing
Thanks for Visiting and Sharing your Views