Tuesday, June 16, 2009

Lifehacker - Five Best Alternative File Copiers - File Management

 

If you do any serious file copying on a Windows system, you'll quickly discover that there are substantial limitations to the default file copier. Ease your file copying frustrations with these five alternative copiers.

Lifehacker - Five Best Alternative File Copiers - File Management

Thursday, June 11, 2009

Get Performance Tips Directly From SQL Server - SQLServerCentral

 

When SQL is compiled, an ‘optimal’ plan is created and stored in the plan cache, the plan contains details of table and index access. To produce this plan, the optimiser uses information from various sources, including indexes, statistics and row counts.

If the optimiser would like to use certain information but can’t find it, it adds details of what it wanted to use to the plan. Inspecting the plans for these details will help us improve the performance of our SQL.

For example, if a certain index could have been useful for a given SQL statement, the optimiser looks for that index, if that index is not found, the missing index’s details are stored together with the plan.

There are various performance related items we can search for including: missing indexes, columns with no statistics, and the occurrence of table scans.

This utility makes use of Dynamic Management Views (DMVs) and Dynamic Management Functions (DMFs), so can be used by SQL Server 2005 or greater.

Get Performance Tips Directly From SQL Server - SQLServerCentral

Color Palette and the 56 Excel ColorIndex Colors

No wonder Excel graphs usually look like crap.   No 32 million color palette?

And who doesn’t use a color monitor with Excel these days?

Each Microsoft Excel workbook has a palette of 56 colors that you can apply to cells, fonts, gridlines, graphic objects, and fills and lines in a chart.  If you are using a color monitor, you can customize the shade and intensity of the colors in the color palette for each workbook.

Color Palette and the 56 Excel ColorIndex Colors

And some add-ons to get around this limitation.

http://color-palette.qarchive.org/

This step-by-step article explains how to change the color palette so that you can use custom colors for elements of the workbooks in Microsoft Excel. You can modify colors for many workbook elements, including the following elements:

  • Worksheet Tabs
  • Fonts
  • Charts and chart elements
  • Cells (fills and borders)

This article explains how to change the color palette so that you can use custom colors for these elements.

http://support.microsoft.com/kb/288412

There’s some “interesting” challenges keeping color consistent between Excel and PowerPoint too.

Retrieve List of Databases and their Properties using PowerShell

If you are a DBA monitoring more than 1 database server, Powershell is the way to go on a budget.

Problem
In a previous tip on using Using PowerShell with SQL Server Management Objects (SMO), you've seen how you can use Windows PowerShell and SMO to administer SQL Server databases. I would like to translate some of the Transact-SQL scripts that I use every day, starting with the simple ones like retrieving a list of databases and their properties for auditing purposes.

Solution
One of the things that we do as DBAs is to retrieve a list of databases and their properties for auditing and reporting purposes. We check for properties such as recovery model, available free space, autoshrink, etc., and generate action items based on them. We've already seen how to access the Server object - its properties and methods - using SMO. We will dig into the object hierarchy and look at the different members of the Server object. A SQL Server instance can be described using different properties like instance name, logins, settings, all of which are members of the Server object.

Retrieve List of Databases and their Properties using PowerShell

Tuesday, June 09, 2009

Dynamic SQL execution on remote SQL Server using EXEC AT

 

Problem
With SQL Server 2000, we had OPENQUERY and OPENROWSET to execute a pass-through query on the specified server, but it has several inherent limitations. Starting with SQL Server 2005 we have another more elegant way using "EXEC AT" to execute a pass-through query on the specified linked server which also addresses several shortcomings of OPENQUERY and OPENROWSET table functions.

In this tip I am going to start my brief discussion with OPENQUERY and OPENROWSET table functions, its limitation and how the new EXEC AT command overcomes them.

Dynamic SQL execution on remote SQL Server using EXEC AT

Friday, June 05, 2009

SQL Server backup and recovery: Idera SQL safe backup

Useful script to backup all databases on a server with Idera SQL safe

alter proc dbo.sp_backupalldb
as

declare @dbname as varchar(100)
declare @fname as varchar(255)
declare @rownum as int
SET @rownum = 1

declare @dbcount as int
select @dbcount = count(*)
    from sys.databases
    where name not in ('tempdb')

while @rownum <= @dbcount
begin

