Command line to Process Cubes

Command line to Process Cubes

Post by Chris » Tue, 15 May 2001 21:12:07



ALL,

Is there a command line method to process cubes??  I am using DTS to process
them now, but would like to would like to avoid using it if possible.

If I choose to write a VB program to perform this using DSO, what is a good
resource to use for examples?

Thanks!

   - Chris

 
 
 

Command line to Process Cubes

Post by Dejan Sark » Tue, 15 May 2001 23:24:01


Chris,

Quote:> Is there a command line method to process cubes??  I am using DTS to
process
> them now, but would like to would like to avoid using it if possible.

DTSRun.exe is command line utility that runs DTS packages. Have you checked
it, why doesn't it suit you?

Quote:> If I choose to write a VB program to perform this using DSO, what is a
good
> resource to use for examples?

BOL. Anyway, here is my VB application:

Option Explicit
Public dsoServer As DSO.Server
Public intClassType As Integer
Public strClassType As String
Public strErr As String
Public blnRet As Boolean

Public parStr As String

Private Sub Form_Load()

Dim parArray() As String
parStr = Command()
parArray() = Split(parStr, " ")

Set dsoServer = New DSO.Server

If dsoServer.Init(parArray(0), strErr) Then
    Debug.Print "Server initialization OK"
Else
    Debug.Print "Server initialization FAILED"
End If

intClassType = dsoServer.ClassType
Select Case intClassType
        Case clsServer
             strClassType = "Server"
        Case Else
             strClassType = "Invalid Class Type"
End Select

    Dim dsoDB As DSO.MDStore
    Dim strDBName As String
    Dim dsoCube As DSO.MDStore
    Dim strCubeName As String
    strDBName = parArray(1)
    strCubeName = parArray(2)

    If dsoServer.MDStores.Find(strDBName) Then
        Set dsoDB = dsoServer.MDStores(strDBName)
        Set dsoCube = dsoDB.Server.CreateObject(clsCube)
        Set dsoCube = dsoDB.MDStores.Item(parArray(2))
    End If

    blnRet = dsoCube.LockObject(olaplockProcess, "Process Cube ...")
    'MsgBox "Lock:" & blnRet

    blnRet = dsoCube.Process
    'MsgBox "Process:" & blnRet

    blnRet = dsoCube.UnlockObject
    'MsgBox "UnLock:" & blnRet

    Unload Me
End Sub

--
Dejan Sarka, SQL Server MVP
FAQ from Neil & others at: http://www.sqlserverfaq.com

 
 
 

Command line to Process Cubes

Post by Chris » Wed, 16 May 2001 22:44:20


Sorry, I was not clear.  I meant to say a command line to process cubes,
outside of DTS.  Something similar to MSMDARCH.EXE is what I'm looking for.

I'll try this code and see if it will work with what I'm trying to do.
Thanks!

     - Chris


Quote:> Chris,

> > Is there a command line method to process cubes??  I am using DTS to
> process
> > them now, but would like to would like to avoid using it if possible.

> DTSRun.exe is command line utility that runs DTS packages. Have you
checked
> it, why doesn't it suit you?

> > If I choose to write a VB program to perform this using DSO, what is a
> good
> > resource to use for examples?

> BOL. Anyway, here is my VB application:

> Option Explicit
> Public dsoServer As DSO.Server
> Public intClassType As Integer
> Public strClassType As String
> Public strErr As String
> Public blnRet As Boolean

> Public parStr As String

> Private Sub Form_Load()

> Dim parArray() As String
> parStr = Command()
> parArray() = Split(parStr, " ")

> Set dsoServer = New DSO.Server

> If dsoServer.Init(parArray(0), strErr) Then
>     Debug.Print "Server initialization OK"
> Else
>     Debug.Print "Server initialization FAILED"
> End If

> intClassType = dsoServer.ClassType
> Select Case intClassType
>         Case clsServer
>              strClassType = "Server"
>         Case Else
>              strClassType = "Invalid Class Type"
> End Select

