How to Call Multiple Sessions through Shell scripting
Dear Members,
I have a scenario where I load data into target table from 20 different source tables.
For this I have written three procedures where there exists an bulk insert executed on a same table in every procedure. Now I have to call these procedures simultaneously so that
all three bulk loads are executed at once in different sessions.
For this I have to write a shell script which opens 3 different sessions and execute all these packages at once.
Can you guide me through.
When you call sqlplus in your shell script, put a & at the end so that it runs the SQL scripts in the background. For instance:
#!/bin/bash
...oracle home stuff
$ORACLE_HOME/bin/sqlplus user/pass @script.sql &
$ORACLE_HOME/bin/sqlplus user/pass @script2.sql &
$ORACLE_HOME/bin/sqlplus user/pass @script3.sql &
Similar Messages
-
How to execute sql-queries through shell scripting in linux?
How to execute sql-queries through shell scripting in linux?
http://www.oracle.com/technology/pub/articles/saternos_scripting.html
Two simple examples:
#!/usr/bin/env bash
set_orafra () {
orafra=`echo 'set heading off
select name from v$recovery_file_dest;
exit' | sqlplus -s / as sysdba`
set_orafra
echo $orafra
#!/usr/bin/env bash
export ORACLE_SID=instance_name
export ORACLE_HOME=/path_to_oracle_home_directory
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export PATH=/$ORACLE_HOME/bin/$PATH
$ORACLE_HOME/bin/sqlplus -s <<EOF
connect scott/tiger@my_instance_name
INSERT INTO table VALUES (sysdate);
exit
EOFEdited by: Markus Waldorf on Sep 17, 2010 12:19 AM -
How to call a procedure from Shell Script
Friends,
How can i call a procedure from a shell script ? If any one know the answer , let me know immediately .
Thanks in advance .
ChakksWe connect using SQLPlus commands on the Unix server:-
Our code block is below:- We've got DBMS_OUTPUT in the procedure, hence the spooling. You don't need all this, but you do need the sqlplus directory, etc... in your profile.
sqlplus -s <<EOF > ${CREATE_LOG_FLE}
$UserName/$Password@$SID
SET SERVEROUTPUT ON SIZE 1000000;
spool ${CREATE_LOG_FLE}
EXECUTE $STORED_PROC(${Months}, ${DeleteRecords});
EOF
Hope that helps -
How we can call or execute a SHELL script through Oracle forms or Reports
How we can call or execute a SHELL script through Oracle forms or Reports.Its urgent.......
Use HOST command.
-
Calling sql through shell script
How do i call a sql file through shell script in unix ?
Rahul India wrote:
export ORACLE_HOME=$ORACLE_BASE/product/10g
cd $ORACLE_HOME
set `sqlplus -s <SCHEMA_NAME>/<SCHEMA_PASSWORD> <<EOF
@r_100.sql
exit;
EOF`THIS SCRIPT IS OK?You'll also need to set ORACLE_SID
And I don't know why everyone is putting the reference to sqlplus inside a "set" valuation, nor why they are putting the reference to the script in a redirected input stream. All you need is
sqlplus -s user/password @r_100.sqlAnd to insure the invironment is correctly set:
export ORACLE_SID=whatever
export ORAENV_ASK=NO
. oraenv
unset ORAENV_ASK=NO
sqlplus -s user/password @r_100.sql -
How to invoke multiple sessions of sql*plus thru pl/sql program
Hi
How to invoke multiple sessions of sql*plus thru pl/sql program.
ThanksHow to invoke sql*plus in a procedure?????
I have to invoke more pl/sql sessions?????No you don't "have to".
Look at what you are trying to do.
You have a program running inside the PL/SQL engine. This is running nicely inside the Oracle database and is perfectly capable of issuing other SQL statements, PL/SQL programs etc. inside it's nice cosy Oracle environment.
You are asking for this PL/SQL to shell out to the operating system, run an external application, for which it will have to supply a username and password (are you planning on hard coding those into your PL/SQL?), and then that external application is supposed to run more SQL or PL/SQL against the database.
a) Why hold all this code external to the database when it can quite happily reside on the database itself and be executed through jobs or whatever.
b) Consider what would happen if someone were to replace the external application with their own program of the same file name... they'd be able to capture the username and password for connecting to the database, therefore a major security flaw.
The whole idea of doing what you want through external calls to SQL*Plus is ridiculous. -
Calling HTML File in Shell Script.
Hi
I have a shell script and a HTML file.
HTML file is to create a Table.
the HTML Script is as follows
<html>
<body>
<table border="1">
<tr>
<td>Requisition Number</td><td>$PARAM0</td>
</tr>
<tr>
<td>Purcahse Order Number</td><td>$PARAM4</td>
</tr>
<tr>
<td>Purchase Line Number</td><td>$PARAM5</td>
</tr>
<tr>
<td>Hold Reason</td><td>$PARAM3</td>
</tr>
<tr>
<td>Hold Date</td><td>$PARAM2</td>
</tr>
</table>
</body>
</html>
The output of this HTML file is a table with 5 rows and 2 columns.
I saved this file as mail.html and placed it in the server where i have placed the Shell Script.
When i call this HTML in Shell Script ... as follow
cat /FND_TOP/bin/mail.html
the output is not the table but infact the html tags are displayed.
I need the table when i run this shell script.
It would be of great help if anyone has a good solution for this.
Thanks in AdvanceFirst, you need to put the file where your httpd server (you will need apache running) can find it. This is usually some place like:
/var/www/html/table.htmlThen use a text-mode browser as Frits suggested to render it so your script can read it:
#!/bin/sh
lynx -dump http://localhost/table.html | while read row; do
echo "${row}"
doneor how ever you want to process the data.
Another approach is to use XML transformations. First write an XML stylesheet:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fn="http://www.w3.org/2005/02/xpath-functions" version="1.0">
<xsl:output indent="no" method="text" standalone="yes" version="1.0"/>
<xsl:template match="*">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="td">
<xsl:text> </xsl:text>
<xsl:value-of select="normalize-space()"/>
</xsl:template>
</xsl:stylesheet>and then run your HTML through the {font:Courier}xsltproc{font} processor:
$ xsltproc table.xsl table.html
Requisition Number $PARAM0
Purcahse Order Number $PARAM4
Purchase Line Number $PARAM5
Hold Reason $PARAM3
Hold Date $PARAM2To be neat, I have omitted the many blank lines that were also output.
HTH -
HOW TO RUN BODS JOB THROUGH UNIX SCRIPT
Dear Experts
Please provide me the way how to call a job by a script .
I have used Export Execution Command as recommended by below links
http://scn.sap.com/docs/DOC-34648
http://scn.sap.com/community/data-services/blog/2012/08/22/sap-bods--running-scheduling-bods-jobs-from-linux-command-line-using-third-party-scheduler
But I am not able to locate .sh file in unix server .
This is required to call a job after completion of parent job.
Thanks
AnupamYou can check the status in "SAP Business Objects Data Services management Console", Below are the steps
Login in SAP Business Objects Data Services management Console
Click on Batch Job
Select the local repository
Then check your Job Execution status from there
For your second query there are two ways one is do the same activity what you have done in DEV.
below are the steps
Login in SAP Business Objects Data Services management Console and export the Jobs using export execution command from batch job
SHELL Scripts will be exported in Job Server Log
Move that SHELL script as per your location
Update the User environment variable same as DEV only difference is SID is changed
Thanks,
Daya -
Reading contents of asm through shell script
How to read contents of asm through shell script?
Please paste one small example also.
Thanks
BalaHello Bala,
The ASM contents is not visible from the operating system or its utilities. Only visible to database instances, RMAN, and other Oracle-supplied tools.
Please see http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/glossary.htm#sthref4105
Regards,
Rodrigo Mufalani
http://mufalani.blogspot.com -
Calling SQL statements from Shell scripts
Hi,
I want to call external package procedures, declare some variables & do some oracle validations in the shell script.
How SQL environment is set in shell script & is this one time process or I have to write few statements before every SQL statement.
Please explain with an example.
Thanks..is this one time process Yes. Example :
$ cat script.sh
export ORACLE_HOME=/home/oracle/base/OraHome10
export ORACLE_SID=db102
export PATH=$ORACLE_HOME/bin:$PATH
sqlplus -s / as sysdba << EOF
select to_char(sysdate,'dd/mm/yyyy hh24:mi:ss') date_time
from dual;
exit
EOF
sqlplus -s / as sysdba << EOF
col global_name for a60
select * from global_name;
exit
EOF
$ ./script.sh
DATE_TIME
27/02/2008 11:11:27
GLOBAL_NAME
DB102
$ -
How to place tif file through a script in an indesign document?
how to place tif file through a script in an indesign document?
Emanuele:
it works if i just run a script....
but since i have been using a gui to do some functions, this place command is not able to place the output tif file back into the document -
How to call the Jsp through BPM Obejct
Hi,
I have gone through the some topic, how to call the Jsp through BPM Object.
I have followed step below,
1. I have create the sample jsp page
2. Import into BPM studio under webroot\custom Jsp
3. Created the screenflow and added the "Interactive Component call" object
4. Right Click the Object and selected Maintask and Implementation type as "BPM Object Interactive Call"
5. Selected the use JSP presentation object option and when i click ok its showing "BPM instance object must be selected"
But when i select the Instance Variable tab, its not showing anything.
Can any one help me how to call the Jsp in screenflow with step by step procedure, that would be very greate help for me.
Regards,
Anandh PHi,
You are running a jsp report through rwservlet. In this case paper layout will be displayed. You have to deploy your jsp as web report to get the web layout. Please refer to the doc below, which describes how to deploy the web report.
http://download-uk.oracle.com/docs/html/B10314_01/pbr_run.htm#1011901
To run the jsp report, URL may look like
http://www.wwt.com/reports/<jsp name>?<parameter list>
Hope this helps
Vinayak -
How to call a subroutine in a script ?
Hi ,
How to call a subroutine in a script ?
bye,
Satya.Hello,
Syntax goes like this
/: PERFORM <form> IN PROGRAM <prog>
/: USING &INVAR1&
/: USING &INVAR2&
/: CHANGING &OUTVAR1&
/: CHANGING &OUTVAR2&
/: ENDPERFORM
INVAR1 and INVAR2 are variable symbols and may be of any of the four SAPscript symbol types.
OUTVAR1 and OUTVAR2 are local text symbols and must therefore be character strings.
Example:
In script form
/: PERFORM READ_TEXTS IN PROGRAM 'Z08M1_FORM_EKFORM1'
/: USING &EKKO-EKORG&
/: USING &EKPO-WERKS&
/: USING &EKKO-EKGRP&
/: USING &EKKO-BSTYP&
/: CHANGING &COMPNAME&
/: CHANGING &SENDADR&
/: CHANGING &INVCADR&
/: CHANGING &COMPADR&
/: CHANGING &COVERLTR&
/: CHANGING &SHIPADR&
/: CHANGING &REMINDER&
/: CHANGING &REJECTION&
/: CHANGING &POSTADR&
/: CHANGING &LOGO&
/: ENDPERFORM
In program
FORM Read_texts - To extract the standard texts from the table *
FORM READ_TEXTS TABLES IN_PAR STRUCTURE ITCSY
OUT_PAR STRUCTURE ITCSY.
DATA : L_EKORG TYPE EKORG,
L_WERKS TYPE WERKS_D,
L_BSTYP TYPE BSTYP,
L_EKGRP TYPE BKGRP.
READ TABLE IN_PAR WITH KEY 'EKKO-EKORG' .
CHECK SY-SUBRC = 0.
L_EKORG = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY 'EKPO-WERKS' .
CHECK SY-SUBRC = 0.
L_WERKS = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY 'EKKO-EKGRP' .
CHECK SY-SUBRC = 0.
L_EKGRP = IN_PAR-VALUE.
READ TABLE IN_PAR WITH KEY 'EKKO-BSTYP' .
CHECK SY-SUBRC = 0.
L_BSTYP = IN_PAR-VALUE.
CLEAR Z08M1_ORG_TEXTS.
SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
AND WERKS = L_WERKS
AND EKGRP = L_EKGRP
AND BSTYP = L_BSTYP.
IF SY-SUBRC NE 0.
SELECT SINGLE * FROM Z08M1_ORG_TEXTS WHERE EKORG = L_EKORG
AND WERKS = L_WERKS
AND EKGRP = L_EKGRP
AND BSTYP = SPACE.
ENDIF.
READ TABLE OUT_PAR WITH KEY 'COMPNAME'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COMP.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'SENDADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_ADRS.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'INVCADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_INVC.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'COMPADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_CPAD.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'COVERLTR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_COVR.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'SHIPADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_SHIP.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'REMINDER'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RMDR.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'REJECTION'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_RJCT.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'POSTADR'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_POST.
MODIFY OUT_PAR INDEX SY-TABIX.
READ TABLE OUT_PAR WITH KEY 'LOGO'.
OUT_PAR-VALUE = Z08M1_ORG_TEXTS-TXT_LOGO.
MODIFY OUT_PAR INDEX SY-TABIX.
ENDFORM.
Hope this helps.
Regards -
How To Call HTML Page Through Java Swing Page ???....
Hi All ;
Please Can You Tell Me How To Call HTML Page Through Java Swing Page ....
Regards ;Hi,
you can use HTML fragments on a panel.
http://java.sun.com/docs/books/tutorial/uiswing/components/html.html
However, to integrate a browser you need 3rd party software like IceBrowser
If you Google for: HTML Swing
then you find many more hints
Frank -
How to call multiple strus actions froma single jsp
how to call multiple strus actions froma single jsp, and that actions should be automatically called pls help me
Thanks in advancehow to call multiple strus actions froma single jsp, and that actions should be automatically called pls help me
Thanks in advance
Maybe you are looking for
-
Variable Iterator Refresh Problem
Hi, I have two method in application module that I dropped on a jspx page as two buttons and the method returns as af:outputtext on that page. When I press one of the buttons to invoke the related method, it clears the result of the other method. Bot
-
Two language recognition on Voice Control?
Hi, I'm Portuguese and therefore have a lot of Portuguese music on my iPhone, but also a lot of English (American, UK, etc) music. I find it very hard to try to say: "Reproduzir Of A Revolution" in Portuguese as well as "Play Carlos Paião" in English
-
Ive got an iMac with bootcamp on it. Recently my computer has slowed down and I want to restore it to factory settings. The format says mac osx extended (journaled), but its in grey. Also, the security options and erase buttons are gray. The only but
-
Problems with 2.1 iphone install.
Hi. I have just downloaded 8.0 itunes to my computer and have attempted to download 2.1 to iphone. Unfortunately, now I have an error message telling me to restore iphone to original factory settings. I don't want to lose my SMS history and messages
-
Bootcamp installation error in 10.6.8
Im running Snow leopard 10.6.8 and MacbookPro 5,3... 2.8ghz core 2 duo (late 2009) So recently my parallel's dekstop file had errors so i uninstalled it completely with clean my mac. So the next step for me is to install parallel's desktop 6 and the