select @dbname = name from (
    select name, row_number() over (order by name) rownum
    from sys.databases
    where name not in ('tempdb') ) dbs
where rownum = @rownum

if @@rowcount = 0 RETURN

print @dbname

set @fname = 'D:\Backup\' + @dbname + '.safe'

print @fname

EXEC [master].[dbo].[xp_ss_backup]  
@database = @dbname,  
@filename = @fname,  
@backuptype = 'Full'

set @rownum = @rownum + 1

end

SQL Server backup and recovery: Idera SQL safe backup

Default trace - A Beginner's Guide - SQLServerCentral

 

We have all been subject to or know someone who has been in a situation where an object has been altered/created/deleted, without our knowledge, and the application comes to a screeching halt. After fixing the problem, your boss asks you some questions, like what happened, why did it happen, and who did it. SQL Server 2005 introduced a new type of trigger called a DDL trigger that can provide all the answers we need; however, you did not get a chance to implement this functionality. So... what do you do?

Default trace - A Beginner's Guide - SQLServerCentral

How to Identify Blocking Problems with SQL Profiler

 

In SQL Server 2000 and earlier, identifying blocking issues was not an easy task. One option was to use Enterprise Manager to view existing connections to see if any blocking was occurring, or using the sp_who or sp_who2 commands. If you were really ambitious, you could write some code to extract blocking data from system tables.

In SQL Server 2005, the situation has improved. Besides Management Studio, stored procedures, and system tables, we also have DMVs and even the Performance Dashboard. However, most importantly, we have a new SQL Server Profiler event, Blocked Process Report. This event does a great job of helping you to identify blocking issues and, at the same time, provides you with much of the information you need to help correct the problem.

How to Identify Blocking Problems with SQL Profiler

Phoenix: SQL Server 2005 Best Practices

 

The following are some of the best practices adopted by SQL Server DBA's. I have covered some important stuffs starting with Tempdb, Memory, DB engine, Replication and Index.

Phoenix: SQL Server 2005 Best Practices

[SQL] Force the protocol (TCP, Named Pipes, etc.) in your connection string - Jon Galloway

Learn something new every day.  Until now, I was using the sql client alias configuration tool to set this one up.

No more dependencies on server admins!

Barry Dorrans recently mentioned that you can force the database connection protocol by specifying np: or tcp: before the server name in your connection string. I've jumped through some hoops before using localhost to target tcp and (local) to target named pipes, but it looks like there's a much better way to do this (since MDAC 2.6).

There's more info in MS KB Article 313295:

TCP/IP:

server=tcp:hostname

You can optionally specify a specific port number. By default, the port is 1433.

server=tcp:hostname, portNumber


Named Pipes:



server=np:hostname

You can optionally specify a specific named pipe.



server=np:\\hostname\pipe\pipeName




[SQL] Force the protocol (TCP, Named Pipes, etc.) in your connection string - Jon Galloway

Wednesday, May 27, 2009

Moving Database Files Detach/Attach or ALTER DATABASE? - SQLServerCentral

 

At times it can be necessary to move the data and or log files from one location to another on the same SQL Server. There are two ways to go about doing this task, detaching the database from the SQL Server Instance, moving the files to the new location in the operating system, and then reattaching the database to the SQL Server Instance, and using ALTER DATABASE with the MODIFY FILE option to move the files through a metadata switch, taking the database offline, moving the file in the operating system and then bringing the database back online. Both accomplish the same task, but there are a number of reasons why the ALTER DATABASE method can make more sense for doing this kind of task.

Moving Database Files Detach/Attach or ALTER DATABASE? - SQLServerCentral

Friday, May 22, 2009

Windows 7 and Windows Application Compatibility : Boot from Windows 7 VHD Boot without having any native Operating System

 

Boot from Windows 7 VHD Boot without having any native Operating System

VHD boot is a new feature of Windows 7 and can be used in very creative ways. If you have a need for Reimaging a machine (like a testing environment) back to its original configuration then booting from VHD seem to be a very easy way to do it.

Windows 7 and Windows Application Compatibility : Boot from Windows 7 VHD Boot without having any native Operating System

Thursday, May 21, 2009

Microsoft SQL Server Development Customer Advisory Team – Mirroring SQL

 

