I am using DSO to list all the partitions (> 200) in my cube and then do a
threaded process of these partitions.
Thres questions:
1) I am using a grid to show all the partitions, whether they have been
processed or not and what their Estimated rows are. During population of
this grid (basically just iterating Cube.MDStores[x]), 9 times out of 10
I
get this random divide by zero error. I'm definately not causing this.
This is my loop:
for i:=1 to FCube.MDStores.Count do
begin
FPartition:=FCube.MDStores.Item(i);
FEstimatedRows:=FPartition.EstimatedRows;
sgPartitionList.Cells[0,i]:=FPartition.Name;
if FPartition.State = olapStateCurrent then
sgPartitionList.Cells[1,i]:='Processed'
else
sgPartitionList.Cells[1,i]:='No';
sgPartitionList.Cells[2,i]:=IntToStr(FEstimatedRows);
// Brain fart mentioned below goes here.
end;
Interestingly enough (2AM brain fart), I added this:
if i mod 12 = 0 then
begin
Application.ProcessMessages;
Sleep(500);
Application.ProcessMessages;
end;
to the loop (every 12 iterations, sleep 500 ms after processing all system
messages in the queue) and it works. Any idea why?
2) This same behavior presents itself during partition creation. At 225
partitions (without the message processing and pause), the OLE system kicks
back divide by zero errors or Access Violations. I've added the pause and
ProcessMessages to the creation loop and it's fine, but it worries me. Is
DSO really that flaky or am I missing something?
3) During partition process: I have a multi-threaded approach. I call
CoInitialize (to create a new OLE session because apparently DSO is not
threaded correctly) create a connection to the server, the database, the
cube and the partitions and then call FPartitionObject.Process;
This actually works great, but my question is, sporadically, the processing
just stops. I check the data directory and there won't have been any
updates to the files in several hours (as opposed to minutes when the
processing is working) and the CPU usage will be almost nil. I kill the
application, I also have to restart the OLAP service. There is no pattern
here, sometimes it'll process the whole cube (> 200 partitions), sometimes
it'll die at 50, sometimes 100, sometimes 4. Any Ideas? I've included my
Delphi source for the meat of the thread below.
procedure TPartitionProcessThread.Execute;
var
FServerObject, FDatabaseObject, FCubeObject, FPartitionObject: OleVariant;
begin
FStartTime:=Now;
CoInitialize(nil);
try
try
FSuccess:=False;
while not TryEnterCriticalSection(FConnectSection)
do
Sleep(500);
try
FServerObject:=CreateOLEObject('DSO.Server');
FServerObject.Connect(FServerName);
FDatabaseObject:=FServerObject.MDStores.Item(FDatabaseName);
FCubeObject:=FDatabaseObject.MDStores.Item(FCubeName);
FPartitionObject:=FCubeObject.MDStores.Item(FPartitionName);
finally
LeaveCriticalSection(FConnectSection);
end;
FPartitionObject.Process;
FSuccess:=True;
except
on E: Exception do
begin
FErrorMessage:=E.Message;
FSuccess:=False;
end;
end;
finally
CoUninitialize;
FEndTime:=Now;
end;
end;
Thanks a lot!
-MalcolmOne possible issue is that DSO is written in VB and thus it will have
serious threading issues in this environment. This is why the PPU uses
separate processes (rather than threads) to process objects in parallel.
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Malcolm Toon" <mtoon@. no-spam.retailsolutions.com> wrote in message
news:uVqYwLvLFHA.1396@.TK2MSFTNGP10.phx.gbl...
> I am using DSO to list all the partitions (> 200) in my cube and then do a
> threaded process of these partitions.
> Thres questions:
> 1) I am using a grid to show all the partitions, whether they have been
> processed or not and what their Estimated rows are. During population of
> this grid (basically just iterating Cube.MDStores[x]), 9 times out of
10 I
> get this random divide by zero error. I'm definately not causing this.
> This is my loop:
> for i:=1 to FCube.MDStores.Count do
> begin
> FPartition:=FCube.MDStores.Item(i);
> FEstimatedRows:=FPartition.EstimatedRows;
> sgPartitionList.Cells[0,i]:=FPartition.Name;
> if FPartition.State = olapStateCurrent then
> sgPartitionList.Cells[1,i]:='Processed'
> else
> sgPartitionList.Cells[1,i]:='No';
> sgPartitionList.Cells[2,i]:=IntToStr(FEstimatedRows);
> // Brain fart mentioned below goes here.
> end;
> Interestingly enough (2AM brain fart), I added this:
> if i mod 12 = 0 then
> begin
> Application.ProcessMessages;
> Sleep(500);
> Application.ProcessMessages;
> end;
> to the loop (every 12 iterations, sleep 500 ms after processing all system
> messages in the queue) and it works. Any idea why?
>
> 2) This same behavior presents itself during partition creation. At 225
> partitions (without the message processing and pause), the OLE system
kicks
> back divide by zero errors or Access Violations. I've added the pause and
> ProcessMessages to the creation loop and it's fine, but it worries me. Is
> DSO really that flaky or am I missing something?
> 3) During partition process: I have a multi-threaded approach. I call
> CoInitialize (to create a new OLE session because apparently DSO is not
> threaded correctly) create a connection to the server, the database, the
> cube and the partitions and then call FPartitionObject.Process;
> This actually works great, but my question is, sporadically, the
processing
> just stops. I check the data directory and there won't have been any
> updates to the files in several hours (as opposed to minutes when the
> processing is working) and the CPU usage will be almost nil. I kill the
> application, I also have to restart the OLAP service. There is no pattern
> here, sometimes it'll process the whole cube (> 200 partitions), sometimes
> it'll die at 50, sometimes 100, sometimes 4. Any Ideas? I've included my
> Delphi source for the meat of the thread below.
> procedure TPartitionProcessThread.Execute;
> var
> FServerObject, FDatabaseObject, FCubeObject, FPartitionObject:
OleVariant;
> begin
> FStartTime:=Now;
> CoInitialize(nil);
> try
> try
> FSuccess:=False;
> while not TryEnterCriticalSection(FConnectSection)
do
> Sleep(500);
> try
> FServerObject:=CreateOLEObject('DSO.Server');
> FServerObject.Connect(FServerName);
> FDatabaseObject:=FServerObject.MDStores.Item(FDatabaseName);
> FCubeObject:=FDatabaseObject.MDStores.Item(FCubeName);
> FPartitionObject:=FCubeObject.MDStores.Item(FPartitionName);
> finally
> LeaveCriticalSection(FConnectSection);
> end;
> FPartitionObject.Process;
> FSuccess:=True;
> except
> on E: Exception do
> begin
> FErrorMessage:=E.Message;
> FSuccess:=False;
> end;
> end;
> finally
> CoUninitialize;
> FEndTime:=Now;
> end;
> end;
>
> Thanks a lot!
> -Malcolm
>|||What about AS2005? Will it have the same problems? We're still in R&D,
Proof of Concept phase, so we're open to starting with AS2005 when we move
to actual development and production, but will it have the same problem?
Should I start coding our solutions to really be different EXEs? Is there
any alternative to DSO? Is there another API of some sort? Some way to
mimic what DSO does.
Thanks again for the help!
-Malcolm
"Dave Wickert [MSFT]" <dwickert@.online.microsoft.com> wrote in message
news:%23Go1Kh%23LFHA.3788@.tk2msftngp13.phx.gbl...
> One possible issue is that DSO is written in VB and thus it will have
> serious threading issues in this environment. This is why the PPU uses
> separate processes (rather than threads) to process objects in parallel.
> --
> Dave Wickert [MSFT]
> dwickert@.online.microsoft.com
> Program Manager
> BI SystemsTeam
> SQL BI Product Unit (Analysis Services)
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> "Malcolm Toon" <mtoon@. no-spam.retailsolutions.com> wrote in message
> news:uVqYwLvLFHA.1396@.TK2MSFTNGP10.phx.gbl...
a[vbcol=seagreen]
of[vbcol=seagreen]
I[vbcol=seagreen]
system[vbcol=seagreen]
> kicks
and[vbcol=seagreen]
Is[vbcol=seagreen]
> processing
pattern[vbcol=seagreen]
sometimes[vbcol=seagreen]
my[vbcol=seagreen]
> OleVariant;
>|||SQL 2005's management APIs (AMO) are all written in managed code. They are
totally thread-safe.
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI SystemsTeam
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"Malcolm Toon" <mtoon@. no-spam.retailsolutions.com> wrote in message
news:uo2aJ6%23LFHA.244@.tk2msftngp13.phx.gbl...
> What about AS2005? Will it have the same problems? We're still in R&D,
> Proof of Concept phase, so we're open to starting with AS2005 when we move
> to actual development and production, but will it have the same problem?
> Should I start coding our solutions to really be different EXEs? Is there
> any alternative to DSO? Is there another API of some sort? Some way to
> mimic what DSO does.
> Thanks again for the help!
> -Malcolm
> "Dave Wickert [MSFT]" <dwickert@.online.microsoft.com> wrote in message
> news:%23Go1Kh%23LFHA.3788@.tk2msftngp13.phx.gbl...
> rights.
do[vbcol=seagreen]
> a
been[vbcol=seagreen]
> of
10[vbcol=seagreen]
> I
this.[vbcol=seagreen]
> system
225[vbcol=seagreen]
> and
> Is
not[vbcol=seagreen]
the[vbcol=seagreen]
the[vbcol=seagreen]
> pattern
> sometimes
included[vbcol=seagreen]
> my
>
Showing posts with label partitions. Show all posts
Showing posts with label partitions. Show all posts
Tuesday, February 14, 2012
DSO Questions
DSO partitioning problem
Hi,
I have some DSO code which is partitioning a cube very nicely by deleting
and recreating old monthly partitions by cloning an original month partition.
When I actually come to test the data present in the cube I only ever get the
the original partitions data.
If I use the partition wizard to check out the filter settings for the new
partitions they all look OK - so I get an original partition for August and
then new ones for September, October, November.
In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
fields of the new partitions but get the feeling I am missing something.
Any ideas out there?
Yup. Find a copy of the SQL Server 2000 Resource Kit. On it was a utility
called the Metadata Scripter. When you installed it into Analysis Manager,
you can right-click on an object and generate a VB6 program which will
re-create that object. It generated DSO code. So the sequence of events to
figure out how to program with DSO is:
1) start from a known system.
2) do whatever you do in your custom application, then use the metadata
scriptor to generate "ProgA.vb".
3) go back to your known system
4) do whatever you do using Analysis Manager, then use the metadata scripter
to generate "ProgB.vb"
5) do a windiff comparing ProgA.vb and ProgB.vb -- and you will see that
there is some property or setting which your application is missing, but
Analysis Manager catches.
Hope that helps.
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"badlydressedboy" <badlydressedboy@.discussions.microsoft.com> wrote in
message news:6D35B127-A2CB-442A-83BF-A63E4DBBE564@.microsoft.com...
> Hi,
> I have some DSO code which is partitioning a cube very nicely by deleting
> and recreating old monthly partitions by cloning an original month
> partition.
> When I actually come to test the data present in the cube I only ever get
> the
> the original partitions data.
> If I use the partition wizard to check out the filter settings for the new
> partitions they all look OK - so I get an original partition for August
> and
> then new ones for September, October, November.
> In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
> fields of the new partitions but get the feeling I am missing something.
> Any ideas out there?
I have some DSO code which is partitioning a cube very nicely by deleting
and recreating old monthly partitions by cloning an original month partition.
When I actually come to test the data present in the cube I only ever get the
the original partitions data.
If I use the partition wizard to check out the filter settings for the new
partitions they all look OK - so I get an original partition for August and
then new ones for September, October, November.
In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
fields of the new partitions but get the feeling I am missing something.
Any ideas out there?
Yup. Find a copy of the SQL Server 2000 Resource Kit. On it was a utility
called the Metadata Scripter. When you installed it into Analysis Manager,
you can right-click on an object and generate a VB6 program which will
re-create that object. It generated DSO code. So the sequence of events to
figure out how to program with DSO is:
1) start from a known system.
2) do whatever you do in your custom application, then use the metadata
scriptor to generate "ProgA.vb".
3) go back to your known system
4) do whatever you do using Analysis Manager, then use the metadata scripter
to generate "ProgB.vb"
5) do a windiff comparing ProgA.vb and ProgB.vb -- and you will see that
there is some property or setting which your application is missing, but
Analysis Manager catches.
Hope that helps.
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
This posting is provided "AS IS" with no warranties, and confers no rights.
"badlydressedboy" <badlydressedboy@.discussions.microsoft.com> wrote in
message news:6D35B127-A2CB-442A-83BF-A63E4DBBE564@.microsoft.com...
> Hi,
> I have some DSO code which is partitioning a cube very nicely by deleting
> and recreating old monthly partitions by cloning an original month
> partition.
> When I actually come to test the data present in the cube I only ever get
> the
> the original partitions data.
> If I use the partition wizard to check out the filter settings for the new
> partitions they all look OK - so I get an original partition for August
> and
> then new ones for September, October, November.
> In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
> fields of the new partitions but get the feeling I am missing something.
> Any ideas out there?
Labels:
cloning,
code,
cube,
database,
deletingand,
dso,
microsoft,
monthly,
mysql,
nicely,
old,
oracle,
original,
partitioning,
partitions,
recreating,
server,
sql
DSO partitioning problem
Hi,
I have some DSO code which is partitioning a cube very nicely by deleting
and recreating old monthly partitions by cloning an original month partition
.
When I actually come to test the data present in the cube I only ever get th
e
the original partitions data.
If I use the partition wizard to check out the filter settings for the new
partitions they all look OK - so I get an original partition for August and
then new ones for September, October, November.
In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
fields of the new partitions but get the feeling I am missing something.
Any ideas out there?Yup. Find a copy of the SQL Server 2000 Resource Kit. On it was a utility
called the Metadata Scripter. When you installed it into Analysis Manager,
you can right-click on an object and generate a VB6 program which will
re-create that object. It generated DSO code. So the sequence of events to
figure out how to program with DSO is:
1) start from a known system.
2) do whatever you do in your custom application, then use the metadata
scriptor to generate "ProgA.vb".
3) go back to your known system
4) do whatever you do using Analysis Manager, then use the metadata scripter
to generate "ProgB.vb"
5) do a windiff comparing ProgA.vb and ProgB.vb -- and you will see that
there is some property or setting which your application is missing, but
Analysis Manager catches.
Hope that helps.
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"badlydressedboy" <badlydressedboy@.discussions.microsoft.com> wrote in
message news:6D35B127-A2CB-442A-83BF-A63E4DBBE564@.microsoft.com...
> Hi,
> I have some DSO code which is partitioning a cube very nicely by deleting
> and recreating old monthly partitions by cloning an original month
> partition.
> When I actually come to test the data present in the cube I only ever get
> the
> the original partitions data.
> If I use the partition wizard to check out the filter settings for the new
> partitions they all look OK - so I get an original partition for August
> and
> then new ones for September, October, November.
> In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
> fields of the new partitions but get the feeling I am missing something.
> Any ideas out there?
I have some DSO code which is partitioning a cube very nicely by deleting
and recreating old monthly partitions by cloning an original month partition
.
When I actually come to test the data present in the cube I only ever get th
e
the original partitions data.
If I use the partition wizard to check out the filter settings for the new
partitions they all look OK - so I get an original partition for August and
then new ones for September, October, November.
In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
fields of the new partitions but get the feeling I am missing something.
Any ideas out there?Yup. Find a copy of the SQL Server 2000 Resource Kit. On it was a utility
called the Metadata Scripter. When you installed it into Analysis Manager,
you can right-click on an object and generate a VB6 program which will
re-create that object. It generated DSO code. So the sequence of events to
figure out how to program with DSO is:
1) start from a known system.
2) do whatever you do in your custom application, then use the metadata
scriptor to generate "ProgA.vb".
3) go back to your known system
4) do whatever you do using Analysis Manager, then use the metadata scripter
to generate "ProgB.vb"
5) do a windiff comparing ProgA.vb and ProgB.vb -- and you will see that
there is some property or setting which your application is missing, but
Analysis Manager catches.
Hope that helps.
--
Dave Wickert [MSFT]
dwickert@.online.microsoft.com
Program Manager
BI Systems Team
SQL BI Product Unit (Analysis Services)
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"badlydressedboy" <badlydressedboy@.discussions.microsoft.com> wrote in
message news:6D35B127-A2CB-442A-83BF-A63E4DBBE564@.microsoft.com...
> Hi,
> I have some DSO code which is partitioning a cube very nicely by deleting
> and recreating old monthly partitions by cloning an original month
> partition.
> When I actually come to test the data present in the cube I only ever get
> the
> the original partitions data.
> If I use the partition wizard to check out the filter settings for the new
> partitions they all look OK - so I get an original partition for August
> and
> then new ones for September, October, November.
> In code I am setting the DimensionSlice, SliceValue and MemberKeyColumn
> fields of the new partitions but get the feeling I am missing something.
> Any ideas out there?
Labels:
cloning,
code,
cube,
database,
deletingand,
dso,
microsoft,
monthly,
mysql,
nicely,
old,
oracle,
original,
partitioning,
partitions,
recreating,
server,
sql
Subscribe to:
Posts (Atom)