Tuesday, August 25, 2009

New class on 2780B

I started another class for course 2780B - Maintaining a Microsoft SQL Server 2005 database. Though I wanted to do this on 2008 (6231A), this has been selected by the institute for participants because most of them are using 2005. In a way, it is good, because, doing another class on 2008 (6231A). Doing three classes per week is bit difficult, but I like it, getting more invitations, planing to have more classes.... this might stop me, attaching permanent to a company.

Monday, August 17, 2009

Microsoft XPS Document Writer cannot be found

I am experiencing this error with Microsoft PowerPoint 2007, when the hibernated machine which had PowerPoint presentation opened, is started. Searched for a solution but no luck so far, and many face this it seems. Anyone know the solution?

Sunday, August 16, 2009

Are you using "Windows Services window" for changing the SQL Server Service Account?

If you are using the "Windows Services" window for changing the assigned account for SQL Server service, you may face some problems later. When required, we should use SQL Server Configuration Manager, instead Windows Services because the Configuration Manager performs required operations such as configuring SQL Server related configurations, re-generating Service Master Key and decrypts and encrypts all objects that had been encrypted by Service Master Key. If you do not use Configuration Manager, you need to execute ALTER SERVICE MASTER KEY statement manually for completing the operation.

Monday, August 10, 2009

PerformancePoint error: Unable to connect to Server - Part II

Once I blogged about this error with this link. Today I faced the same, but the reason was different. My new machine is installed with Vista-Ultimate 64-bit. I started installing all the prerequtities for PerformancePoint, did everything. Once installed, tried to connect to http://localhost:40000/WebService/PmService.asmx through Dashboard Designer (Options box), but no luck. It gave an error saying "You have not admin privileges.". I had logged in as "Dinesh" and the account "Dinesh" is in Administrators group. I made sure again, that "Dinesh" is in Administrators group and "Dinesh" has permissions for the PerformancePoint web service too. I still do not know, why "Dinesh" could not make the connection..... he is in the Administrator group. I solved the problem by logging to the system as an Administrator. Once logged in, I was able to connect and then I used the "Permission" box for adding "Dinesh" as an Admin to the PerformancePoint. When I log in with "Dinesh" now, it allows to make the connection now. I think, by default, Administrator is added as the Admin of the PerformancePoint, so, he is the only person who can give permission to others. Keep this in mind, if you use some other account without using Administrator.

Saturday, August 8, 2009

Connecting to Analysis Services with the Port Number

First of all, let me tell you that why I need to connect to Analysis Services with the Port number; because the Analysis Services 2008 is running as a named instance and SQL Server Brower needs to be disabled as a security measure. Why do we need SQL Server Browser Services? By default, Analysis Services uses the port 2383. When you connect to the default instance (in my case, it is 2005), it connects to the SSAS without any problems, even though you have not specified the port with the connection string. If you try to connect to a named instance of Analysis Services (again, in my case, it is 2008), without specifying the port, you will still be able to connect, as long as the SQL Server Browser is running. Named instances of the SSAS use port numbers that are dynamically assigned, therefore they are varies. When you restart the service, it assigns a new one. Assigned port number can be seen with msmdredir.ini file in the C:\Program Files (x86)\Microsoft SQL Server\90\Shared\ASConfig folder. Though we do not specify the port in the connection string (even with SSMS), SQL Server Browser handles the request and directs us to the correct instance, because it knows the port numbers assigned. Now my issue was, unavailability of SQL Server Browser hence cannot connect to the named instance. When we try to connect to the named instance with SSMS or BIDS, it says that Browser is not running. Since the Browser cannot be enabled (as a security measure), all we have to do is, find the port number (from the ini file specified above) and specify with the connection string. One thing you have to remember is, when specifying, it should be {MachineName}:{PortNumber}, NOT like {InstanceName}:{PortNumber}. If my machine name is DINESH-PC and named instance is SQL2008; When connecting to the default instance: DINESH-PC:2383 When connecting to the named instance: DINESH-PC:50019, NOT DINESH-PC\SQL2008:50019 If need to fix a port number, use the ini file or Port property in Analysis Services, for changing.

Wednesday, August 5, 2009

Foreign Keys with TinyInt do not recongnize by SSAS

This is still there, with SQL Server 2008 too. I usually use TinyInt for tables' primary key when the number of records to be held are less than hundred, so applied the same rule for my newest Data Warehousing project, completely forgetting the fact that Analysis Services cannot recognize the relationships between Fact and Dimensions that have TinyInt as the primary key. As usual, had to change all my Dimensions tables, changing primary keys to Smallint. Remember this, if you are designing a data warehouse.