To get more information on SQL Server database mirroring, check these links (Some of these were written for SQL 2005 but still apply to SQL 2008):

· Database Mirroring and Log Shipping Working Together: http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx

· Implementing Application Failover with Database Mirroring: http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx

· Database Mirroring Best Practices and Performance Considerations: http://technet.microsoft.com/en-us/sqlserver/bb671430.aspx

· Database Mirroring FAQ: http://www.microsoft.com/technet/prodtechnol/sql/2005/dbmirfaq.mspx

· Performance Boost for Database Mirroring: http://www.sqlskills.com/blogs/paul/post/SQL-Server-2008-Performance-boost-for-Database-Mirroring.aspx

· Troubleshooting Database Mirroring Deployment: http://msdn.microsoft.com/en-us/library/ms189127.aspx

· How to Avoid Orphaned Users With Database Mirroring:

http://glennberrysqlperformance.spaces.live.com/Blog/cns!45041418ECCAA960!494.entry

Microsoft SQL Server Development Customer Advisory Team

Halving your delete times with large datasets

Here is info from MySpace and the SQL Performance Team on how to delete large ordered blocks of data.

create view v1 as (select top (10000) * from t1 order by a)

and we can delete the “top” rows using simply

delete from v1

The query plan for this delete is much simpler.

Pic2

and the I/O and cpu statistics demonstrate the improvement:

Microsoft SQL Server Development Customer Advisory Team

Tuesday, May 19, 2009

Digital Volcano – Find and Replace multiple files

TextCrawler and Duplicate Cleaner are two useful tools for a DBA working with Reporting Services.

In combination with Reporting Services Scripter, TextCrawler allows you to perform comparisons of reports between servers (by changing the server name in the RDL) and to change the root path for folders in the rss scripts (provided the name is distinct).

Digital Volcano

Thursday, May 07, 2009

BI-tch – Dropping the time in datetime

Sometimes door #1 isn’t the best option.

Option 3: DATEADD

DATEADD(dd, DATEDIFF(dd, 0 getdate()), 0)

Returns 2009-04-09 00:00:00.000 (shock horror!)

BI-tch

Andrew Fryer's Blog

 

To help make sense of your options there is a Metadata toolkit containing a whitepaper and and a number of tools:

  • DependencyAnalyzer.exe – Tool that evaluates and loads into a database the lineage on SSIS packages, Analysis Services and SQL Server. All the source code for this program is provided.
  • DependencyViewer.exe – A tool that lets you graphically see the dependencies and lineage of objects in the lineage repository. Source code is provided for this program.
  • Data Source View – A DSV that connects to the lineage repository (SSIS META database) that can be used by Reporting Services.
  • Lineage Repository – A database called SSIS_META that can be used to house metadata from nearly any system.
  • Reports – Some standard reports for impact analysis studies. You will find two key reports out of the box with several sub-reports.
  • Report Model – A report model that you can use with Report Builder to allow end-users to create ad-hoc reports.
  • Integration Services Samples – A few sample packages to start auditing and viewing lineage on.

Andrew Fryer's Blog

Friday, May 01, 2009

RamDisk for Performance and Security

This technology was around since the dawn of XT and could be valuable for improving SQL performance.

RamDisk and RamDisk Plus®
(a.k.a Ramdrive)

RamDisk and RamDisk Plus offer dramatic improvement in the storage performance of servers and applications running on Windows Server 2003, Windows XP, and Windows 2000. Intel’s IoMeter benchmark reveals that our ramdrives typically show a 50 times performance gain over a physical hard disk. In many instances, that translates into an improvement of 3 to 10 times in overall application speed.

RamDisk for Performance and Security

Wednesday, April 22, 2009

THE BI Blog : The Bird is the Word

Straight from the BI Blog comes social BI networks.

Here is a useful list of some of the communities and social groups for Microsoft BI, out there to get involved.

Follow the bird, the bbb-bird bird bird, bird is the word…

Twitter feeds

Microsoft BI

Nic Smith

Donald Farmer

Guy Weismantel

Microsoft SharePoint

SQL Server Pro’s

Microsoft_Excel

Facebook groups

Microsoft Business Intelligence

Microsoft SharePoint

Microsoft SQL Server

Excel


Linkedin groups

Microsoft Business Intelligence

SharePoint Users Group
SQLServer Central

