Showing posts with label ssas. Show all posts
Showing posts with label ssas. Show all posts

Sunday, March 25, 2012

Analysis Service Manager

I give up, how do you start the Analysis Manager? SSAS is installed and running, but I just can't seem to find the button/shortcut/whatever to start the manager.

If you are using SSAS 2005, you should use SQL Server Management Studio and connect to Analysis Services to view server objects

For development, you will have to use BIDS (BI development studio - Visual studio 2005)

|||Thanks, but how do I get to a 2K database?|||If u r using AS 2000, then I guess it would be better to use Analysis Manager. It should be under Programs ==> Microsoft SQL Server.|||I have to support both 2000 (legacy) and 2005 AS. However, I can't have both Services installed at the same time, which is why I'm trying to use SSAS 2005.|||

You can have both services installed at the same time.

You have to install AS2k as the default (unnamed instance) as it does not support named instances.

You then install AS2k5 as a named instance, on my machine I have it setup as localhost\SQL05. But you still need both sets of admin tools Analysis Manager for AS2k and Management Studio and BI Dev Studio for AS2k5. You cannot administer both versions from a single tool.

sql

Analysis Server database stop responding...

Hi, everyone, I'm new in SSAS... Yesterday I mapped a new hierachy to a perspective and then the database died... I tried to connect to it in Visual Studio and open it in Management Studio, however, neither responsed, then the delay notification appeared... Database engine and analysis service are alright, the tables are quite small (less then 50MB).

Dose anyone have ideas about this? Thanks a lot.

The version of my SQL Server is 9.00.2047.00, runs on Windows 2003 Server SP1.

Suspect your data got corrupted somehow.

Try stopping Analysis Server. Delete files from the database folder in the Analysis Server data folder.

Then start the server again and try re-deploying the project again.

Edward Melomed.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Ed:

Thanks for your reply. I think I've found the reason. This is not caused by my modifications on the SSAS db, one of our databases grew too fast and makes the server running slowly, our DBA has solved this problem.

regards,

Sunday, March 11, 2012

An error was encountered in the transport layer

I am fairly new to SSAS 2005. I have just created one cube. I was able to create an Excel pivot table that connected to this cube and had all the funtionality that I expected. I then published the pivot table as a web page. When I view the web page on the server where SQL 2005 is loaded the web page comes up with all of the expected functionality. But when I try to view the web page from another computer on my network I gett the error

The query could not be processed:

An error was encounted in the transport layer

The peer prematurely closed the connection.

Any suggestions on how to proceed.

Even though this is a web page, the page actually contains an ActiveX pivot table control which executes on the client machine. The client machines will need to have the OLEDB provider for SSAS 2005 installed in order to connect to SSAS 2005. You can download the "Microsoft SQL Server 2005 Analysis Services 9.0 OLE DB Provider " from the feature pack download page (about half way down) at http://www.microsoft.com/downloads/details.aspx?FamilyID=df0ba5aa-b4bd-4705-aa0a-b477ba72a9cb&DisplayLang=en

If this still does not help, there is a great article on troubleshooting connectivity issues with SSAS at http://sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

|||I've loaded SSAS OLE DB 9.0. I've allowed anonymous users and I still get the error. Any other suggestions.|||Trying using the domain name in front of your user name (domain\username)|||

You could try tracing the SSAS server while you try to connect to see if there are any error events that appear.

The following thread from the newsgroup might also provide some ideas:

http://groups.google.com/group/microsoft.public.sqlserver.olap/browse_frm/thread/fda9edcc5cabaaa6/ae553b59c97dd4b5?lnk=st&q=&rnum=7#ae553b59c97dd4b5

|||

Hi,