Restoring one File Group

Today, I came across a situation where I had to explain the FILEGROUP restore of SQL Server. Since I have not done this for a long time, I brushed my knowledge with Preethi's help and thought to blog it too. If you have a database that has more than one file group, you may face to a situation where you need to restore only one file group, without restoring the entire database, saving time. One thing we have to remember is, secondary file group (or file) restore needs Primary file group restore. If your Primary file group contains a lot of tables, again, it takes time for restore operation (Usually, database that contains secondary file groups does not use primary for user-defined tables). So, make sure that you do not use Primary file group for your tables. Here is an example: Assume that we have a database that has three file group: Primary, FG1, and FG2. In order to restore file groups, you should have backups of all file groups (both full and differential are possible). Here are steps for restoring a file group (FG1); -- Backup tail-log if require BACKUP LOG MyDatabase TO DISK = 'D:\Backups\TailLog.bak' WITH NO_TRUNCATE, NORECOVERY -- Restore the Primary file group RESTORE DATABASE MyDatabase FILEGROUP = 'Primary' TO DISK = 'D:\Backups\MyDatabase_FG1.bak' WITH NORECOVERY -- Restore the FG1 file group RESTORE DATABASE MyDatabase FILEGROUP = 'FG1' TO DISK = 'D:\Backups\MyDatabase_FG1.bak' WITH NORECOVERY -- Restore the log (if need, can be restored to a specific time) RESTORE LOG MyDatabase FROM DISK = 'D:\Backups\TailLog.bak' WITH RECOVERY

Thursday, July 16, 2009

Was really busy

Had no time to update my blog for few weeks, was really busy with work: - New BI project: This is for one of the leading banks in Sri Lanka. This is the first time I am engaging with banking industry, in terms of BI. Lot of things to learn, really interesting. - New set of SQL Server questions: It is almost done, this is the third time I involved with questions making. I have already written questions to two Microsoft SQL Server 2008 exams and this is for, again Microsoft but not for MS certifications. Anyway, all questions have been reviewed, seems they are happy with my questions :). - New SQL Server 2005 batch: Done. Conducted another class for developers. Students were good, though there were gaps in knowledge levels. - New SQL Server 2008 batch: Really interesting, this is my first SQL Server 2008 class. Participants are really good, lot of questions. This course is bit different, have not taught Maintaining SQL Server course (6231A) before. I am not much comfortable with the official materials, seems course book is not so rich and found some mistakes too, anyway it is too early to make comments on it.

Wednesday, May 27, 2009

Another victory of Sri Lanka

This clearly shows the reality, this shows who wants to destroy the great country, Sri Lanka. Sri Lanka won again, defeating the international terror. How they voted at the UNHRC sessions Victory for Lanka’s fight against terrorism

Thursday, May 21, 2009

PerformancePoint error: Unable to connect to Server

Are you experiencing this? You might. There are different set of connection related errors with PerformancePoint 2007. If you get errors like "Unable to connect to the specified server. Make sure the address is correct" or "The PerformancePoint could not connect to the specified data source", most probably, you will find the solution here. If you face for an error like "Unable to connect to Server" with PerformancePoint dashboard designer options, the reason might be the unavailability of AJAX 1.0. Solution is here. It has another solution but installing AJAX fixed my problem.

Wednesday, May 20, 2009

Skipping prerequisities when installing PerformancePoint 2007 SP2

While installing the SP2 of PerformancePoint 2007, you may get an error like; Failed package requirement analysis, please refer to the log file for more information. This can be avoided by setting the SKIPREQCHECK as true with msiexec command. But you have remember one thing, when we install the product we use i switch but p switch has to be used when installing service packs. Please see the code below; Installing the product, skipping the prerequisites; msiexec /i PSCSrv.msi SKIPREQCHECK=1 Installing the service pack, skipping the prerequisities; msiexec /p PSCSrv.msi SKIPREQCHECK=1

Tuesday, May 19, 2009

Installing PerformancePoint 2007 SP2

If you are using PerformancePoint 2007 and you have not installed the SP2, then this is the time for installing it. As you know, it did not support natively for SQL Server 2008, and now it allows. You will be installing this SP2 under three scenarios; 1. Update PerformancePoint Server with SP2 only. No changes to SQL Server 2005. 2. Update SQL Server 2005 to SQL Server 2008 and then update PerformancePoint Server to SP2. 3. Install PerformancePoint Server RTM and SQL Server 2008 in a new environment. You need to make sure that you follow the correct steps for whatever the scenario you select. You can find the instruction for all scenarios here. You can download the SP2 from here(x86) and here(x64).