>     Dim dsoDB As DSO.MDStore
>     Dim strDBName As String
>     Dim dsoCube As DSO.MDStore
>     Dim strCubeName As String
>     strDBName = parArray(1)
>     strCubeName = parArray(2)

>     If dsoServer.MDStores.Find(strDBName) Then
>         Set dsoDB = dsoServer.MDStores(strDBName)
>         Set dsoCube = dsoDB.Server.CreateObject(clsCube)
>         Set dsoCube = dsoDB.MDStores.Item(parArray(2))
>     End If

>     blnRet = dsoCube.LockObject(olaplockProcess, "Process Cube ...")
>     'MsgBox "Lock:" & blnRet

>     blnRet = dsoCube.Process
>     'MsgBox "Process:" & blnRet

>     blnRet = dsoCube.UnlockObject
>     'MsgBox "UnLock:" & blnRet

>     Unload Me
> End Sub

> --
> Dejan Sarka, SQL Server MVP
> FAQ from Neil & others at: http://www.sqlserverfaq.com

 
 
 

Command line to Process Cubes

Post by Mosha Pasumansk » Thu, 17 May 2001 08:17:09


Check at Plato Community Site
http://communities.msn.com/MicrosoftOLAPServicesUsersCommunity
There are several command line based tools for processing

--
==================================================
Mosha Pasumansky

All you need is love (John Lennon)
==================================================


> Sorry, I was not clear.  I meant to say a command line to process cubes,
> outside of DTS.  Something similar to MSMDARCH.EXE is what I'm looking
for.

> I'll try this code and see if it will work with what I'm trying to do.
> Thanks!

>      - Chris



> > Chris,

> > > Is there a command line method to process cubes??  I am using DTS to
> > process
> > > them now, but would like to would like to avoid using it if possible.

> > DTSRun.exe is command line utility that runs DTS packages. Have you
> checked
> > it, why doesn't it suit you?

> > > If I choose to write a VB program to perform this using DSO, what is a
> > good
> > > resource to use for examples?

> > BOL. Anyway, here is my VB application:

> > Option Explicit
> > Public dsoServer As DSO.Server
> > Public intClassType As Integer
> > Public strClassType As String
> > Public strErr As String
> > Public blnRet As Boolean

> > Public parStr As String

> > Private Sub Form_Load()

> > Dim parArray() As String
> > parStr = Command()
> > parArray() = Split(parStr, " ")

> > Set dsoServer = New DSO.Server

> > If dsoServer.Init(parArray(0), strErr) Then
> >     Debug.Print "Server initialization OK"
> > Else
> >     Debug.Print "Server initialization FAILED"
> > End If

> > intClassType = dsoServer.ClassType
> > Select Case intClassType
> >         Case clsServer
> >              strClassType = "Server"
> >         Case Else
> >              strClassType = "Invalid Class Type"
> > End Select

> >     Dim dsoDB As DSO.MDStore
> >     Dim strDBName As String
> >     Dim dsoCube As DSO.MDStore
> >     Dim strCubeName As String
> >     strDBName = parArray(1)
> >     strCubeName = parArray(2)

> >     If dsoServer.MDStores.Find(strDBName) Then
> >         Set dsoDB = dsoServer.MDStores(strDBName)
> >         Set dsoCube = dsoDB.Server.CreateObject(clsCube)
> >         Set dsoCube = dsoDB.MDStores.Item(parArray(2))
> >     End If

> >     blnRet = dsoCube.LockObject(olaplockProcess, "Process Cube ...")
> >     'MsgBox "Lock:" & blnRet

> >     blnRet = dsoCube.Process
> >     'MsgBox "Process:" & blnRet

> >     blnRet = dsoCube.UnlockObject
> >     'MsgBox "UnLock:" & blnRet

> >     Unload Me
> > End Sub

> > --
> > Dejan Sarka, SQL Server MVP
> > FAQ from Neil & others at: http://www.sqlserverfaq.com