Excel

Microsoft YouTube Channel

http://www.youtube.com/user/wowmsft

Microsoft BI blogs

The Microsoft BI Blog

http://blogs.msdn.com/bi

THE BI Blogroll

Intelligent Insight on Performance Management
PerformancePoint Team Blog
Norm's PerformancePoint Server Blog
Excel Team Technical Blog
SQL Server Reporting Services Team Blog
RDA Business Intelligence Blog
Sacha Tomey's BI Blog
LATAM Business Productivity Blog
SharePoint Team Blog
SQL Data Services Team Blog
The I in BI Hayley Rixon’s Blog

Microsoft BI Websites

Microsoft BI

Microsoft People Ready Business

SharePoint

SQL Server

Excel

Partners

http://www.microsoft.com/bi/partners/default.aspx

https://partner.microsoft.com/bi

TechNet Discussion Forums:

SQL Server Analysis Services
SQL Server Data Access
SQL Server Reporting Services
Management Reporter
ProClarity - General
SharePoint - Excel Services
Data Mining
Monitoring and Analytics
SharePoint - Social Computing
SQL Server Data Warehousing
SharePoint - Collaboration
SharePoint - Business Intelligence

Office Online Discussion Forums

Excel

THE BI Blog : The Bird is the Word

Friday, April 17, 2009

Amit's blog : Disk Partitioning Offset

 

Volume alignment, commonly referred to as sector alignment, should be performed on the file system (NTFS) whenever a volume is created on a RAID device. Failure to do so can lead to significant performance degradation; these are most commonly the result of partition misalignment with stripe unit boundaries. This can also lead to hardware cache misalignment, resulting in inefficient utilization of the array cache. For more information on this, see Disk performance may be slower than expected when you use multiple disks in Windows Server 2003, in Windows XP, and in Windows 2000.

Amit's blog : Disk Partitioning Offset

Monday, April 13, 2009

SQL Steve’s SQL Tips - While replacement

Instead of counters and while loops, this is a simple replacement.

But what if you have billions of rows in the “ErrorLog” table and you need to delete them a batch at a time so that you don’t lock up the entire table? You can use the “TOP” operator to specify the batch size and then specify an integer value that follows the “GO” keyword specifying the number of batches to execute.

For example:

DELETE
TOP(100000)

FROM

    ErrorLog

WHERE

    ErrorTime < ‘2008-01-01′

GO 10000

SQL Steve’s SQL Tips

Tuesday, February 03, 2009

Two Time-saving VS Command Line Parameters

Who needs Windows...

“…\devenv.exe” “path to solution file”

You can copy an paste your exising shortcut file to a new shortcut file and then modify the Target field to have the additional solution parameter.

To use both of these together, put the solution file first and the /nosplash second.

To see other command line options, run devenv.exe with the /? parameter.

Two Time-saving VS Command Line Parameters

Sunday, January 04, 2009

Microsoft .NET & C#: Complete OLAP infrastructure without Microsoft Analysis Services, part 3

 

Complete OLAP infrastructure without Microsoft Analysis Services, part 3

In previous part of this tutorial we've built an analytical database using Microsoft Analysis Services. We've been able to browse the database using SQL Management Studio and execute MDX queries on it.

In this part of the tutorial we will:

  • build an offline static cube (*.cub file) from the relational database using C# and ADOMD.NET
  • query the static cube using Microsoft Excell as static cube browser
  • query the static cube with MDX queries using C# and ADOMD.NET

Microsoft .NET & C#: Complete OLAP infrastructure without Microsoft Analysis Services, part 3

Saturday, January 03, 2009

Internals Viewer for SQL Server - Home

 

Project Description
Internals Viewer is a tool for looking into the SQL Server storage engine and seeing how data is physically allocated, organised and stored.
All sorts of tasks performed by a DBA or developer can benefit greatly from knowledge of what the storage engine is doing and how it works
Note There was a problem with the first release of Beta 2 20081228. If no add-in is visible please follow the instructions in Troubleshooting.
User Guide
Troubleshooting
Features

  • Integration with SSMS (SQL Server Management Studio) 2005 and 2008
    • The application is installed as a SSMS add-in
    • Internals information integrated into the Object Explorer
    • Transaction Log viewer integrated into the Query Results
  • Allocation Map
    • Displays the physical layout of tables and indexes
    • Displays PFS status
    • Overlay pages in the Buffer Pool
  • Page Viewer
    • Displays Data pages including forwarding records and sparse columns
    • Displays Index pages
    • Displays allocation pages (IAM, GAM, SGAM, DCM, and BCM pages)
    • Displays pages with SQL Server 2008 row and page compression

