I have created a script which runs a series of other instances in shell using the while command. But the problem is that one of the job is connecting to sql plus and running the remaining command under sqlplus.
For ex. my input file --> job.txt
job1
job2
job3
Now, using the below script I am calling job one by one. So, until the present job is finished next job wont start. But the catch comes when the job tries to connect the sql plus. After it connects to sql plus, the process id of the current job gets complete and remaining jobs run as the sql statement in unix env.
while read line;
do
$job1
done < job.txt;
Error message I am getting in sqlplus after current instance exits.
SP2-0042: unknown command
How can I avoid bringing the jobs under sqlplus.
I have set of commands which I am trying to run in a " Execute windows batch command" in Jenkins.
I am facing issues as the complete set of command do not run, but jenkins marks the build as success.
Command 1
Command 2 # This command takes almost 90 minutes to complete
command 3 # This never runs
I am trying to understand if there is a timeout associated here. What are the ways to overcome this problem.
I'd like to call an ODI Scenario from command line and wait until its done. I am using ODI 12c and installed a standalone agent. I already found out that you can use the startscen.cmd command and it works for me. The only problem is that cmd is not waiting for the scenario to be done. Any Suggestions to achieve sth like that?
My .bat-file looks like this:
cd C:\Oracle\Middleware\Oracle_Home\user_projects\domains\base_domain\bin
call startScen.cmd "-INSTANCE=CITestAgent" MAPPING 1_0_0 GLOBAL "-SESSION_NAME=TEST_RUN" "-AGENT-URL=http://localhost:20910/oraclediagent"
cd C:\Users\Redekera\documents\testFiles
"C:\Users\REDEKERA\Documents\instantclient_19_3\sqlplus.exe" db_user/pw#db/scheme #run_tests_lieferschein.sql
After that command i'd like to run an sql via sql*plus, which needs to wait until the scenario has finished.
Thanks for help guys :)
By default startscen.cmd will wait for the end of the execution to return.
This can be changed with parameter -ASYNC=yes to start the execution asynchronously. In that case it would return the SESSION number that is useful to check the status of execution.
If you want the second command to execute only if the first exited successfully:
execute scenario command && sql*plus command
Extracted from here
The main idea is the “&&” sign!
I'm trying to chain together two commands:
The first in which I start up postgres
The second in which I run a command meant for postgres(a benchmark, in this case)
As far as I know, the '||', ';', and '&/&&' operators all require that the first command terminate or exit somehow. This isn't the case with a server that's been started, so I'm not sure how to proceed. I can't run the two completely in parallel, as the server has to be started.
Thanks for the help!
I would recommend something along the lines of the following in a single bash script:
Start the Postgres server via a command like /etc/init.d/postgresql start or similar
Sleep for a period of time to give the server time to startup; perhaps a minute or two
Then run a psql command that connects to the server to test its up-ness
Tie that command together with your benchmark via &&, so it completes only if the psql command completes (depending on the exact return codes from psql, you may need to inspect the output from the command instead of the return code). The command run via psql would best be a simple query that connects to the server and returns a simple value that can be cross-checked.
Edit in response to comment from OP:
It depends on what you want to benchmark. If you just want to benchmark a command after the server has started, and don't want to restart the server every time, then I would tweak the code to run the psql up-ness test in a separate block, starting the server if not up, and then afterward, run the benchmark test command unconditionally.
If you do want to start the server up fresh each time (to test cold-start performance, or similar), then I would add another command after the benchmarked command to shutdown the server, and then sleep, re-running the test command to check for up-ness (where this time no up-ness is expected).
In other case you should be able to run the script multiple times.
A slight aside: If your test is destructive (that is, it writes to the DB), you may want to consider dumping a "clean" copy of the DB -- that is, the DB in its pre-test state -- and then creating a fresh DB, with a different name from the original, using that dump with each run of the script, dropping it beforehand.
My jmeter script stops execution after while loop is executed and further operations are aborted and script is halted.
I am using ${lineNo} as condition for while, ${lineNo} is the name of first column in .csv file.
You probably have stop threads on EOF set to true in your CSV Config, change it to false.