I'm having a similar problem except it's less consistent (*sigh*). The situation: I have SSAS 2005 running on a non-domain machine (it's a test setup) along with Project Server 2007. I then have a few client machines I'm trying to connect with. The hitch is that one of them is able to connect with any method I try (.udl file, Excel PivotTable, or the Data Analysis Web components in the Project Server) - in SQL Server Profiler, I see the correct NTUserName appear (I have a couple of users created on the server). However, when I try to connect with another machine using Data Analysis components with IE7, I get the error "An error was encountered in the transport layer." and "The peer prematurely closed the connection."; the profiler shows the NTUserName is "Anonymous", yet I'm using the same user credentials. To make things interesting, on the problem machine, I can successfully connect using the .udl file method and Excel (the NTUserName is correct). Just for completeness, I have no problems when trying to connect locally from the server.

I'm reasonably sure the settings for Internet Explorer are correct and that I have the correct components installed (like OLE DB Provider for Analysis Services 9.0) otherwise no method would work. I'm just not sure why the user credentials are making it okay from one machine and not the other (and from different methods, to boot). Just for funsies, I enabled Anonymous access to SSAS but that had no difference. For reference, the machine that works is Vista and the machine that does not is XP SP2. Both machines are fully patched.

I have tried the suggestions in both of these following Web pages (and a variety of other postings) to no avail:

http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/cisql2005ascs.mspx

and

http://sqljunkies.com/WebLog/edwardm/

Other things:

The firewall on the server is off "Access data sources across domains" is enabled (IE option) "Automatic logon with current user name and password" is enabled in all browsers I try (IE option)

An error was encountered in the transport layer

I am fairly new to SSAS 2005. I have just created one cube. I was able to create an Excel pivot table that connected to this cube and had all the funtionality that I expected. I then published the pivot table as a web page. When I view the web page on the server where SQL 2005 is loaded the web page comes up with all of the expected functionality. But when I try to view the web page from another computer on my network I gett the error

The query could not be processed:

An error was encounted in the transport layer

The peer prematurely closed the connection.

Any suggestions on how to proceed.

Even though this is a web page, the page actually contains an ActiveX pivot table control which executes on the client machine. The client machines will need to have the OLEDB provider for SSAS 2005 installed in order to connect to SSAS 2005. You can download the "Microsoft SQL Server 2005 Analysis Services 9.0 OLE DB Provider " from the feature pack download page (about half way down) at http://www.microsoft.com/downloads/details.aspx?FamilyID=df0ba5aa-b4bd-4705-aa0a-b477ba72a9cb&DisplayLang=en

If this still does not help, there is a great article on troubleshooting connectivity issues with SSAS at http://sqljunkies.com/WebLog/edwardm/archive/2006/05/26/21447.aspx

|||I've loaded SSAS OLE DB 9.0. I've allowed anonymous users and I still get the error. Any other suggestions.|||Trying using the domain name in front of your user name (domain\username)|||

You could try tracing the SSAS server while you try to connect to see if there are any error events that appear.

The following thread from the newsgroup might also provide some ideas:

http://groups.google.com/group/microsoft.public.sqlserver.olap/browse_frm/thread/fda9edcc5cabaaa6/ae553b59c97dd4b5?lnk=st&q=&rnum=7#ae553b59c97dd4b5

|||

Hi,

I'm having a similar problem except it's less consistent (*sigh*). The situation: I have SSAS 2005 running on a non-domain machine (it's a test setup) along with Project Server 2007. I then have a few client machines I'm trying to connect with. The hitch is that one of them is able to connect with any method I try (.udl file, Excel PivotTable, or the Data Analysis Web components in the Project Server) - in SQL Server Profiler, I see the correct NTUserName appear (I have a couple of users created on the server). However, when I try to connect with another machine using Data Analysis components with IE7, I get the error "An error was encountered in the transport layer." and "The peer prematurely closed the connection."; the profiler shows the NTUserName is "Anonymous", yet I'm using the same user credentials. To make things interesting, on the problem machine, I can successfully connect using the .udl file method and Excel (the NTUserName is correct). Just for completeness, I have no problems when trying to connect locally from the server.

I'm reasonably sure the settings for Internet Explorer are correct and that I have the correct components installed (like OLE DB Provider for Analysis Services 9.0) otherwise no method would work. I'm just not sure why the user credentials are making it okay from one machine and not the other (and from different methods, to boot). Just for funsies, I enabled Anonymous access to SSAS but that had no difference. For reference, the machine that works is Vista and the machine that does not is XP SP2. Both machines are fully patched.

I have tried the suggestions in both of these following Web pages (and a variety of other postings) to no avail:

http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/cisql2005ascs.mspx

and

http://sqljunkies.com/WebLog/edwardm/

Other things:

The firewall on the server is off

"Access data sources across domains" is enabled (IE option)

"Automatic logon with current user name and password" is enabled in all browsers I try (IE option)

Friday, February 24, 2012

AMO "Scripter" Class - Help

Has anyone ever used Microsoft.AnalysisServices.Scripter class to programtically script SSAS objects? I am looking for a little bit of sample code to get me started. My goal here is to script some of the SSAS objects out into XML and store the XML in a table that can be queried to produce some meta data reports. I plan on doing this using AMO inside of a Script Task of a SSIS package.

So here are my two main questions:

    Can anyone provide me with some sample code (I am not that good with .NET) using the Scripter class to script an SSAS object? Can anyone tell me a better way to build reports based on the meta data of my SSAS objects?

Thank you in advance!

Here is some sample code to use Scripter to script Alter command for your database into a file. You can later have SSIS to load content of the file into a table.

using Microsoft.AnalysisServices;

........

XmlTextWriter xmlwrite = new XmlTextWriter( "MyDatabase.XMLA", System.Text.Encoding.UTF8);

xmlwrite.Formatting = Formatting.Indented;

xmlwrite.Indentation = 2;

Scripter.WriteAlter(xmlwrite, myDataBase, true, true);

xmlwrite.Close();

|||

Edward,

Thanks for the code sample. This should do the trick. However, I have one more follow up question for you. How do I write the XML into a String variabe instead of to a file? Thanks again.

|||

Take a look at the functionality provided to you by XMLTextWriter.

http://msdn2.microsoft.com/en-us/system.xml.xmltextwriter.aspx

You shoudl be able to use different constructor for it.Search for sample of using XMLTextWriter.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Edward,

Thanks again for the help. Here is the code that I came up with, it is in VB.NET and will work inside of a SSIS Script Task. It should help anyone trying to do the same thing. Thanks you for your help on this one.

' Microsoft SQL Server Integration Services Script Task

' Write scripts using Microsoft Visual Basic

' The ScriptMain class is the entry point of the Script Task.

Imports System

Imports System.IO

Imports System.Data

Imports System.Math

Imports System.Xml

Imports System.Data.SqlClient

Imports Microsoft.SqlServer.Dts.Runtime

Imports Microsoft.AnalysisServices

Class ScriptMain

Public Sub Main()

' Get Server and Database name from DTS connection object

Dim oDTSASConnection As ConnectionManager = Dts.Connections("AS Server")

Dim sASServer As String = CStr(oDTSASConnection.Properties("ServerName").GetValue(oDTSASConnection))

Dim oASServer As New Microsoft.AnalysisServices.Server

' Connect to the requested server

oASServer.Connect(sASServer)

' Loop trough all of the dbs on the server and write xmla to db

Dim oASDatabase As New Microsoft.AnalysisServices.Database

For Each oASDatabase In oASServer.Databases

Call ScriptASDatabase(oASServer, oASDatabase)

'' Loop trough all of the cubes in the db and write xmla to db

Dim oASCube As New Microsoft.AnalysisServices.Cube

For Each oASCube In oASDatabase.Cubes

Call ScriptASCube(oASServer, oASDatabase, oASCube)

Next

' Loop trough all of the dimensions in the db and write xmla to db

Dim oASDim As New Microsoft.AnalysisServices.Dimension

For Each oASDim In oASDatabase.Dimensions

Call ScriptASDim(oASServer, oASDatabase, oASDim)

Next

Next

' Clean Up

oASServer.Disconnect()

Dts.TaskResult = Dts.Results.Success

End Sub

Public Sub ScriptASDatabase(ByVal oASServer As Microsoft.AnalysisServices.Server, ByVal oASDatabase As Microsoft.AnalysisServices.Database)

' Create wrtiters and set formating for xml

Dim stringWriter As New System.IO.StringWriter()

Dim xmlWriter As New System.Xml.XmlTextWriter(stringWriter)

xmlWriter.Formatting = Formatting.Indented

xmlWriter.Indentation = 2

Dim sXMLA As String

' Script dbs on the server and write to db

Scripter.WriteCreate(xmlWriter, oASServer, oASDatabase, False, False)

sXMLA = stringWriter.ToString

Call DBUpsert(oASServer.Name.ToString, oASDatabase.Name.ToString, oASDatabase.Name.ToString, oASDatabase.ID.ToString, oASDatabase.ID.ToString, "Database", sXMLA.ToString)

' Clean Up

stringWriter.Close()

xmlWriter.Close()

End Sub

Public Sub ScriptASCube(ByVal oASServer As Microsoft.AnalysisServices.Server, ByVal oASDatabase As Microsoft.AnalysisServices.Database, ByVal oASCube As Microsoft.AnalysisServices.Cube)

'Create wrtiters and set formating for xml

Dim stringWriter As New System.IO.StringWriter()

Dim xmlWriter As New System.Xml.XmlTextWriter(stringWriter)

xmlWriter.Formatting = Formatting.Indented

xmlWriter.Indentation = 2

Dim sXMLA As String

' Script cubes in the db and write to db

Scripter.WriteCreate(xmlWriter, oASDatabase, oASCube, False, False)

sXMLA = stringWriter.ToString

Call DBUpsert(oASServer.Name.ToString, oASDatabase.Name.ToString, oASCube.Name.ToString, oASCube.ID.ToString, oASCube.Parent.ID.ToString, "Cube", sXMLA.ToString)

' Clean Up

stringWriter.Close()

xmlWriter.Close()

End Sub

Public Sub ScriptASDim(ByVal oASServer As Microsoft.AnalysisServices.Server, ByVal oASDatabase As Microsoft.AnalysisServices.Database, ByVal oASDim As Microsoft.AnalysisServices.Dimension)

'Create wrtiters and set formating for xml

Dim stringWriter As New System.IO.StringWriter()

Dim xmlWriter As New System.Xml.XmlTextWriter(stringWriter)

xmlWriter.Formatting = Formatting.Indented

xmlWriter.Indentation = 2

Dim sXMLA As String

' Script cubes in the db and write to db

Scripter.WriteCreate(xmlWriter, oASDatabase, oASDim, True, False)

sXMLA = stringWriter.ToString

Call DBUpsert(oASServer.Name.ToString, oASDatabase.Name.ToString, oASDim.Name.ToString, oASDim.ID.ToString, oASDim.Parent.ID.ToString, "Dimension", sXMLA.ToString)

' Clean Up

stringWriter.Close()

xmlWriter.Close()

End Sub

Public Sub DBUpsert(ByVal sASServer As String, ByVal sASDatabase As String, ByVal sASName As String, ByVal sID As String, ByVal sParentID As String, ByVal sObjectType As String, ByVal sXMLA As String)

' Create a connection to the db

Dim oDTSDBConnection As Microsoft.SqlServer.Dts.Runtime.ConnectionManager = Dts.Connections("Local.MetaData")

Dim sDBServer As String = CStr(oDTSDBConnection.Properties("ServerName").GetValue(oDTSDBConnection))

Dim sDBDatabase As String = CStr(oDTSDBConnection.Properties("InitialCatalog").GetValue(oDTSDBConnection))

Dim oBuilder As New SqlConnectionStringBuilder()

oBuilder.DataSource = sDBServer

oBuilder.InitialCatalog = sDBDatabase

oBuilder.ConnectTimeout = 1000

oBuilder.IntegratedSecurity = True

oBuilder.ApplicationName = "ImportSSASXml"

Dim oDBConnection As New SqlConnection(oBuilder.ConnectionString.ToString)

' Create Sql Command

Dim cmd As New SqlCommand("dbo.etl_ImportSSASXml", oDBConnection)

cmd.CommandTimeout = 60

cmd.Connection = oDBConnection

cmd.CommandType = CommandType.StoredProcedure

' Add parameters and their values

cmd.Parameters.Add(New SqlParameter("@.Server", SqlDbType.VarChar, 255)).Value = sASServer

cmd.Parameters.Add(New SqlParameter("@.Database", SqlDbType.VarChar, 255)).Value = sASDatabase

cmd.Parameters.Add(New SqlParameter("@.Name", SqlDbType.VarChar, 255)).Value = sASName

cmd.Parameters.Add(New SqlParameter("@.ID", SqlDbType.VarChar, 255)).Value = sID

cmd.Parameters.Add(New SqlParameter("@.ParentID", SqlDbType.VarChar, 255)).Value = sParentID

cmd.Parameters.Add(New SqlParameter("@.ObjectType", SqlDbType.VarChar, 255)).Value = sObjectType

cmd.Parameters.Add(New SqlParameter("@.XMLA", SqlDbType.VarChar)).Value = sXMLA

' Open the connection

oDBConnection.Open()

' Execute the command

cmd.ExecuteNonQuery()

' Clean Up

oDBConnection.Close()

End Sub

End Class

I will be posting a comprehensive solution to building meta data reports on/about ones' SSAS objects on my blog in the next few weeks. Check it out if you are interested!

Sunday, February 19, 2012

AMO - Dimension Size?

Hello Folks,

I've started to write an AMO application to get information relevant to DBA's out of our SSAS databases.

I've successfully got the estimated sizes for Cubes, MeasureGroups and individual partitions nicely listed.

However, i'm having trouble because i can't seem to find a property of the Dimension object that will give me the size.

The reason i'm doing this is because i've read that you need to watch the size (and memory consumption) of these babies.

How do i do this in AMO? Or any other means!

Many thanks.

Kyle (DBA)

First, if you aren't already using the AMO browser, then you should start. It was designed for this purpose. Look for it in the Samples, by default located at:

C:\Program Files\Microsoft SQL Server\90\Samples\Analysis Services\Programmability\AMO\AmoBrowser

DImensions are buckets holding attributes. Dimensions themselves don't have sizes, attributes do. To figure out the # of members in a dimension, you need to navigate down to the key attribute of the dimension. The size of the *key* attribute is probably what you are looking for.

_-_-_ Dave