COGNOiSe.com - The IBM Cognos Community

IBM Cognos 10 Platform => Cognos 10 BI => Transformer => Topic started by: Bindiya on 13 Aug 2013 04:24:12 PM

Title: Building a cube through a batch file does not work
Post by: Bindiya on 13 Aug 2013 04:24:12 PM
Hi,
I am trying to build cube through a batch file and start it using windows scheduler. The scheduler task is appropriately triggering the batch file, executing first few commands (stuff like clearing folders etc) and when it comes to executing cogtr.exe it is kind of hanged. When checked the cube log file it just wrote the preferences defined but nothing else (see below). Can some help me on this?

One more question..
cogtr.exe -n -g -s -c -m"Sales.mdl". This is the command I used. Although -n (interactive mode) is used why is the transformer window not opening up? It is not even opening the command prompt window. But I see these processes in task manager means that they are called. But CPU time is 0 means that it is not building cube. Why?

The same code worked fine in TEST environment and it opened the command prompt and transformer application (not the model file) and is creating log with full information and is successfully building cube.

LogFileDirectory=C:\Transformer\Logs\
ModelSaveDirectory=C:\Transformer\Models\
DataSourceDirectory=..\data\
CubeSaveDirectory=C:\Transformer\PowerCubes\
DataWorkDirectory=..\temp\
ModelWorkDirectory=..\temp\
MaxTransactionNum=500000
Product locale: English (en)
Run locale: English (United States) (en-us)
Codepage: windows-1252

Transformer  Tue Aug 13 15:54:08 2013


Thanks for your help.
Title: Re: Building a cube through a batch file does not work
Post by: Bindiya on 14 Aug 2013 11:53:39 AM
Today, when I changed a security option (of windows task scheduler) from "Run whether user is logged on or not" to "Run only when user is logged on", this is bringing the applications to interactive mode and is opening the command prompt and transformer and is successfully building cube. I.e. "Run whether user is logged on or not"- will run job in hidden mode. "Run only when user is logged on" - will run job in interactive mode.

But why it is not working for this "Run whether user is logged on or not" option?

Looks like it is something to do with task scheduler properties because, when the batch script is double clicked (with cogtr.exe -n or -n2 options i.e. interactive or hidden modes) it works fine. So it finally comes to one option where the scheduled job in windows scheduler is run in hidden mode cube is not getting successfully built. It is just writing preferences in log file and exiting.

Any suggestions?
Title: Re: Building a cube through a batch file does not work
Post by: mmcalli on 20 Aug 2013 03:20:46 PM
Quote from: DiyaRachana on 13 Aug 2013 04:24:12 PM
cogtr.exe -n -g -s -c -m"Sales.mdl". This is the command I used. Although -n (interactive mode) is used why is the transformer window not opening up?

If you want it to run in batch mode, you need to use the -n2 command line option, not -n.

Mike
Title: Re: Building a cube through a batch file does not work
Post by: Grim on 21 Aug 2013 12:53:38 PM
It also depends how your cube is configured datasource wise. It may require a specific user to be logged in if your connecting to a SQL server with LDAP credentials.
Title: Re: Building a cube through a batch file does not work
Post by: Bindiya on 29 Aug 2013 04:17:36 PM
Mike,
we initially used -n. As it is interactive mode we expected the transformer window to open up. But it was not happening that way. We also tried -n2 (batch mode) even then cubes are not getting built.

Grim,
We have the single signon setting done in cube. Should anything else be checked?

Thank you all for replies.
Title: Re: Building a cube through a batch file does not work
Post by: bdbits on 03 Sep 2013 02:17:34 PM
Is the scheduled task running with the same credentials as the logged-on user? And the credentials have the necessary permissions to the files (like the model) and data sources needed?

You really should not be trying to open the window if you are running it as a scheduled task and not logged on. Since that is a security risk, Windows may prevent that from working. You really want to use -n2 and make sure the credentials are set properly.

I have noted that there are times during the build process when it looks like cogtr is not doing anything CPU-wise. I think this is when it is requesting information from the data source, but I am not entirely certain of that. It does not usually last terribly long, but can be a bit disconcerting.