Monday, May 18, 2009

Sri Lanka is free from Terror

After 30 years, His Excellency Mahinda Rajapakse, President of Sri Lanka has freed the country from LTTE terror, keeping his word. How fortunate we are? My gratitude to President and victorious armed forces.

Saturday, February 28, 2009

Another BI workshop

This is the first workshop organized by IronOne Technologies. It was started on last Thursday and will continue till this Tuesday. I feel bit tired because it is very difficult to keep on talking :), without a partner. Almost all workshops that were organized before, were done by Gogula and me, hence work was shared, doing it alone is a very difficult task. Audience of the workshop is really good, some have work on BI related projects too. Everybody exposes an average knowledge, hence it is not so difficult to run the workshop.

Thursday, February 12, 2009

How to distinguish between measures and KPIs…

As you all know, measures are identified at the analysis stage of Data Warehouse/BI project. Are all identified measures KPIs? This question came up, while we were having a discussion on one of our new projects. It was an interesting question, thought to make a post on it, showing what I think, what I have read… In a way, yes, we can consider all measures as KPIs. But they become proper KPIs when it shows the quality of the value, health of the value. This requires another attribute to be attached: Let’s take an example, Sales Amount, obviously it is a measure. It shows the sales amount for some dimensions (for current year, for a product). Does it show the health of that value, whether it is good or bad? No, it is just a value. Important thing to remember is, KPI is not just a value, it indicates the health of the value too. So, if we need to make Sales Amount as a KPI, we need to use another attribute such as Target. Target value allows to judge the Sales Amount whether it is healthier or not, hence Sales Amount becomes a KPI. That’s how I see the difference between a measure and a KPI? Am I right? Any thoughts on this?

Wednesday, February 4, 2009

Is your architecture leading to Stovepipe data mart?

Question arose while we were discussing BI. I asked myself, whats the hell is "Stovepipe" data mart, I was aware of the word but picture behind it, did not come to my mind immediately. So, brushed up.... Stovepipe data marts are nothing but data marts that prevent integration of themselves for making a data warehouse because of the unavailability of conformed dimensions. In most cases, data marts (dimensions in data marts) are designed with their own rules, policies and mainly own structures. This results incompatible dimensions in different data marts though they represent same entity. It will be a mess, will be awkward situation when it comes for making a data warehouse, combining all data marts. Though data marts have many advantages, cost-wise, time-wise, etc.. this is the major disadvantage of them. Are you leading to a Stovepipe data mart?

Sunday, February 1, 2009

SSRS 2008 Video: Formatting text blocks individually in a single textbox

This is my first video, had been planning for months, and somehow was able to do one. I do not know whether the quality of this lesson is okay, because I made many mistakes while recording, this is my 8th or 9th recording :). This shows one of the newest features of Reporting Services 2008. Reporting Services 2005 did not allow us to format text blocks in a textbox with different styles. Now it is possible. Watch the video and see whether it is useful. Appreciate your comments on this.

Friday, January 30, 2009

REPEATABLE READ is fine, but want to let others to read non-locked records

We usually set the REPEATABLE READ Transaction Isolation Level in order to overcome Inconsistent analysis (nonrepeatable read) and Lost Update concurrency problems. This level do not let other users to read records that are read by your transaction, but creates a deadlock situation. Here is a simple example;
   1: SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
   2: BEGIN TRAN
   3:     DECLARE @Id int
   4:     SELECT TOP 1 @Id = Id
   5:     FROM dbo.Employee
   6:     WHERE IsUpdated = 0
   7:  
   8:     ......... -- more processing
   9:  
  10:     UPDATE dbo.Employee
  11:         SET Info = 'some text', IsUpdated = 1
  12:     WHERE Id = @Id
  13: COMMIT TRAN 
This code gets the first record available for updating (TOP 1, IsUpdated = 0) and does some processing, finally updates the record. This code does not allow others to modify the record while it is being accessed, avoiding inconsistent analysis and lost updates. But it reduces the concurrency. It does not allow other to get the second available record too, making a deadlock situation if the same is executed by another connection. There is no harm of letting others to access the second available record. How do we do it? This cannot be implemented with REPEATABLE READ isolation level. All we have to do is, use UPDLOCK and READPAST query hints. UPLOCK puts exclusive lock on the object and does not allow others to obtain a lock on the same. READPAST skips all locked records and read the non-locked records. Here is the corrected code;
   1: -- SET TRANSACTION ISOLATION LEVEL REPEATABLE READ
   2: BEGIN TRAN
   3:     DECLARE @Id int
   4:     SELECT TOP 1 @Id = Id
   5:     FROM dbo.Employee
   6:     WITH (UPDLOCK, READPAST)
   7:     WHERE IsUpdated = 0
   8:  
   9:     ......... -- more processing
  10:  
  11:     UPDATE dbo.Employee
  12:         SET Info = 'some text', IsUpdated = 1
  13:     WHERE Id = @Id
  14: COMMIT TRAN 
