Runing pentaho command from a scheduler (tidal) - pentaho

I am trying to execute the pentaho job over the windows through TIDAL, but the TIDAL does not execute the job at all. But when i run seperately on CMD PROMPT is executes.
The below is command used, IT does not the read the parameters assigned to it.
Kindly suggest on what has to be done.
E:\apps\Pentaho\data-integration\kitchen.bat /rep:Merlin_Repository /user:admin /pass:admin /dir=wwclaims /job=J-CLAIMS /level:Basic

You forgot a slash in /dir: option and you must use : not = symbols in your command.
For example in a windows batch script command
#echo off
SET LOG_PATHFILE=C:\logs\KITCHEN_name_of_job_%DATETIME%.log
call Kitchen.bat /rep:"name_repository" /job:"name_of_job" /dir:/foo/sub_foo1 /user:dark /pass:vador /level:Detailed >> %LOG_PATHFILE%`

Related

Passing a list as a parameter Pentaho

I have problem with use kitchen.bat in Pentaho.
I want to set parameters in form: 'test1','test2'.
I'm trying:
Kitchen.bat /rep:git /dir:TestCase/test /job:Job_1 "/param:ENV=QA" "/param:SOURCE=FIN" "/param:table_name='table1','table2'"
But when I see in log then I see that the list parameter is not passed. Anyone know how to set this up?
You can see my sample job and bat file, where i call the job using parameter value 'table1','table2' and also received that value from my job Here
D:\Development\data-integration70>"C:\Program Files\Java\jre1.8.0_45\bin\java.exe" "-Xms2024m" "-Xmx6048m" "-XX:MaxPermSize=1024m" "-Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2" "-Djava.library.path=libswt\win64" "-DKETTLE_HOME=" "-DKETTLE_REPOSITORY=" "-DKETTLE_USER=" "-DKETTLE_PASSWORD=" "-DKETTLE_PLUGIN_PACKAGES=" "-DKETTLE_LOG_SIZE_LIMIT=" "-DKETTLE_JNDI_ROOT=" -jar launcher\pentaho-application-launcher-7.0.0.0-25.jar -lib ..\libswt\win64 -main org.pentaho.di.kitchen.Kitchen -initialDir "D:\opt\CE\data-integration\weekly_data_transfer"\ /file:D:\opt\CE\data-integration\weekly_data_transfer\testenv.kjb "/param:table_name='table1','table2'" --level Minimal

TWS job is getting abended

While executing the job, I am getting below error
Job.sh is the script - while executing it in tws I am getting below error
path of the script - job.sh: sqlplus: not found
Can any please help on this
Thanks
I don't know how Tivoli works, but you are writing to run a "job.sh" script, so I assume it is a shell script.
Normally when working with oracle it is a good idea to enter absolute paths, so your script could be
#!/bin/sh
$ORACLE_HOME=<your path of oracle installation>
$ORACLE_SID=<your instance name>
$PWD=<Position of your sql script>
..........
$ORACLE_HOME/bin/sqlplus login/password #$PWD/script.sql
I hope that's what you were looking for.

Remote Netstat to STDOUT with WMIC?

I would like to use WMIC to retrieve the output of a "netstat" command on a remote computer. The actual execution of the following command executes without error and I see the output popup briefly within a new window:
wmic /node:server1 process call create "netstat.exe -ano"
With that being said, I need to pipe the output of the process window to STDOUT, and have tried:
wmic /node:server1 process call create "netstat.exe -ano > C:\temp\test.txt"
However, that does not work. I have also tried the /output:STDOUT option, however, that only reports the execution of the command:
Executing (Win32_Process)->Create() Method execution successful. Out Parameters: instance of __PARAMETERS {
ProcessId = 5044;
ReturnValue = 0; };
Does anyone know how I can go about using WMIC to retrieve the actual output from the new window that was opened in order to process the data?
Thanks in advance!
The > symbol behaves as operator of redirection in cmd.exe, not in netstat.exe.
In fact, wmic process call create "netstat.exe -ano > C:\temp\test.txt" is about to run the same as netstat.exe -ano ^> files\nstat.txt (try it from command line).
Next command works (unfortunately, I can't try it with /node:"server1" against a remote computer at the moment):
wmic process call create "cmd /C > C:\temp\test.txt 2>&1 netstat.exe -ano"

Using CMD to fire SQL rename stored procedure returns warning, stops script

I have a .BAT file that executes a few commands. Everything works fine until the SP_Rename, I get the following message returned:
Caution: Changing any part of an object name could break scripts and stored procedures.
And my next line on the CMD prompt window shows: 1> with a cursor. It should be executing the next line of code, but it does not.
Any ideas on how to get around this?
The message raised is Select * from sys.messages where message_id=15477.
You could get the procedure text via EXEC sp_helptext sp_rename,
remove the line raiserror(15477,-1,-1) and create a new procedure e.g. sp_rename_no_alert and use this for your batch operations.
How is your .BAT file structured? Is it a bunch of separate SQLCMD invocations one after the other, and it stops after the first one by leaving you at the "1>" prompt?
If that's the case, I don't think the caution is what is causing SQLCMD to leave you at the prompt. -Q (uppercase) instead of the -q parameter for running your query, as the lowercase -q will leave you at the prompt and wait for more input.
Example:
SQLCMD -Q "exec sp_rename(blah)"

Query remains active while calling a batch file from stored procedure in SQL Server2008

I created the following stored procedure:
CREATE PROCEDURE [dbo].[_StartWebcamStream]
AS
BEGIN
declare #command varchar(200)
set #command = 'C:\startStream.bat'
exec master..xp_cmdshell #command
END
for executing a the batch file startStream.bat. This batch contain the following code:
"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" -I dummy -vvv rtsp://mycamaddress/live_mpeg4.sdp --network-caching=4096 --sout=#transcode{vcodec=mp4v,fps=15,vb=512,scale=1,height=240,width=320,acodec=mp4a,ab=128,channels=2}:duplicate{dst=http{mux=asf,dst=:11345/},dst=display} :sout-keep}
The batch file is launched correctly, but the query continues to run until the vlc is stopped.
What can I do for stopping the query letting the vlc running?
DISCLAIMER: Don't run these examples in production!
SQL Server watches all processes spawned by xp_cmdshell and waits for them to finish. to see that you can just run this statement:
EXEC xp_cmdshell 'cmd /C "start cmd /K dir"'
This starts a command shell that in-turn starts another command shell to execute the dir command. The first shell terminates right away after spawning the second (/C switch) while the second executes the "dir" and then does not terminate (/K switch). Because of that second lingering process, even though the process that SQL Server started directly is gone, the query won't return. You cannot even cancel it. Even if you close the window in SSMS, the request continues to run. You can check that with
SELECT r.session_id, t.text
FROM sys.dm_exec_requests r
CROSS APPLY sys.dm_exec_sql_text(r.sql_handle) t
The NO_OUTPUT parameter does not help either:
EXEC xp_cmdshell 'cmd /C "start cmd /K dir"', NO_OUTPUT;
You will see the same "sticky" behavior.
The only way to get rid of these is to restart the computer or manually kill the processes (requires taskmanager to be executed as administrator). Restarting the SQL Server service does not stop the spawned processes.
As a solution you can use the SQL Agent. It has a "Operating System (CmdExec)" step type that you can use to run your program. You can create the job and then start it using sp_start_job.
Either way, your process actually needs to finish at some point. Otherwise you will create a pile of process-"bodies" that will cause performance problems in the long run.