Internals Viewer for SQL Server - Home

Friday, January 02, 2009

Quick and dirty clone table schema

 

SELECT top 0 * into customer_backup
  FROM customers

Be sure to create your primary keys and indexes afterwards!

Wednesday, December 31, 2008

DM Companion – Data mining in cloud city

If you would like a better understanding of the Data Mining Experience from the web, DM Companion looks like a good learning tool.

Of course, there’s always this tool too:
http://sqlserverdatamining.com/cloud

DM Companion

Monday, December 29, 2008

DataPort Web | Sql bulk insert and paramaters

 

Sometimes transferring data quickly and safely can be a major task. In the following example I’ll show you how you can do a parameterized insert and how to use the sql transaction. This will speed up your insert tremendously.

DataPort Web | Sql bulk insert and paramaters

Data Dude - VSTS Database GDR VPC

 

You can download the VPC from the following location:

Data Dude

Sunday, December 21, 2008

Metadata Toolkit - Windows Live

The BI Metadata Toolkit

Overview

This white paper covers several interesting and unique methods for managing metadata in SQL Server Integration Services, Analysis Services and Reporting Services using built-in features including data lineage, business and technical metadata and impact analysis.

http://www.microsoft.com/downloads/details.aspx?FamilyID=182bd330-0189-450c-a2fe-df5c132d9da9&displaylang=en

Metadata Toolkit - Windows Live

Saturday, December 20, 2008

Download details: SQL Server 2005 SP3

 

Microsoft SQL Server 2005 Service Pack 3

Brief Description

Download Service Pack 3 for Microsoft SQL Server 2005.

Download details: SQL Server 2005 SP3

Tuesday, December 09, 2008

Andrew Fryer's Blog – creating a “time of day” dimension

Highlighting some of the pluses of SQL 2008

Following on from my previous post, in some data warehouses there is a separate dimension for time of day, so that demand through a day can be modelled. Storing time in SQL server 2005 was a bit of a cludge typically involving picking an arbitrary date (like 1/1/1900) and then tacking the time on to the end of that.  Now there’s a separate time data type so it’s easy to store the right data and create the time dimension using a script like this:

declare @time time = '00:00'
declare @timekey int = 0
declare @timegrain int =15

if not exists
    (select  * from sys.tables where name = 'dimTimeofday')
create table dimTimeofday( timekey int, TimeofDay time)
while @timekey < 1440 begin   
    insert into dimTimeofday(timekey,Timeofday) values (@timekey, @time)
    set @time = dateadd(minute,@timegrain,@time)
    set @timekey += @timegrain
end

For more on the new time data type check books on line here.

Andrew Fryer's Blog

Monday, December 08, 2008

SQL Server Matrix Workbench

Excel inside SQL Server?  It’s possible…

/*In this workbench, Robyn Page and Phil Factor decide to tackle the subject of Matrix handling and Matrix Mathematics in SQL. They maintain that 'One just needs a clear head and think in terms of set-based operations' */

SQL Server Matrix Workbench

Thursday, December 04, 2008

Saturday, November 29, 2008

Report Viewer Redistributable 2008 from 9/9/2008 still does not read 2008 reports??? - TechNet Forums

SQL 2008 launched a few months ago... and left Reporting Services developers in the dust.

Good things will come to those that wait.

The current target date for a control that can read the 2008 RDL schema is currently the first calendar quarter of 2009.  These dates can and are subject to change.

Report Viewer Redistributable 2008 from 9/9/2008 still does not read 2008 reports??? - TechNet Forums

Friday, November 28, 2008

"So, a booth babe and a geek walk in to a bar..." and they get certified.

Notes from a former certification blogger.

I really recommend that you subscribe to Born to Learn.

Ask Ken why it's called Born to Learn, while you're over there.

