How to - Run SQLPlus and script in Python ?
I want to have Python run command like this (on Windows) - and wait for completion
"sqlplus.exe myname/mypw@proddb @C:\Temp\test.sql"
commands module does not seem to work,
and subprocess module just launches sqlplus.
How have you done this ?
thanks
edit: I added the "r" pre-pend and this works: subprocess.call(r'sqlplus.exe myname/mypw@proddb @C:\Temp\test.sql', shell=False)
I think this forum is really concerned with using Python with cx_Oracle module. Your question isn't really anything to do with Oracle directly, but more like how to call another executable synchronously from Python. You're not getting the best from Oracle any Python if you only use Python to call SQL*Plus - certainly it'll be awkward if you want to process any of the results from the SQL*Plus call.
Similar Messages
-
How to run the open script code from eclipse?
Hi,
How to run the open script code from eclipse.
Please let me any soulutions on this.Hi Konda
I am not quite sure you can do that and it would even be not supported... Again, what is the purpose? Why do you want to run your openscript code in Eclipse?
What is the code you try to run?
As an example, even if you include al the jar files and so on. don't think the function "Launch Browser" could work because it isn't only java code orjar files.....
If you give us more background. maybe we can guide you to a better solution...
JB -
How to run unix shell script from java web applet
hi all
i have created one java applet. my apache web server is on unix server.
i have created one shell script in same directory where my .class and .htm files reside...
how to run this shell script from applet? it should search this .sh file on server and not on the client browser machine...
thanks in advanceI suppose you could make the shell script into a CGI, configure the server to execute CGIs, and then make the applet open the URL of that CGI.
-
How to run the SQL Script in SQL Prompt?
Hi ExpertGroup,
I have written one SQL Script name called "MySQLSCript.SQL". I want to know how to run the SQL Script in SQL Prompt?.
Generally, I run SQL Script in PL/SQL Developer tool. But In this case, some SET command is not working/supporting in PL/SQL Developer Tool.
Let me know, How to Run in SQl Prompt.
Thanks & Regards,
Senthil K Kumar.This is my SQL Script....
SET COLSEP '|'
SET LINESIZE 32767
SET PAGESIZE 50000
/* SET LINESIZE 3000
SET PAGESIZE 50000
SET DEFINE OFF */
SET ECHO OFF
SET FEEDBACK OFF
--SET HEADING OFF
SET TRIMSPOOL ON
SET NEWPAGE NONE
SET UNDERLINE OFF
SPOOL &&EnterPath;
SELECT * FROM &&TableName;
SPOOL OFF
SET FEEDBACK ON
--SET DEFINE ON
PROMPT Done.
I am able to run this script in SQL Prompt....
Its executing fine...
But, If I am executing again it maynot asking for new set of data....
alternativily its taking old values only.....
how can i exeute with new set of data in the sql prompt..... -
How to run mrp and capacity leveling through heuritics.
Hi,
How to run mrp and capacity leveling through heuritics.
What are the setps required for production planning run this thing in the heuritics in pp/ds?
Regards,
SunilSunil,
APO PP/DS doesn't have a 1-to-1 match for MRP/Cap levelling per se. There are, though, a limitless number of ways to achieve the results you want.
Start with a basic PP planning MRP - SAP_PP_002, which will should create all necessary planned orders
Then try a DS heuristic to schedule your orders according to capacity. Schedule Sequence SAP001 is a good starting point. This can be used to schedule your cap relevant work centers such that they fully load the capacity available, similar to cap levelling.
Rgds,
DB49 -
How to run an Oracle Script File
Hi,
Please anybody tell me how to run an Oracle script file (*.sql file) from Query template.
In SQL*Plus we run a script file as @Script_file_name.sql
how do we do it in Query Template.Dave,
Please only post your question in one thread at a time....
[SAP xMII synchronus commincation|SAP xMII synchronus commincation]
Sam -
How to run a sql script in oracle forms
Hi,
For me there is an sql script. I need to run that sql script in forms.
Actually we will run that sql file in pl/sql developer by giving @and the file name.
But how to run that file in forms.
Can any one help on these.Which book I have to look.
ThanksActually there is a script files which will drop all the indexes and tables.
DROP querry will be there for each index and each table.
So I run the script all the indexes and all the tables will be deleted. So using forms I have to run that script.
Thanks -
How to run a unix script from oracle warehouse Builder
Hi,
can any one share the information about, running the unix script or scripts using oracle warehouse builder.
Regards,
AkOne way is define a workflow. Inside the workflow you put
1)an external process that "points to" the shell script and then
2)put the mapping
The external process must have the "COMMAND" parameter set to the name of the shell script. If the script has parameters you must put them in the "PARAMETERS LIST" separated by "?" (for example, ?par1?par2).
The path where OWB executes the external process I think is the ORACLE_HOME of the OWB.
f you don't use workflow, you can try with this more complex solution. I tried with 9i and OWB 9.2 and it's working well.
You create an autonomous procedure (within a package or not) :
CREATE PROCEDURE Extract_Email_List
DECLARE
PRAGMA AUTONOMOUS_TRANSACTION;
And use the sys.shell script that you need your dba/unix admin to install first of all, with a call like that.
sys.shell('sh ' || txt_dir_name || '/send_email_marketing.sh ' || txt_dir_name || ' ' || email_addr );
Then you import your procedure into OWB and use it in your mapping with the "pre-mapping" icon (you can set parameters for your proc with constants if you want).
To implement sys.shell, go to metalink and find "Note:168065.1" - "How to call a UNIX shell script from PL/SQL".
Once it's done once, it's not so bad. But I would still recommend the workflow approach also..
I hope this helps. -
How to run the perl script from java ?
Hi , I need to run the pearl script from the server and to get the result of the script thro' java using SSH
Is there any 3rd party SSH API in java ?
Please help me out
thanks in advance
karthikThis seems like a very strange thing to want to do.
What is the perl script doing?
Do other programs (not some shell script) access this server-side perl script from a different machine?
If so how do they do it?
What currently triggers the perl script to execute?
What currently handles the output from the perl script?
If you can answer these questions (and understand the answers) you should be able to come up with a different approach to this.
You do not really want to call a remote perl script from a Java program, you want to achieve the effect you think that would have if you could do it.
So find the answers to the above questions, write them on 3" x 5" cards and lay them out on your desk.
What flow of control needs to happen? Which piece of code needs to produce or consume which piece of data?
If that fails, ask you self or who ever is making you do this what are the use-cases?
If you do not know what use-cases are or do not understand them well enough try reading
Use Case Modeling (The Addison-Wesley Object Technology Series) by Kurt Bittner and Ian Spence (Paperback - Aug 30, 2002)
http://www.amazon.com/s/ref=nb_ss_gw/002-7908514-4043267?url=search-alias%3Dstripbooks&field-keywords=use+cases&x=0&y=0
It is a short and easy to read book on the subject and also one of the best.
You MUST understand WHAT you are trying to achieve before you can decide HOW you are going to achieve it. -
How to run a shell script from the GUI?
This is probably a dumb question...
How do I run a shell script from the GUI? I've been told to double click it but when I do, it opens as a text file.The behavior you describe is that used by the KDE and GNOME desktops of Linux.
Under OS X, if you make a script then mark it as executable, double-clicking on it in the Finder will not execute it. Actually, it uses a rather complex algorithm ([summarized here|http://arstechnica.com/reviews/2q00/macos-qna/macos-x-qa-2.html]) to determine what to do with it. This is implemented in Mac OS X' LaunchServices framework (incidentally, the associations are cached in /Library/Caches/com.apple.LaunchServices*.csstore and ~/Library/Caches/com.apple/LaunchServices*.csstore). You can read the details in the developer docs about LaunchServices.
Anyway, in short, the suffix '.command' is a built-in type in the LaunchServices network that identifies a shell script. If you run
/System/Library/Frameworks/ApplicationServices.framework/Frameworks/LaunchServic es.framework/Support/lsregister -dump
... it will tell you as much. -
How to run multiple Test Script versions at once
HI
How to Run different versions of Test Scripts ( TCD record & SAP GUI) continiously.
Thankyou>
d s wrote:
> HI
> How to Run different versions of Test Scripts ( TCD record & SAP GUI) continiously.
>
> Thankyou
Hi DS,
If I understand your question correctly,you want to execute different version of TCD and SAPGUI continously,then please find the steps below:
1)Create a new script.
2)Call the individual scripts created in TCD and SAPGUI in the new script using REF command in the pattern you want to execute.
3)eCATT will automatically choose the relevant version automatically suitable for the system.
4)Maintain the input and output paramters in the main script.
5)Paramterize the input and output values.
6)Once the script is without errors,you can execute the scripts and they run continously.
Hope this answers your query.
Regards,
SSN. -
How I run a shell script from the scheduler on 10.2.0.2.0 ?
Hello Oracle People,
I'd like to run a shell script from the Scheduler in my 10g database.
Right now it is a simple shell script.
Eventually it will wrap RMAN commands to back up my DB.
I wrote a simple pl/sql script to create a job:
-- cr_job10.sql
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'my_backup_job',
job_type => 'EXECUTABLE',
job_action => '/h/oracle/scripts/tst.sh',
start_date => '06-SEP-07 5.33.00PM US/Pacific',
repeat_interval => 'FREQ=DAILY',
end_date => '08-SEP-07 4.00.00PM US/Pacific',
enabled => TRUE,
comments => 'My Backup Job');
END;
I see no errors when I run the above procedure.
I checked DBA_SCHEDULER_JOBS and the job is in there.
The scheduler, though, errors out with an error which I see in a trace file:
/h/oracle/admin/orcl/bdump/orcl_j000_22396.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /h/oracle/product/10r2
System name: SunOS
Node name: sol
Release: 5.10
Version: Generic_118855-14
Machine: i86pc
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 15
Unix process pid: 22396, image: oracle@sol (J000)
*** ACTION NAME:(MY_BACKUP_JOB) 2007-09-06 17:33:00.175
*** MODULE NAME:(DBMS_SCHEDULER) 2007-09-06 17:33:00.175
*** SERVICE NAME:(SYS$USERS) 2007-09-06 17:33:00.175
*** CLIENT ID:() 2007-09-06 17:33:00.175
*** SESSION ID:(140.13520) 2007-09-06 17:33:00.175
*** 2007-09-06 17:33:00.175
ORA-12012: error on auto execute of job 53267
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
I googled on this:
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
Google returned only 1 hit.
There, I see some evidence that I need to configure something inside
of Oracle to run shell scripts from the scheduler, but possibly just
for machines running windows. I'm running Solaris.
Do any of you know what I need to configure inside of Oracle to
run shell scripts from the scheduler?
-OwenHello people,
I should have added this bit of information:
"The script runs fine from oracle's crontab."
"The script runs fine from a shell owned by oracle."
I'm getting responses telling me to check my env variables and permissions
which would be helpful to a UNIX novice.
I have a feeling that no one is using the scheduler to run RMAN scripts.
Tim Hall suggested I take a close look at these files:
$ORACLE_HOME/rdbms/admin/externaljob.ora
$ORACLE_HOME/bin/extJob
Currently I'm setup like this:
bash sol root /h/oracle/product/10r2/bin 31 #
bash sol root /h/oracle/product/10r2/bin 31 # ll $ORACLE_HOME/rdbms/admin/externaljob.ora
-rw-r--r-- 1 root dba 52 Sep 7 15:29 /h/oracle/product/10r2/rdbms/admin/externaljob.ora
bash sol root /h/oracle/product/10r2/bin 32 #
bash sol root /h/oracle/product/10r2/bin 32 # cat $ORACLE_HOME/rdbms/admin/externaljob.ora
# externaljob.ora
run_user = rman
run_group = rman
bash sol root /h/oracle/product/10r2/bin 33 #
bash sol root /h/oracle/product/10r2/bin 33 #
bash sol root /h/oracle/product/10r2/bin 33 #
bash sol root /h/oracle/product/10r2/bin 33 # ll $ORACLE_HOME/bin/ext*
-rwsr-x--- 1 rman dba 30388 Sep 21 2006 /h/oracle/product/10r2/bin/extjob*
-rwsr-x--- 1 rman dba 30392 Sep 21 2006 /h/oracle/product/10r2/bin/extjobo*
-rwsr-x--- 1 rman dba 34468 Sep 21 2006 /h/oracle/product/10r2/bin/extproc*
-rwxr-xr-x 1 oracle dba 300 Sep 21 2006 /h/oracle/product/10r2/bin/extusrupgrade*
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 #
On my system, the user 'nobody' has no shell so I cannot use nobody.
I created a user named rman:
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 # su - rman
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$
$ id
uid=220(rman) gid=220(rman)
$
$
$ date
Fri Sep 7 16:30:03 PDT 2007
$
$
Jared points out that rman needs access to extproc:
$ ls -la /h/oracle/product/10r2/bin/extproc
-rwsr-x--- 1 rman dba 34468 Sep 21 2006 /h/oracle/product/10r2/bin/extproc
$
$
Here is a demo of rman running his script:
bash sol root /h/oracle/product/10r2/bin 35 # su - rman
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$
$
$ ls
scripts
$
$
$ scripts/tst.sh
$
$
$ cat scripts/tst.sh
#! /bin/sh
/usr/bin/date > /tmp/tst.sh.out.txt 2>&1 &
exit 0
$
$
$ cat /tmp/tst.sh.out.txt
Fri Sep 7 16:31:23 PDT 2007
$
$ rm /tmp/tst.sh.out.txt
$
I am focused on this error:
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
And I am focused on this exit code: 274662
What does 274662 mean?
If the Scheduler gives me an error like "274662" rather than some English,
it's obvious to me the Scheduler is a POS and I should not use it.
And of course,
If I cannot run RMAN from Oracle Scheduler, I'll use cron.
-Owen -
How to run an eCATT script in a cyclic mode?
Hi,
I want to run an eCATT script in a cyclic mode. i.e. It should be run for every 15 min.
Is there any option to do this?
Please revert back if you want any other info.
Thanks,
Nagarajan M,
9820586549Yes, java.lang.Runtime.exec().
Read this carefully before you do:
http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
Don't write a line of code before you're reviewed and understood the article completely. - MOD -
How to run a Calc script in ASO application
Hi,
I have gone through the Essbase Release 11.1.2 and I tried to implement the Calc scripts in ASO application.
When I tried to Create a Calc Script using Calc script editor for ASO Application in EAS console it say's "Calc script is not supported in ASO application". When i saved the Calc scripts it appears in Backend but it is not visible in EAS console.
I tried to call the Calc script using MDX script but it says "Unable to open the file Custom calculation terminated with Essbase error 1241109"
Can anyone help me how to work on Calc scripts in ASO application?
Thanks in advanceI think you might be confusing BSO calc scripts with ASO custom calcs, there is a whole section in the documentation on ASO calcs - http://docs.oracle.com/cd/E40248_01/epm.1112/essbase_db/aso_custcalc_alloc.html
There are also examples on the internet if you search spend some time researching.
Cheers
John
http://john-goodwin.blogspot.com/ -
Plz Tell how to run videos and Google play store i...
Hi ,
Plz Tell how to run videos of facebook and dailymotion and Google play store in Nokia asha 230 dual sim .
Plz tell i am Waiting for ur Reply .
Thanks
Birdwatcher89The Nokia Asha 230 does not run Android as operating system, therefore, the Google Play Store does not work. The operating system of your phone relies on a video streaming protocol called RTSP. Dailymotion does not support that anymore. I cannot comment about your Facebook issue. Perhaps someelse can.
Maybe you are looking for
-
The names of tags imported into Elements 11 from 4 show on the right of the screen. However they only show the taggged files when I click on one when I am in the Albums view on the left of the screen not when I am in the folder view? Am very new to
-
ITunes says iTunes Match is on, but it's not
So I let my iTunes Match subscription expire. I went to manually load songs onto my iPhone 6, but it says iTunes Match is on. I turned it off on my phone and on iTunes, so now it just prompts me to renew--I decline. I've tried logging out of iTunes,
-
Its throwing an error with order related billing
hi, sap gurus, in order related billing configuration settings its throwing an error like this "the items is not relevant for billing". plz show some way on this its urgent tommorrow is my delivery time regards, balaji.t 09990019711
-
This never happened for years, then for the past 6 months or so I ended up having to use other browsers because I could only use one Firefox window. Yesterday I uninstalled, redid profile and viola, firefox opens new windows, until I try to install t
-
How to change the securitey quistion for my apple id ?
how to change the securitey quistion in apple id