Showing posts with label setting. Show all posts
Showing posts with label setting. Show all posts

Thursday, March 22, 2012

AdventureWorks OLAP Cubes samples missing

Hi there,

I am setting up a demo with Scorecard Manager 2005. After days of struggle, the installation seems to be fine, I can publish all the two dimensional scorecards. But the sample AdventureWorks OLAP cubes do not seem to be accessible or they don't exist - to be more exact, Scorecard Manager is able to log on to the SQL Server database called AdventureWorksDW, but cannot find any cubes.

I downloaded the latest SQL Server 2005 samples here and followed all the instructions to the letter. I did not get any errors while deoplying the AdventureWorks solution in the Business Intelligence Development Studio. One concern related to the samples is that the AdventureWorksAS sample is not available. I thought that the DW database is used there, am I wrong?

I think that I'm missing some key element in deploying the sample OLAP cubes. Is there a way to check that they are made correctly? What application do I best use to peform this check?

I am running Server 2003, SP1, SQL Server 2005 SP1 with Analysis/Reporting/Integration services installed, SharePoint Server 2003 SP2 (all applications are running fine so far on it).

Thank you very much, Radu

PS: I just discovered and error posted by the Event Viewer. It seems that the system admin does not have authority to view ADOMD sources. How can I debug this error? This is a demo setup on a virtual PC so I gave all authorities to Admin from the initial setup and the AdventureWorksDW database exists (the Scorecard Manager app. does find the database, but cannot see any cubes and this is when the error shows up in the Event Viewer).

Here are the error details:

Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException: Either the user, NT AUTHORITY\SYSTEM, does not have access to the Adventure Works DW database, or the database does not exist.
at Microsoft.AnalysisServices.AdomdClient.XmlaClientProvider.Microsoft.AnalysisServices.AdomdClient.AdomdConnection+IXmlaClientProviderEx.Discover(String requestType, IDictionary restrictions, Boolean throwOnErrors, Boolean sendNamespaceCompatibility)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.GetProperty(String propName)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.SetProperty(String propertyName, String propValue)
at Microsoft.AnalysisServices.AdomdClient.AdomdConnection.ChangeDatabase(String database)
at Microsoft.PerformanceManagement.Scorecards.Server.OlapUtils.GetCubeNames(String databaseName)
at Microsoft.PerformanceManagement.Scorecards.Server.PmServer.GetCubeNames(DataSource dataSource)

I figured it out: there seems to be a mistake in the Scorecard Manager 2005 OLAP cubes samples' settings (the Adventure Works DW samples available here). If you open a scorecard's Data Source (in the Scorecard Builder), you need to erase any Database Roles. The samples come with 'All Users' set, but trying 'Reader' only for example, which is what is needed based on installation instructions, does not work.

Thanks to Ian Tien's site; I downloaded his Adventure Works DW samples, which are based on the 10 Analysis Services' tutorial cubes, and looked at his scorecard's configuration.

I guess this message is more for a Scorecard Manager 2005 board, but I couldn't find one on this MSDN forum site. But Analysis Services are inseparable from Scorecard, so I hope it helps someone.

Monday, March 19, 2012

Advantage of setting isolation level to READ UNCOMMITED

Hi,
I have two questions.
1) What is the advantage of setting isolation level to READ UNCOMMITED if
there are noupdates for the records that we are selecting?
Does it make the select faster when we don't issue any shared lock?
2) I found this statement in books online:
'if an update acquires a large number of row locks and has locked a
significant percentage of a table, the row locks are escalated to a table
lock'
Is this statement true when we have a select instead of update and isolation
level is READ COMMITED?
Thanks,
RosiePerformance is slightly better when using READ UNCOMMITTED for selects, as
SQL Server does not have to do any of the work of issuing shared locks.
And yes, SELECTs can escalate lock granularities.
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--
"Rosie" <Rosie@.discussions.microsoft.com> wrote in message
news:2E0888C6-59F0-4E52-B4C8-2D91645D1FDB@.microsoft.com...
> Hi,
> I have two questions.
> 1) What is the advantage of setting isolation level to READ UNCOMMITED if
> there are noupdates for the records that we are selecting?
> Does it make the select faster when we don't issue any shared lock?
> 2) I found this statement in books online:
> 'if an update acquires a large number of row locks and has locked a
> significant percentage of a table, the row locks are escalated to a table
> lock'
> Is this statement true when we have a select instead of update and
isolation
> level is READ COMMITED?
> Thanks,
> Rosie|||> 1) What is the advantage of setting isolation level to READ UNCOMMITED if
> there are noupdates for the records that we are selecting?
> Does it make the select faster when we don't issue any shared lock?
Sure, since there is less work to do. Will it make it that much faster, not
really unless the statement would have been blocked.

