Archive for Business Intelligence

Creating a simple time of day dimension

I needed to cre­ate a really sim­ple time of day dimen­sion the other day, so I thought I’d share my solu­tion. My setup:

  • SQL Server 2008

First off cre­ate the table. This is a basic table, and looks as follows:

CREATE TABLE [dbo].[DimTimeOfDay](
[Dim­Time­Of­DayID] [int] IDENTITY(1,1) NOT NULL,
[Hour] [tinyint] NULL,
[Minute] [tinyint] NULL,
[Name] [varchar](5) NULL,
CONSTRAINT [PK_DimTimeOfDay] PRIMARY KEY CLUSTERED
(
[Dim­Time­Of­DayID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

And now the script to pop­u­late it.

DECLARE @Hour INT

DECLARE @Minute INT

SET @Hour = 0

SET @Minute = 0;

WHILE @Hour < 24

BEGIN

WHILE @Minute < 60

BEGIN

INSERT INTO Dim­Time­Of­Day (Hour, Minute) VALUES (@Hour, @Minute)

SET @Minute = @Minute + 1

END

SET @Minute = 0;

SET @Hour = @Hour + 1

UPDATE Dim­Time­Of­Day SET Name = RIGHT(‘00’ + CAST(Hour AS VARCHAR), 2) + ‘:’ + RIGHT(‘00’ + CAST(Minute AS VARCHAR), 2)

END

Noth­ing ground­break­ing, but per­haps this will save some­one out there a cou­ple of min­utes. Enjoy.

MySQL client ran out of memory

I have been test­ing a num­ber of BI visu­al­iza­tion tools lately, and to do this I decided to use a set of Click­stream data that I have, which is approx­i­mately 6,500,000 rows. When I began load­ing the data into whichever tool I was test­ing I got an error that said “MySQL client ran out of mem­ory”. I am using the MySQL 5.1 ODBC Dri­ver. My con­nec­tion looks as fol­lows.
MySQL Connection
Ini­tially I checked the “Allow big result sets” in the con­nec­tion, how­ever this did not do any­thing. The only solu­tions that worked was to add the “Option=1048576″ to my con­nec­tion string.

SSRS 2008 Deploy Timeout

I have been using SQL Server 2008 for a num­ber of report­ing and ana­lyt­i­cal func­tions in the Be-Mobile plat­form. Most impor­tantly, I have been using SSRS for the daily oper­a­tional site reports. The sys­tem has been up and run­ning for some time now, but about a month ago started giv­ing me seri­ous prob­lems. When I deploy the main report, it sim­ply times out. No error mes­sage is given, sim­ply “The oper­a­tion has timed out”

SSRS 2008 Deploy Timeout

SSRS 2008 Deploy Timeout

I cre­ated a new project to test if it was just an issue with this one report, or if it was a sys­tem wide issue. What I found is that when a report is small and sim­ple, it deploys per­fectly, but as soon as it get a lit­tle bit big­ger or more com­plex it does not deploy.

To resolve the issue I have unin­stalled and rein­stalled SQL Server, and tried it with both SP1 and with­out SP1. Still noth­ing works, and I am unable to deploy reports. I have also encoun­tered a major issue with data dri­ven sub­scrip­tions now, in that the Report Man­ager hangs when try­ing to cre­ate a data dri­ven subscription.

I believe it could be one of two things. Firstly, I am run­ning SQL Server on Win­dows XP, which I do not think is a good idea. I plan to upgrade to Win­dows Server to see if that resolves the issue. Sec­ondly my data source is a MySQL data­base, and I believe that that could be caus­ing prob­lems too. Should the upgrade to Win­dows Server not help, my next step will be to load the data into SQL Server for report­ing purposes.

I have not found any­thing on the web that has helped me, and if any­one has any ideas I would be very very grateful.

Can’t connect to MySQL server on…

I recently encoun­tered a prob­lem with a fresh MySQL install, whereby I could not con­nect to the server from a remote machine. After some dig­ging I found that there are a num­ber of things that you need to do to allow remote connections.

  1. Allow remote con­nec­tions in the my.conf. On *nix instal­la­tions this is usu­ally sit­u­ated in /etc or /etc/mysql. There is a line that says bind-address = 127.0.0.1. This is basi­cally say­ing that it will only lis­ten for con­nec­tions on the local­host. Com­ment this line out with a #
  2. Restart MySQL. /etc/init.d/mysql restart
  3. Grant per­mis­sions. To grant per­mis­sions to all data­bases for a par­tic­u­lar user on your net­work for exam­ple, you would use grant all priv­i­leges on *.* to username@”%” iden­ti­fied by “pass­word”; This says that the user user­name, on all remote hosts (iden­ti­fied by the %) will be granted access.

Open Source BI

For a long while now I have been of the opin­ion that open source busi­ness intel­li­gence is reach­ing crit­i­cal mass. The soft­ware is get­ting a lot bet­ter, and peo­ple look for viable solu­tions to replace the often expen­sive pro­pri­etary offerings.

It was very encour­ag­ing for me to read Chris Webb’s blog where he expressed very much the same opin­ion.

With the worlds econ­omy as it is I believe it is only a mat­ter of time before open source BI gets the recog­ni­tion it deserves.