The first stop for MCP, certification, or exam help continues to be your regional helpdesk: http://www.microsoft.com/learning/support/worldsites.mspx, as you know. The MCP newsletter is still the best, official way to get news about the program and exams: Subscription info. And don't forget the other great bloggers in Microsoft learning--if you get stuck somewhere, check in with one of these people or teams:

While I'm at it, I thought I'd answer some of your other, recent questions, too, in a little Q&A.

"So, a booth babe and a geek walk in to a bar..."

Seven Steps to Certification Success : Training and Certification : Learning : Microsoft Forums

Where to start when dealing with certifications

Before writing this article, I posed a question to many certified individuals. The question I asked was, “What was the hardest part of your certification journey?” You would expect to hear that the hardest part was the exam(s) themselves. However, many people responded that the most difficult challenge was that they simply did not know how or where to start. They would describe how they heard of a certification, bought a book and started studying. There was no research performed, no plan established, and no evaluation afterword to debrief and learn from the experience.

Seven Steps to Certification Success : Training and Certification : Learning : Microsoft Forums

Thursday, November 27, 2008

JAM Software - SpaceObServer - The Hard Disk Space Manager with Database Storage

 

SpaceObServer - The Complete Disk Usage Management Solution

V3.3.2

SpaceObServer is a powerful and flexible hard disk space manager for Windows. It scans local and network drives using a background service and stores their structure, sizes and properties in an SQL database. In an Explorer-like user interface the collected data can be viewed and browsed in hierarchical or tabular views, 3D bar, pie, line charts and tree maps. Using the archived data you are able to track the development of the space usage from past to present, and forecast future size usage. A flexible file search, with predefined searches for very big, old or obsolete files allows filtering and listing files directly from the database. A duplicate file search is also included.

JAM Software - SpaceObServer - The Hard Disk Space Manager with Database Storage

Wednesday, November 26, 2008

Friday, November 21, 2008

TFS & Virtual Machines

 

What to do if you need to roll back \ undo your virtualized client

Use the Force -  To get the server and workspace versions in sync again perform a get using the force option. 

OR

If you are using Hyper-V a better solution is to put your workspace on a drive that is offline to the host OS (Windows 2008) but known to the Hyper-V machine.  You have to disassociate this offline drive from the Hyper-V machine before you do the rollback and re-attach afterwards.  This keeps the rollback from affecting the workspace drive, leaving your workspace files the same. 

Ed Hintz (MSFT)

Download SQL-RD Subscription Free Trial - Schedule SQL Server Reporting Services reports in daily, weekly, monthly etc. A single report in an e-mail, or a batch of...

 

SQL-RD saves time and money by allowing you to schedule and manage MS SQL Reporting Services Reports on numerous servers from a single application. It exports your RS reports to multiple printers, FTP, Secure FTP, email, folders, FAX and SMS. Choose to output to doc, xls, rtf, wk*, dbf, htm, mhtm, pdf and more. Use standard frequencies like daily, weekly, mothly, or set up your own custom calendars and exception calendars. Dynamic schedules provide an unmatched feature for linking and automating reports, data and destinations. It integrates seamlessly with Outlook and Exchange Server. Use Event-Based schedules (triggers) to fully automate your business processes whether they are report-related or not. SQL-RD features a feature-rich intuitive user interface, Folder Housekeeping, Clustering, PDF, PGP, Excel and Zip security, and an NT (Windows) service scheduler. It is fully compatible with SSRS 2000 and SSRS 2005.

Download SQL-RD Subscription Free Trial - Schedule SQL Server Reporting Services reports in daily, weekly, monthly etc. A single report in an e-mail, or a batch of...

Monday, November 17, 2008

Kimberly L. Tripp | Transaction Log VLFs - too many or too few?

 

To have a more ideally sized VLF, consider creating the transaction log in 8GB chunks (8GB, then extend it to 16GB, then extend it to 24GB and so forth) so that the number (and size) of your VLFs is more reasonable (in this case 512MB).

Kimberly L. Tripp | Transaction Log VLFs - too many or too few?

Wednesday, November 12, 2008

Useful Query #1 - find overlapping SQL Agent jobs

 

In SQL 2008 (or using 3rd party tools) you can run this command against multiple servers to determine which SQL Agent jobs overlap.  Perfect for finding contentious jobs...

use msdb
go