> 2) I found this statement in books online:
> 'if an update acquires a large number of row locks and has locked a
> significant percentage of a table, the row locks are escalated to a table
> lock'
> Is this statement true when we have a select instead of update and
> isolation
> level is READ COMMITED?
If you are in read committed isolation level, then you would not escalate.
Basically, as rows are fetched a lock is taken on that row. Then the row is
placed on the output buffer, the lock is released, a new row is locked and
fetched, etc. So only one row should be locked during the select. The
holdup comes when the single row that need to be locked is already locked.
Then wait city. If you are doing lots of updates, or in READ COMMITTED or
SERIALIZABLE transaction isolation level, then the table lock might come in
to play, but you would likely have to lock a lot of rows.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Rosie" <Rosie@.discussions.microsoft.com> wrote in message
news:2E0888C6-59F0-4E52-B4C8-2D91645D1FDB@.microsoft.com...
> Hi,
> I have two questions.
> 1) What is the advantage of setting isolation level to READ UNCOMMITED if
> there are noupdates for the records that we are selecting?
> Does it make the select faster when we don't issue any shared lock?
> 2) I found this statement in books online:
> 'if an update acquires a large number of row locks and has locked a
> significant percentage of a table, the row locks are escalated to a table
> lock'
> Is this statement true when we have a select instead of update and
> isolation
> level is READ COMMITED?
> Thanks,
> Rosie

Tuesday, March 6, 2012

AdomdConnection.GetSchemaDataSet - using restrictions

I'm attempting to use AdomdConnection.GetSchemaDataSet to see what information is in the AdomdSchemaGuid.PartitionStat dataset. I am setting the restrictions parameter to null.

The error I get is "Microsoft.AnalysisServices.AdomdClient.AdomdErrorResponseException : XML for Analysis parser: The DATABASE_NAME restriction is required but is missing from the request."

All well and good, except that I can't see in the documentation what form the restrictions should be, the parameter is of type object[]. How are the restrictions defined? Is there any documentation that says what restrictions apply to which dataset? Is there any documentation that says what information is returned in the dataset for each AdomdSchemaGuid?

John.

If you were to connect to Analysis Server using SQL Profiler you would see that any call you make in AMO to obtain some schema rowset is translated to a Discover request. For instance

You can read more about schema rowsets in books online: http://msdn2.microsoft.com/en-us/library/ms126233(SQL.90).aspx

See what schema rowset is requested by AMO and then you can look it up in the BOL.

As for specifying restrictions:

restcoll = New AdomdRestrictionCollection;

restcoll.Add("CATALOG_NAME", "MyDatabase");

dsCubes = AdomdConnection.GetSchemaDataSet("MDSCHEMA_CUBES", restcoll)

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

|||

Hi Edward, thanks for this.

This is generally useful knowledge for me, but...

AdomdSchemaGuid.PartitionStat returns a dataset DISCOVER_PARTITION_STAT for which there is no detail of result columns in the documentation.

Further, the dataset is returned by a call to GetSchemaDataSet(Guid, object[]), where it is not documented what the objects of object[] should be. I assume the parameter is not an AdomdRestrictionCollection, otherwise why is the parameter not of that type in the first place, like the GetSchemaDataset(string, AdomdRestrictionCollection) call?

The documentation does not indicate what restrictions are required for each dataset, and the exception does not explicitly say what the name of the restriction is.

John.

|||

There is a little survey on bottom on page in books online. I would encourage you to fill it. This should give an idea about which topics in documentation should get improved.

As for the using discovers. I was getting at giving you some generic mechanism you can use to figure out how to use any discover request.

AS you have seen in Profiler AMO is sending a Discover request to Analysis Server behind the scenes.

You can compose such request directly in SQL Managemet studio open an XMLA query editor. For example of discovering all cubes in your database you can send following request:

<Envelope xmlns = "http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Discover xmlns = "urn:schemas-microsoft-com:xml-analysis">
<RequestType>MDSCHEMA_CUBES</RequestType>
<Restrictions>
<RestrictionList/>
</Restrictions>
<Properties>
<PropertyList>
<Catalog>MyDatabase</Catalog>
</PropertyList>
</Properties>
</Discover>
</Body>
</Envelope>

