AMO question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



We use AMO to process our cubes. They're partitioned daily.

Everything works great with one exception. Let me explain.

We have 30 days to process. The first 20 days process fine. During the
processing of the 21st day an error occurs. The transaction rolls everything
back. This is not what we want...we want the first 20 days that processed
fine to commit.

My question is...how can this be done in AMO?

Example code:




Public Sub CreatePartition(ByRef sProcessingType, ByRef sNewPartitionName,
ByRef sCalendarDWID, ByRef sTimeOfDayDWID)

Dim oNewPartition As Partition

Dim oNewPartitionExists As Partition

Dim oClonePartition As Partition

Dim sQueryText As String

Dim sPartitionPrefix As String

Dim BeginTime As DateTime

Dim sSQLQuery As String

Try

oClonePartition = objMeasureGroup.Partitions.FindByName("template")

BeginTime = Now

InsertCubeProcessingLog("Process Partition Executing...", 0, 0, BeginTime,
"12/31/9999", objDatabase.Name, objCube.Name, objMeasureGroup.Name,
"Partition", sNewPartitionName, sQueryText, sProcessingType, sCalendarDWID,
sTimeOfDayDWID)

oNewPartition = oClonePartition.Clone

oNewPartition.ID = sNewPartitionName

oNewPartition.Name = sNewPartitionName

objMeasureGroup.Partitions.Add(oNewPartition)

oNewPartition.Source = New QueryBinding(objDatabase.DataSources(0).ID,
sQueryText)

oNewPartition.Update()

oNewPartition.Process(ProcessType.ProcessFull)

sSQLQuery = "set EventDescription = 'Process Partition', issuccess = 1,
recordactive = 1, eventendtime = '" & Now & "' where eventdescription =
'Process Partition Executing...' and eventendtime = '12/31/9999' and
eventstarttime = '" & BeginTime & "'" & " and partitionname = '" &
sNewPartitionName & "' and cubename = '" & objCube.Name & "' and objectname
= '" & objMeasureGroup.Name & "' and databasename = '" & objDatabase.Name &
"'"

UpdateCubeProcessingLog(sSQLQuery)

Catch

Dim ErrorReplace As String = Err.Description

ErrorReplace = ErrorReplace.Replace("'", "")

sSQLQuery = "set EventDescription = 'Process Partition Failed: " &
Err.Number & " - " & ErrorReplace & "', issuccess = 0, recordactive = 0,
eventendtime = '" & Now & "' where eventdescription = 'Process Partition
Executing...' and eventendtime = '12/31/9999' and eventstarttime = '" &
BeginTime & "'" & " and partitionname = '" & sNewPartitionName & "' and
cubename = '" & objCube.Name & "' and objectname = '" & objMeasureGroup.Name
& "' and databasename = '" & objDatabase.Name & "'"

UpdateCubeProcessingLog(sSQLQuery)

strKeepProcessing = "False"

End Try

End Sub


.



Relevant Pages

  • Re: AMO question
    ... Darren Gosbell - SQL Server MVP ... Dim oNewPartitionExists As Partition ... "Partition", sNewPartitionName, sQueryText, sProcessingType, ...
    (microsoft.public.sqlserver.olap)
  • Re: AMO question
    ... The transaction rolls everything ... Dim oNewPartitionExists As Partition ... "Partition", sNewPartitionName, sQueryText, sProcessingType, sCalendarDWID, ...
    (microsoft.public.sqlserver.olap)
  • Impossible to Incrementally update a cube using DSO !!!
    ... One of my dimensions is a DateTime and I cannot merge the tmp partition ... Dim dsoServer ... ' Create DSO object and Connect to the local server. ...
    (microsoft.public.sqlserver.olap)
  • Re: Create Partition
    ... Public Const GENERIC_WRITE = &H40000000 ... ByVal lpBuffer As String, ByVal nSize As Long, _ ... Dim bytesreturned As Long ... I can now create a partition of any size within the size of the drive. ...
    (microsoft.public.vb.winapi)
  • DSO
    ... I also have different fact tables for each period so each partition has its own fact table. ... Dim strPartitionNameNew ... Set dsoPartitionNew = dsoCube.MDStores.AddNew ... msgbox dsoPartitionNew.SourceTable ...
    (microsoft.public.sqlserver.olap)