with cte  (name, server, run_date,run_time,run_duration,enddate,startdatetime,enddatetime,retries_attempted) as (
select --j.name, h.step_id, h.step_name, h.sql_message_id, h.sql_severity, h.message, run_status,
j.name,server, run_date, run_time, run_duration, run_time + run_duration enddate,

dateadd(hh, run_time / 10000,
            dateadd(mi, (run_time % 10000)/100,
            dateadd(ss, run_time %100,
            cast(cast(run_date as char(8)) as datetime)))) startdatetime,
            dateadd(ss,run_duration,dateadd(hh, run_time / 10000,
            dateadd(mi, (run_time % 10000)/100,
            dateadd(ss, run_time %100,
            cast(cast(run_date as char(8)) as datetime))))) enddatetime,

retries_attempted
from sysjobs j
inner join sysjobhistory h on h.job_id = j.job_id and h.step_id = 1
where run_date > convert(varchar(10),dateadd(d,-1,getdate()),112)
--and run_status <> 1
)
select cte.server, cte.name, cte.startdatetime, cte1.enddatetime, cte.run_duration, cte1.server, cte1.name, cte1.startdatetime, cte1.enddatetime, cte1.run_duration
from cte
cross join cte cte1
where (cte.name <> cte1.name)

and (cte.startdatetime between cte1.startdatetime and cte1.enddatetime
    or cte.enddatetime between cte1.startdatetime and cte1.enddatetime)
    and cte.run_duration > 300

Thursday, November 06, 2008

Carpe Datum - Activity Monitor

