dbTalk Databases Forums  

Cannot get MSMDARCH.exe to work or produce feedback

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Cannot get MSMDARCH.exe to work or produce feedback in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
thotman
 
Posts: n/a

Default Cannot get MSMDARCH.exe to work or produce feedback - 03-09-2006 , 03:19 PM






I initiate MSMDARCH.exe using the Program.Start() method in c# which is
supposed to unpack a CAB file used for an OLAP cube in MS Analysis
Services:

public static bool unpackDTSCAB(string dBServerName)
{
bool DTSSuccessfullyConfigured = false;
try
{
// unpack the CAB file
string ExePath =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles)
+ @"\Microsoft Analysis Services\Bin\msmdarch.exe";

string MSMADataPath =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles) +
@"\Microsoft Analysis Services\Data\";

string DTSCabPath =
CommonConfigUtils.FindFile(@"\OLAP\OLAP_DB\TEST.CA B");

if (DTSCabPath == "" || DTSCabPath == null) return false;
string parameters = "/r " + dBServerName + " " + MSMADataPath + " "
+ DTSCabPath;
ProcessStartInfo ps = new ProcessStartInfo(ExePath,parameters);
ps.UseShellExecute = false;
ps.RedirectStandardOutput = true;
ps.RedirectStandardError=true;
Process newProcess = new Process();
newProcess.StartInfo = ps;
newProcess.Start();
newProcess.WaitForExit();
DTSSuccessfullyConfigured = true;

// the standard output and standard error do not appear to typically
produce any feedback
// If something is ever returned, we will consider it an error
string outputString =
newProcess.StandardOutput.ReadToEnd().ToString();

if (outputString.CompareTo("") != 0) // if output string is not
empty, throw error output
throw new SystemException(outputString);
}
catch(Exception ex)
{
Trace.WriteLine(ex.Message);
return false;
}

return DTSSuccessfullyConfigured;
}

The problem is that even though the method completes successfully, it
fails to create an OLAP cube instance in the MS Analysis Services
Manager. Strangely, the Process.Start()code almost never produces an
exception, unless there is something wrong with the ".exe" path. I am
looking at the STDOUT and STDERR for any sign of success or failure and
get absolutely nothing.

Another strange thing is that if I stop execution of the code with the
debugger just before the Process.Start() method and copy the values for
the exe string and parameters string in a command console, it
successfully creates the OLAP cube in MS Analysis Services. However,
like the code, it produces no feedback on the command line for errors
in the parameters.

So I'm looking for any info on:
- how to successfully run MSMDARCH.exe from c# code with feedback or at
least some measure of whether or not it was successful.
OR
- another way to unpack the ".cab" file

I am running Win2003Ent, SQL2003SP3, MSAS SP3, in the .Net 2.0
framework

Any help or direction is much appreciated.

Thanks.


Reply With Quote
  #2  
Old   
thotman
 
Posts: n/a

Default Re: Cannot get MSMDARCH.exe to work or produce feedback - 03-20-2006 , 04:16 PM






Managed to get at least a success/failure using the exit code property
of the instantiated process object

if (newProcess.ExitCode == 1)
DTSSuccessfullyConfigured = false;

- but you have to make sure that you use the WaitForExit() method.

I would still like to know if anyone has any ideas about why using
MSMDARCH.exe fails when running it through .Net Process.Start(), yet
succeeds when the MSMDARCH.exe executable is run manually at the
command line.

Ideas? comments? suggestions?

Thanks,

thotman wrote:
Quote:
I initiate MSMDARCH.exe using the Program.Start() method in c# which is
supposed to unpack a CAB file used for an OLAP cube in MS Analysis
Services:

public static bool unpackDTSCAB(string dBServerName)
{
bool DTSSuccessfullyConfigured = false;
try
{
// unpack the CAB file
string ExePath =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles)
+ @"\Microsoft Analysis Services\Bin\msmdarch.exe";

string MSMADataPath =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles) +
@"\Microsoft Analysis Services\Data\";

string DTSCabPath =
CommonConfigUtils.FindFile(@"\OLAP\OLAP_DB\TEST.CA B");

if (DTSCabPath == "" || DTSCabPath == null) return false;
string parameters = "/r " + dBServerName + " " + MSMADataPath + " "
+ DTSCabPath;
ProcessStartInfo ps = new ProcessStartInfo(ExePath,parameters);
ps.UseShellExecute = false;
ps.RedirectStandardOutput = true;
ps.RedirectStandardError=true;
Process newProcess = new Process();
newProcess.StartInfo = ps;
newProcess.Start();
newProcess.WaitForExit();
DTSSuccessfullyConfigured = true;