The error messages you are getting back from the server when submitting such request should give you an idea what is missing.

In your case looks like the RestrictionList node is missing DATABASE_NAME restriction.

In AMO all AdomdRestrictionCollection object does: it is appending more elements to the RestrictionList node in the XMLA request.

So the mechanism is pretty generic, you should be able to figure out how to send almost any request and see what is getting returned back to you.

Hope that helps

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

|||

You can find most schema rowsets descriptions for example here: http://msdn2.microsoft.com/en-us/library/ms126233(SQL.90).aspx (proabbly books online have them as well)
Usually you would be able to find the descriptions of returned columns and restrictions columns in the docs. However, i think some schemas are missing, and DISCOVER_PARTITION_STAT seems to be one of those.
In such a case i can suggest executing the Discover_Schema_Rowsets in the SSMS, which should return you the list of supported schemas and their restrictions.
Request can look something liek this:

<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
<RequestType>DISCOVER_SCHEMA_ROWSETS</RequestType>
<Restrictions>
<RestrictionList/>
</Restrictions>
<Properties>
<PropertyList/>
</Properties>
</Discover>
</Body>
</Envelope>

for the DISCOVER_PARTITION_STAT, we get the following restrictions:

<Restrictions>
<Name>DATABASE_NAME</Name>
<Type>xsd:string</Type>
</Restrictions>
<Restrictions>
<Name>CUBE_NAME</Name>
<Type>xsd:string</Type>
</Restrictions>
<Restrictions>
<Name>MEASURE_GROUP_NAME</Name>
<Type>xsd:string</Type>
</Restrictions>
<Restrictions>
<Name>PARTITION_NAME</Name>
<Type>xsd:string</Type>
</Restrictions>


Adomd.Net has a number of overloads for GetSchemaDataSet function.
All GetSchemaDataSet overloads basically require you to provide:
- which schema rowset to retrieve (either by schema guid, or by schema name)
- restrictions to be applied in the schema rowset request (either in the "oledb style" – as object[], or using the AdomdRestrictionCollection)
And return the resulting schema rowset as System.Data.DataSet.
In the "ole db" style case, restrictions are mapped by position, and in the other approach - by name.

Here are couple samples to retrieve the DISCOVER_PARTITION_STAT rowset.

// ole db – like approach
// schema specified by guid;
// restrictions matched by position;

// assuming ‘con’ is an opened connection
object[] rest = new object[]
{
"Adventure Works DW", // DATABASE_NAME
"Adventure Works", // CUBE_NAME
"Internet Sales", // MEASURE_GROUP_NAME
"Internet_Sales_2002" // PARTITION_NAME
};

DataTable partitionStat =
con.GetSchemaDataSet(
AdomdSchemaGuid.PartitionStat,
rest).Tables[0];


foreach (DataColumn column in partitionStat.Columns)
{
Debug.WriteLine(column.ColumnName);
}

// another way – schema specified by name;
// restriction matching done by name;
// using restrictions collection

// assuming ‘con’ is an opened connection
AdomdRestrictionCollection restrictions =
new AdomdRestrictionCollection();
restrictions.Add("DATABASE_NAME", "Adventure Works DW");
restrictions.Add("CUBE_NAME", "Adventure Works");
restrictions.Add("MEASURE_GROUP_NAME", "Internet Sales");
restrictions.Add("PARTITION_NAME", "Internet_Sales_2002");

partitionStat =
con.GetSchemaDataSet(
"DISCOVER_PARTITION_STAT",
restrictions).Tables[0];

foreach (DataColumn column in partitionStat.Columns)
{
Debug.WriteLine(column.ColumnName);
}

hope this helps some,

|||

Thanks, these posts help a lot. As an aside, is there a reason there's no overloaded version of GetSchemaDataSet that takes a Guid and AdomdRestrictionCollection as parameters?

|||

hello John,

There is no particular strict reason. The 2 sets of overloads available (with guid and name) are basically kind of 2 different style. Personally i prefer second one as it seems to be more self descriptive (especially in the restrictions part). But perhaps there are people who like the first one (and it is consistent with System.Data's GetOleDbSchemaTable). I don't think the overloads should be intermixed, but don't think there is any road block to create such overload. On the other hand i don't think there is a strong need to have one. So i guess it is sort of an arbitrary call.

thanks,