Other than hiding Activity Monitor from us in SQL 2008 (it's on the toolbar now) it has some great new features that make the role of a DBA almost obsolete.

Well, not quite, but it does make things much easier.

Install SQL 2008 and you can even run things like Policy Based Management and Activity Monitor (Super 2008 Ed'n) against SQL 2005 & 2000 instances.

My favourite trick is to show query plan on an active query, show missing indexes, then implement.  Instant performance improvements... and here's another way to track performance (or just snoop).

The new Activity Monitor has another trick up its sleeve: If you open it and then expand the first band of information just below the four graphs, you'll see a list of processes that you can order, sort and filter. If you right-click any process, you'll see an option to "open in Profiler". Click that, and you'll open Profiler with a default trace right on that SPID. Very useful to quickly identify the actions of a connection.

Carpe Datum

Legalizing the crack that is Excel spreadmarts – Chris Webb on Project Gemini

There’s nothing wrong with Excel.  Actually, there’s tons of stuff wrong with Excel.  Here is one example of a Spreadmart gone bad.

Excel error leaves Barclays with more Lehman assets than it bargained for

The law firm representing Barclays filed the motion (download PDF) on Friday in U.S. Bankruptcy Court for the Southern District of New York, seeking to exclude 179 Lehman contracts that it said were mistakenly included in the asset purchase agreement. The firm — Cleary Gottlieb Steen & Hamilton LLP — said in the motion that one of its first-year law associates had unknowingly added the contracts when reformatting a spreadsheet in Excel.

Cut-Paste Wealth Destruction! :)

Actually, many of the problems with Excel aren’t really with the product, it’s how it’s used.  “When the only tool you have is a hammer, everything looks like a nail.”  Ditto when the only tools you are comfortable with for dealing with numbers are Excel and Calc.exe, and it takes 2 weeks (or more) for the same report to be built using a “reporting tool” by the IT team…

Chris has some great points that I wholeheartedly agree with.  In the past, I have been responsible for promoting the view of a “single source of total knowledge” or a “one view” of the organization.  Excel doesn’t fit into this picture as a storage mechanism, but it can be the UI, analysis, modeling, and calculation engine that is supported by a central repository stored in the SQL Server cloud (or wherever you may decide to store your data).  Not knowing the details on Project Gemini, I hope that it continues with this theme of server-based storage and client-based analysis, and doesn’t go the way of Coleco Gemini.  I hope that there are options for clients who don’t adopt the latest technologies.  

Spreadsheets have long been one of the most popular ways for corporate users to store and analyze data. But over the past few years, they have played an increasing role in data breaches because workers are apt to store them unsecured on laptops. In addition, hackers have actively tried to exploit vulnerabilities in Excel.

Since I’m a DBA at heart, I’m not comfortable seeing thousands of silos of varying degrees of accurate information multiplying and dividing around a company. With a DBA mindset, it is all about control, security, maintainability, and performance of your data. 

This kind of desktop, DIY BI is in a way similar to illegal drugs: there are always some people that want it, a certain number of them are always going to do it even though they know they shouldn't, so you've got two choices - either legalise it and then hope to control it, as with Gemini, or throw all your efforts into outlawing it.

Chris Webb's BI Blog: Last thoughts on Gemini for the moment

Project Gemini – Microsoft’s Brilliant Trojan Horse

The concept of transferring some of the calculations and aggregations to the client does make sense.  My laptop is more powerful than many of the 5 year old servers in use at some of the client sites I work in.  It would be great to be able to quickly build models without delving into Business Intelligence Studio, SSIS, SSRS & SMS, or asking a developer.  There’s not much faster than memory on a PC, so in-memory processing sounds great to me.  I just hope there’s a way to push out a lockdown mechanism, for when that laptop and its information disappears from the company.

I hope they include a connector to perform calcs inside the GPU too

I like what I see so far with some of the “value-adds” coming out of MS Downloads for Excel like the data mining tools, though in the wrong hands (or even worse, the right hands) the information could be very misleading and lead to disastrous results.  From a marketing and adoption perspective, does it make sense to sell the idea of distributing mass amounts of data down to a client PC?  I’m still waiting on a good forms-based interface to input data from Excel directly into a data repository.  Sort of an InfoPath merged with Excel, without the need to install InfoPath, and with the “always-on” save features from One Note.  Sure, web forms and web services.  What about just Excel to Sql?

Without proper governance and understanding of the technology, publishing to Sharepoint can still lead us to Enterprise Spreadmart solutions and IT maintenance nightmares. 

In my opinion, rather than sheets of 20 million rows of raw data crunched and stored in a spreadsheet on a laptop, file share, or document store, there should be sheets (or something else?) of results available with the data being stored, crunched, and transformed in a central, secure, redundant place (“THE CLOUD?”). I hope that this is the approach Project Gemini will provide.  Magic?

One truth, shared by many, common to one. 

Metadata, semantic web technologies and, yes, Gemini again

Gemini IS Analysis Services

Gemini is Inevitability

Wednesday, November 05, 2008

SPSFAQ – Scalability and the fact that Sharepoint isn’t a database.

Some people seem to think that Microsoft Business Intelligence is Sharepoint.  Sharepoint is one piece to the puzzle, and it can scale, but there are some inherent limits that need to be avoided.  Eli has a few.

The 2,000 rule: because stored procedure calls to SQL Server slow down as you reach 2,000 items, have less than that in a view on a List. Less than 200 ideally to have optimum performance.

SPSFAQ

Speaking of scalability & Microsoft applications… Windows 3.1 is dead.  Long live Windows 3.11.

Microsoft has officially retired Windows 3.1

news.bbc.co.uk — "An application has expectedly quit. Windows 3.x has come to the closing moments of its long life. On 1 November Microsoft stopped issuing licences for the software that made its debut in May 1990 in the US. The various versions of Windows 3.x (including 3.11) released in the early 1990s, were the first of Microsoft's graphical user interfaces .."

http://digg.com/microsoft/Microsoft_has_officially_retired_Windows_3_1

PSS SQL Server Engineers : SQL Server Support in a Hardware Virtualization Environment

 

SQL Server Support in a Hardware Virtualization Environment

There is no doubt that virtualization is a hot and popular topic (the number of questions over email I get daily are a testament to that). Therefore, I think it is important for our customers to understand the support policies from Microsoft regarding SQL Server running in a hardware virtualization environment.

We have just published the following KB article that outlines this policy:

http://support.microsoft.com/?id=956893

PSS SQL Server Engineers : SQL Server Support in a Hardware Virtualization Environment

BeI - Microsoft Business Intelligence

 

Day after day we are working with Cube Browser but when the project or cube designer has closed we lost our query, sometime it takes a long time to reorder again all our dimensions.

This add-in is giving us the ability to save personal views and run it as a new request.

I develop it for SSAS 2005 & 2008 (SSAS 2008 Pre CTP6 with VS 2008).

Download Add-in For SSAS 2005

Download Add-in For SSAS 2008

BeI - Microsoft Business Intelligence