This locks the record while it is being accessed but allows to process the next available record for others.

Friday, January 23, 2009

Reporting Services 2008 Error: The underlying connection was closed. An unexpected error occured on a send.

It hit me again. This does not allow you to deploy any reports or open report manager via the browser. This is because of the invalid configuration in reportserver.config file. The default value of the key SecureConnectionLevel has been set as 2, which requires SSL configuration. If you do not use SSL, make it as 0, making service least secure. Refer BOL for more info.

Reporting Services 2008 Error: Invalid namespace

This error comes when we try to configure Reporting Services 2008 with Reporting Services Configuration Manager. The reason for this is funny and identified as a known issue; It checks for wrong instance name. This has been fixed with the Cumulative Update Package 3. If you are unable to download, another method has been given with this which I used. It gives instructions for changing the reportingservices.mof file.

SQL 2008 Launch, Kandy: Few more pohotos

Doing my presentation.
Giving a prize to a winner.
All prize grabbers.
SQL Server crew

Monday, January 12, 2009

Sucess of Community Launch of MS SQL Server 2008, in Kandy

I am proud to announce that the SQL Server 2008 Community Launch, Kandy took place in grand scale. This was organized with some great difficulties, however we managed to make the event as a success event. Targeted audience was 100 and there were 90-odd participants. All participants were delighted and almost all appreciated the event. Following the agenda, Gogula delivered the KeyNote and Introduction to SQL Server 2008. Dinesh Asanka's presentation was the next one which was on developer track. Preethi did the third presentation, again it was on developer track, finally I did a presentation on BI. In addition to that Dinesh Asanka showed a presentation that spoke about red-gate tools. I did not get all photos for the event, once I have, we will publish on SQLServerUniverse.Com. I must thank to following companies, individual for making the event success; Gogula Aryalingam - This was his idea and credit must go to him. Dinesh Asanka - Did a fantastic job, not only delivering job, helping from start to end. Preethi - He was with us since we were planing, just like Dinesh Asanka and did a great job too. Wela (Microsoft Sri Lanka) - Supported us providing financial support, where we were in great difficulty. Rachel (RedGate software) - Supported us sending a package of goodies for delivering. It helped us very well. Akalanka (Peradani University) - Helped us to organized the event at the campus. Shamri (ESoft, Kandy) - Supported us by giving 30% discount vouchers on MS courses for all participants. L. H. Event Management - Supported the event by organizing the lunch. It was a great buffet :). And all participants - We would not be able to make this is as a success event without you guys. We will be doing the Colombo event soon. Though it was scheduled for this month, since we have some financial issues to be sorted out, we had put it off. Here are some pictures; At registration: Everybody got a SQLServerUniverse.Com pen, 30% discount voucher and a SQL Server 2008 file. Part of the audiance - just before starting the event During lunch time Phots of sessions and other activities will be published soon.

Sunday, January 4, 2009

Separating batches using a new word, instead of “GO”.

Can we use a different word instead of GO? Yes, it is possible because GO is not a T-SQL statement; it is a command that is recognized as a batch separator by client tools such as Management Studio and sqlcmd. Unfortunately most are unaware of this and consider it is as a T-SQL statement. If you need to use a new word with your management studio, follow these steps; Open Options window (Tools -> Options). Expand and select the node Query Execution -> SQL Server -> General. Find an option called Batch Separator. Set a new value as you want. Done. Now you can use the new word instead of GO. You may face for a problem if you execute the code in a different Management Studio. Because of that, the word GO is preferred and recommended but remember the fact; it is not a T-SQL statement.

Community Launch of MS SQL Server 2008, in Kandy

We, SQL Server MVPs are organizing Community Launch of SQL Server 2008, next week in Kandy and 4th week of January in Colombo with the support of Microsoft Sri Lanka, Red-gate and SQLServerUniverse. SQL Server MVPs (Dinesh Asanka, Gogula and me) and Preethi (One of experienced DBA with vast knowledge) will be delivering; What's new in SQL Server 2008. If you are in Kandy, join with us.

Thursday, January 1, 2009

MVP again

Microsoft MVP award team has decided keep my MVP title for another year. Thanks Microsoft award team, Microsoft Sri Lanka, Lead Lilian Quek for re-awarding me.