// the standard output and standard error do not appear to typically
produce any feedback
// If something is ever returned, we will consider it an error
string outputString =
newProcess.StandardOutput.ReadToEnd().ToString();

if (outputString.CompareTo("") != 0) // if output string is not
empty, throw error output
throw new SystemException(outputString);
}
catch(Exception ex)
{
Trace.WriteLine(ex.Message);
return false;
}

return DTSSuccessfullyConfigured;
}

The problem is that even though the method completes successfully, it
fails to create an OLAP cube instance in the MS Analysis Services
Manager. Strangely, the Process.Start()code almost never produces an
exception, unless there is something wrong with the ".exe" path. I am
looking at the STDOUT and STDERR for any sign of success or failure and
get absolutely nothing.

Another strange thing is that if I stop execution of the code with the
debugger just before the Process.Start() method and copy the values for
the exe string and parameters string in a command console, it
successfully creates the OLAP cube in MS Analysis Services. However,
like the code, it produces no feedback on the command line for errors
in the parameters.

So I'm looking for any info on:
- how to successfully run MSMDARCH.exe from c# code with feedback or at
least some measure of whether or not it was successful.
OR
- another way to unpack the ".cab" file

I am running Win2003Ent, SQL2003SP3, MSAS SP3, in the .Net 2.0
framework

Any help or direction is much appreciated.

Thanks.


Reply With Quote
  #3  
Old   
Darren Gosbell
 
Posts: n/a

Default Re: Cannot get MSMDARCH.exe to work or produce feedback - 03-22-2006 , 07:32 AM



I have some suggestions, but nothing revolutionary, you may have tried
these things already.

How are you running your .Net application? Are you running it
interactively or on a schedule? If you are running it from a scheduled
job you would need to make sure that it is running under a user account
that is in the Olap Administrators group.

Other than that maybe you could try running filemon and/or regmon from
www.sysinternals.com to see if there is some permissions issue that
msmdarch is having when run via process.start.

If you wanted to look into an alternative method of doing the archiving
Chris Harrington has a sample (written in VB6) which manually archives
cubes and stores them in .zip files to get around the 2Gb limit of the
MS .cab format.

You can find the addin here: http://www.activeinterface.com/b2005_03_
15.html

--
Regards
Darren Gosbell [MCSD]
Blog: http://www.geekswithblogs.net/darrengosbell

In article <1142892996.154642.240310 (AT) z34g2000cwc (DOT) googlegroups.com>,
RichHall (AT) Shaw (DOT) ca says...
Quote:
Managed to get at least a success/failure using the exit code property
of the instantiated process object

if (newProcess.ExitCode == 1)
DTSSuccessfullyConfigured = false;

- but you have to make sure that you use the WaitForExit() method.

I would still like to know if anyone has any ideas about why using
MSMDARCH.exe fails when running it through .Net Process.Start(), yet
succeeds when the MSMDARCH.exe executable is run manually at the
command line.

Ideas? comments? suggestions?

Thanks,

thotman wrote:
I initiate MSMDARCH.exe using the Program.Start() method in c# which is
supposed to unpack a CAB file used for an OLAP cube in MS Analysis
Services:

public static bool unpackDTSCAB(string dBServerName)
{
bool DTSSuccessfullyConfigured = false;
try
{
// unpack the CAB file
string ExePath =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles)
+ @"\Microsoft Analysis Services\Bin\msmdarch.exe";

string MSMADataPath =
Environment.GetFolderPath(Environment.SpecialFolde r.ProgramFiles) +
@"\Microsoft Analysis Services\Data\";

string DTSCabPath =
CommonConfigUtils.FindFile(@"\OLAP\OLAP_DB\TEST.CA B");

if (DTSCabPath == "" || DTSCabPath == null) return false;
string parameters = "/r " + dBServerName + " " + MSMADataPath + " "
+ DTSCabPath;
ProcessStartInfo ps = new ProcessStartInfo(ExePath,parameters);
ps.UseShellExecute = false;
ps.RedirectStandardOutput = true;
ps.RedirectStandardError=true;
Process newProcess = new Process();
newProcess.StartInfo = ps;
newProcess.Start();
newProcess.WaitForExit();


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.