Running PLSQL scripts and proC batches using OATS
Hi,
Could you please provide help / pointers to some documents that will help me test the batch programs and anonymous PLSQL blocks using OATS?
Thanks in advance.
You need to write some java codes...
SQL:
utilities.getSQLService().define("myaliasName", "oracle.jdbc.driver.OracleDriver",
"jdbc:oracle:thin:@machineName:1521:sid", "userName", "pwd");
-- Please pass appropriate values as per ur requirement.
String sql = oracle.oats.utilities.FileUtility.fileToString("C:/temp/MySqLfile.sql"); -- Ur SQL file name.
utilities.getSQLService().execute("myaliasName", sql);
CommandLines:
// Execute external command
runtime.getRuntime().exec(“yourscript.bat”); // for a Windows agent
runtime.getRuntime().exec(“yourscript.sh”); // for a Linux agent
I have written some codes (that I cannot find right now) where I connected to a Linux system to run remote commands (using plink.exe from windows box).
Be careful with path, user permissions and all the stuff.
JB
Similar Messages
-
Can servlets/ jsp automatically run perl scripts and executables?
I'm a student and am new to to servlets and web programming in general.
I need to know if it's possible to run perl scripts and executables automatically from servlets/ jsp.
The program I am planning on creating should have a client outside a firewall that uploads perl files to a gateway machine inside the firewall, the servlet should be able to run this perl file, and then pass the resulting file as an argument to an executable, to be run by another servlet on a different server.
I've tried looking everwhere for an answer to this and am about to revert to a cgi based approach because I'm not sure if it would work so any help/ suggestions would be much appreciated.Hallo,
I think using java Runtime will help. you can do Processes that execute shell or system commands through
Process process = Runtime.getRuntime().exec("your perl scripts here!");
Bye -
Running "nightly scripts" and other behind the scenes tasks
I keep seeing posts about how the iMac Intel runs nightly scripts and/or other tasks behind the scenes. There is no mention of this in the user manual nor does Apple warn you about not putting the computer to sleep so that these tools will run. My iMac hard drive is asleep every night (as am I...) how can I get these things to run manually? How often? And can someone point me to literature to support this info?
Thanks much,
HS522/2968
Hi HS,
"There is no mention of this in the user manual"
That's because the three nightly maintenance scripts are not important at all, and don't affect Mac OS X performance.
They are only a relic from the glorious Unix system times when it was used on rather small capacities HDs, on computers that were running non stop for months or years...
Running them yourself manually, as a "perfectionist measure", can be done easily using the "daily, weekly & monthly" features in OnyX or Cocktail for example. All three tasks together, once a month or so, is fine. No harm (but useless) rerunning them many times.
Litterature:
The KB article is quite old, it shows only the default 10.2 times and commands:
- http://docs.info.apple.com/article.html?artnum=107388
(almost same as 10.3 and 10.4 though)
What I really would like to learn, is whether the scripts have been modified in the Intel version of Tiger.
Could you please (or Joseph or somebody else), in Finder, Go To (shiftcommandG) this folder:
/private/etc/
see if there is still the same
/private/etc/periodic
folder, with the three
/private/etc/periodic/daily
/private/etc/periodic/weekly
and
/private/etc/periodic/monthly
scripts?
(I'm asking because I don't own an Intel Mac myself).
Next you would Go To (⇧⌘G) this folder:
/System/Library/LaunchDaemons
please, see if you find those three files
/System/Library/LaunchDaemons/com.apple.periodic-daily.plist
/System/Library/LaunchDaemons/com.apple.periodic-weekly.plist
and
/System/Library/LaunchDaemons/com.apple.periodic-monthly.plist
If they are still there, you can open them (with TextEdit if your Developer Tools are not installed), and read the default times when the tasks are scheduled to run.
Thanks in advance!
Axl -
When we use calculation script and when we use business rule
when we use calculation script and when we use business rule can anyone please tell me
Re the OP's question, here is an excellent introduction to Calculation Manager and business rules. It was the first hit when I googled "calculation manager hyperion".
http://ranzal.wordpress.com/2010/06/11/oracle-hyperion-calc-manager-%E2%80%93-part-1/
You can also go to odtug.com -- the Tech Resources section has a series of presentations on Calculation Manager, from beginner to intermediate.
The added benefit with business rules are that you can use variables and runtime prompts. You can also link planning with business rules and pass information from a web form into a business rules.^^^Only with Planning. There are no runtime prompts with Essbase in 11.1.2.2 but I hear it is coming back in 11.1.2.3
We can use Business Rule for all applications and it is GUI.^^^Doesn't have to be GUI-based. You can (depending on version) flip back and forth between GUI and script. I have not tried writing (nor can I actually think why you would want to do this) a Calc Mgr rule for multiple apps. Maybe you are thinking of a script object that can be called multiple times?
To check whether a calc script is executed or not you have to use the Essbase application database log file (Plan1.LOG)^^^As business rules are, sooner or later, translated to BSO (and hey, ASO too and HFM and Fusion and HPCM and they can differ, a lot, so this is not always true) calc script language, you can always check in the application log to see what is run if Planning or BSO Essbase.
Regards,
Cameron Lackpour -
Applescript Studio Beginner - Run a script and display a window
Hi,
I am new to applescript studio ; I found out how to make an application displaying a window with a progress bar.
How can I start running a script without displaying any window, and at some time in the script, run the "awake from nib" handler that will call the display of the progress bar ?
Thanks,
NicolasNicolas Silvestre wrote:
How can I start running a script without displaying any window, and at some time in the script, run the "awake from nib" handler that will call the display of the progress bar ?
The "awake from nib" handler is called automatically when your nib file gets loaded, you don't call it yourself. I suppose you could go thru the pain of putting your window into a separate nib file and then have your script load the nib file when you're ready... but that's not the easiest way to do it and you probably don't need to do this for your situation.
All you really need to do is go into Interface Builder, select your window object and uncheck the checkbox in the "Window Attributes" pane that says "Visible At Launch". The "awake from nib" will still be called at it's normal time and your window will be loaded but it will not be displayed.
Then you can do whatever other scripting you need to do... and when you're ready to display your window you simply call:
show window "yourWindowsAppleScriptName"
You can do your initial scripting at the beginning of "awake from nib" and then call "show window" at the tail end of "awake from nib" if that works for you. But you don't have to have the "show window" call in your "awake from nib"... you can call it later on in some other handler if you need to.
Steve -
SCCM 2012 application run Powershell script and return codes
Hi,
I created an new application (imported as MSI) in SCCM 2012R2. After import I changed the deployment type installation program to run a Powershell script: powershell.exe -ExecutionPolicy Unrestricted -File "Install FactSet 2013 5I.ps1
My goal is to close some processes before installing the MSI. This works. But on a failure the application program also return code 0 (AppEnforce.log). Is it possible to pass the MSI return codes to SCCM.
Maybe anyone had the same or idea's to solve this? Thanks in advance.
Regards,
Peter
Powershell script code:
$ExitCode=0
Function
Stop-RunningApplication{
Param(
[parameter(Mandatory
=$true)]
[string]$ProcessName#
Specify process names separated by commas
# Split multiple processes on a comma and join with the regex operator '|' to perform "or" match against
multiple applications
$processName=$processName-split(",")
-join("|")
$process=Get-Process|Where{
$_.ProcessName
-match$processName}
|Stop-Process-Force
#Stop running processes
Stop-RunningApplication
-ProcessName"excel,outlook,fdsw32,marquee,POWERPNT,WINWORD"
#Install FactSet 2013 5I
$ExitCode
=(Start-Process".\FactSet_Setup_2013_5I_x644.msi"'/qn
FACTSET_CLOSE_PROCESSES=1 /l*v C:\Temp\InstFac20135I.log'-Wait-Passthru).ExitCode
Environment]::Exit($ExitCode)
Peter vd BoschIt's really hard to tell from the code above because of the way it's listed, but are sure that even executes? I see at least one stray curly brace and a stray square bracket.
For the Start-Process cmdlet, have you tried without the -passthru parameter?
Also, using the actual parameters will make the code much more readable instead of relying on position.
Jason | http://blog.configmgrftw.com | @jasonsandys -
Costing run of SFG and FG by using 2 costing variant In Same c codeandplant
Dear CO Experts,
I Have Semi Finished Goods (SFG) and Finished Goods (FG)
At the time of Costing Run I don't want to add Admin& Selling Distribution Expenses for SFG.
For FG, I want to add Admin& Selling Distribution Expenses. So I created 2 Cost sheets and Assigned to 2 Costing Variants through 2 Valuation variants.
For Example
SFG Cost Sheet1
Material 100
Internal Activity Cost 10
SFG Cost 110 (By using 1st Costing Variant)
FG Cost Sheet2
Material 10
SFG 110
Internal Activity 5
125
Add: Admin& Sd Exp 25
(125*20/100) -
FG Cost 150 (By using 2nd Cost Variant).
How to run Mark and Release in Same Perid two costing variants. Please give you valuable inputs.
Thanks&Regards
Anil Kumar CHi!
To determine an overhead percentage rate using the overhead key, you
need to
1. assign a costing sheet to your order or valuation variant for
costing.
2. enter in the assigned costing sheet, overheads that use the overhead
key field. based on over head keys, over head rates can be defined.
3. assign the overhead key to an overhead group.
4 enter the overhead group in the material master record for the
material to be produced.
I think the above process will work for you.
regs
ramesh b -
How to run SQL script file on Linux using Java ?
Hi,
I need to execute .sql file using java. I used following approach for this.
private void runScriptEvent(java.awt.event.ActionEvent evt) {
String sqlOutput = "";
String sqlPromptLines="";
String currentFunctionName = "";
if(con!=null){
String userName = jTextField4.getText();
String password = jPasswordField1.getText();
String databaseName = jTextField3.getText();
try {
String script_location = "";
ProcessBuilder processBuilder =null;
Process process = null;
//File file = new File("C:/ScriptFile");
File file = new File("./SQL_Script");
//File file = new File("E:\\install\\SQL_Script");
if(file.exists()){
File [] list_files= file.listFiles(new FileFilter() {
public boolean accept(File f) {
if (f.getName().toLowerCase().endsWith(".sql"))
return true;
return false;
int count = 0;
for (int i = 0; i<list_files.length;i++){
script_location = "@" + list_files.getAbsolutePath();//ORACLE
//currentFunctionName = list_files[i].getName();
StringTokenizer st = new StringTokenizer(list_files[i].getName(), ".");
while(st.hasMoreTokens()) {
currentFunctionName = st.nextToken();
String extention= st.nextToken();
System.out.println("Function Name = "+currentFunctionName + "\t Extention = " + extention);
processBuilder = new ProcessBuilder("sqlplus",userName+"/"+password+"@"+databaseName, script_location); //ORACLE
processBuilder.redirectErrorStream(true);
process = processBuilder.start();
BufferedReader in = new BufferedReader(new InputStreamReader(process.getInputStream()));
String currentLine = null;
while ((currentLine = in.readLine()) != null) {
sqlPromptLines = " "+sqlPromptLines + currentLine +"\n";
count ++;
System.out.println(count+" " + currentLine);
if(currentLine.equalsIgnoreCase("Function created.")){
sqlOutput = "\n" sqlOutput currentFunctionName + " " currentLine"\n" ;
break;
}// end while
in.close();
process.destroy();
}//end for
}//end if file exists
} catch (IOException e1) {
jTextArea1.setText(e1.getMessage());
System.out.println("Script Done");
jTextArea1.append(sqlOutput);
}// end id Connection is not null
Above code working appropriate on Windows but not on Linux.
is there any changes needed ?
Regards,
Ajay
Edited by: Ajay Sharma on Nov 21, 2012 6:43 PMHi gimbal2,
about code
jTextArea1.setText(e1.getMessage());I am using this code so that the user will be prompted with a message rather than stack trace.
About the issue I am getting on linux i believe its because of following statement.
processBuilder = new ProcessBuilder("sqlplus",userName+"/"+password+"@"+databaseName, script_location); //ORACLERegards,
Ajay
Edited by: Ajay Sharma on Nov 23, 2012 12:05 PM
Edited by: Ajay Sharma on Nov 23, 2012 12:06 PM -
iMac 21.5"/IRISPRO/2.7QC/2x4GB/1TB OS Mavericks. When upgrading to Yosemite, time remaining is 8 minutes and freezed and don't go further for couple of 6 hours. What should I do now?
Force a restart by holding down the power button. See what happens.
-
Automator "Run Shell Script" and sqlite3 doesn't return a result
Hi,
I'm trying to implement an Automator application to remove "dead entries" from the Launchpads database.
My issue at the moment is, that I don't receive the result of the sqlite3 command.
Here how I have put the pieces together in Automator:
As you can see, the View Results is empty. I tried the same structure just with find instead of sqlite3 and I received the output.
Has someone a clue why it doesn't work with sqlite3?
ThanksDeleted. I misread the question.
-
How pass a parameter with forward slash to plsql script
Hi,
I am trying pass a parameter to plsql script from command line using sqlplus, and the parameter is a file directory and has '/'. Seems the system couldn't recognize the value.
here is my code in DECLARE:
l_FileDir VARCHAR2(200) := &&FileDir ;
I pass value '/usr/tmp' (with the single quote in the string)
Can someone tell me how I do it?
Thanks,
Kate
Edited by: user12100435 on Feb 25, 2010 8:31 AMuser12100435 wrote:
I think you are right. The issue is not file-separator character issue. because the exact same script run in another envoironment. And it's not file directory or permission issue because if I use hardcoded value, the code works fine.
The error message is invalid File directory.
Here is the related part of the code.
-- open file handler
IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
UTL_FILE.FCLOSE(l_FileHandler);
ELSE
l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
filename => l_FileName,
open_mode => 'W',
max_linesize => 32767 );
END IF;Ok, based on your input so far, I have cooked up a simple testcase.
Make sure you are doing something similar to this -
test@XE>
test@XE> -- show the contents of the anonymous PL/SQL script
test@XE> -- You are probably passing two parameters - the file location and the file name
test@XE> --
test@XE> ! cat test5.sql
DECLARE
l_FileHandler UTL_FILE.FILE_TYPE;
l_FileDir VARCHAR2(200) := '&1' ;
l_FileName VARCHAR2(200) := '&2' ;
BEGIN
-- open file handler
IF UTL_FILE.IS_OPEN(l_FileHandler) THEN
UTL_FILE.FCLOSE(l_FileHandler);
ELSE
l_FileHandler := UTL_FILE.FOPEN ( location => l_FileDir,
filename => l_FileName,
open_mode => 'W',
max_linesize => 32767 );
UTL_FILE.PUT_LINE(file => l_FileHandler, buffer => 'Hello, World!');
UTL_FILE.FCLOSE(file => l_FileHandler);
END IF;
END;
test@XE>
test@XE> -- execute it
test@XE> @test5.sql '/usr/tmp' 'first.txt'
old 3: l_FileDir VARCHAR2(200) := '&1' ;
new 3: l_FileDir VARCHAR2(200) := '/usr/tmp' ;
old 4: l_FileName VARCHAR2(200) := '&2' ;
new 4: l_FileName VARCHAR2(200) := 'first.txt' ;
DECLARE
ERROR at line 1:
ORA-29280: invalid directory path
ORA-06512: at "SYS.UTL_FILE", line 33
ORA-06512: at "SYS.UTL_FILE", line 436
ORA-06512: at line 10
test@XE>
test@XE> -- Create a directory object that points to "/usr/tmp"
test@XE> create directory log_dir as '/usr/tmp';
Directory created.
test@XE>
test@XE> -- now invoke the script
test@XE> -- Note - I pass the value "LOG_DIR" in uppercase. That's the name of my directory object.
test@XE> --
test@XE> @test5.sql 'LOG_DIR' 'first.txt'
old 3: l_FileDir VARCHAR2(200) := '&1' ;
new 3: l_FileDir VARCHAR2(200) := 'LOG_DIR' ;
old 4: l_FileName VARCHAR2(200) := '&2' ;
new 4: l_FileName VARCHAR2(200) := 'first.txt' ;
PL/SQL procedure successfully completed.
test@XE>
test@XE> -- Since my Oracle client is on the same machine as the Oracle server, I can check
test@XE> -- this file "/usr/tmp/first.txt" quite easily
test@XE>
test@XE> ! cat /usr/tmp/first.txt
Hello, World!
test@XE>
test@XE> isotope -
Run PLSQL code by click on button usin javascript
Hi
I want to run plsql code
on click button using javascript
javascript is ok but code of plsql is not run
suggest me
APEX 4.2.1
Oracle !!XE
Windows Server
Firefox 17.0.1
Theme Cloudy
thanks in advance
bUTTON CODE IN PLSQL CODE AND SEND_RMNDE IS PROCEDURE
'<button type="button" name="button1" onclick="send_rmndr('
||NO_DUES_MASTER.CERT_ID
||');" value ='
||NO_DUES_MASTER.CERT_ID
||'> '
||'Remind'
||'</button>'
JAVASCRIPT
<script type="text/javascript">
function send_rmndr(pThis)
var params='x= '+pThis;
var get=new htmldb_Get(null,null,null,&APP_PAGE_ID.,null,'send_reminder',params);
gReturn = get.get();
//alert(gReturn);
alert ('inside script ' +params);
//get=null;
</script>
Edited by: 969091 on Feb 1, 2013 9:13 PMsend_reminder needs to be defined as an application process
Alternatively, you can define a dynamic action and do this more declaratively.
It's easy to define a DA that fires on click of a button that runs PL/SQL, and you can also define which page items are sent to and received from the plsql via session state.
Scott
blog: [url grassroots-oracle.com]grassroots-oracle.com
twitter: [url twitter.com/swesley_perth]@swesley_perth
-- please mark any useful posts as helpful or correct, in the end it helps us all -
Hi all,
I need to run shell script on one of linux servers while executing some IdM workflow.
There is no need to manage that server/ provision accounts / reset passwords etc but just to run the script and to process the result.
I have IdM 8.04 installed on Windows Machine.
What are my options to achieve that mission?
Thank You,
Alex.I was considering a situation similar to AD after actions where sometimes we execute a dos batch file for any specific purpose like creating home folder using mkdir. I was thinking on similar lines if your shell script is also for a specifc function similar to the one I mentioned above and if it is applicable in windows environment, you might covert that into a dos batch and do similar to an after action.
Since you need your shell script to be run in UNIX / LINUX machine, I do not see any other way other than writing a java class and invoke within a wf as it was mentioned by etech or if you are planning on using any of the out of the box resource adapters, the AIX resource adapter reference might help, but I have not worked with that -
Running Shell scripts from the desktop
Hi,
I'm from the UNIX world rather than the mac one so have written a number of shell scripts. Lets call them foo.sh and bar.bash for the sake of argument.
These are sitting in a folder on my desktop
I can happily open a terminal session and run the scripts - and they work as I expect them to.
If I open a Finder window and double click on the icons for the scripts what happens is that it opens TextEdit.
Theres two things I'd like to change
A. I'd like to change the behaviour so that the scripts run when I double clike them rather than opening an editor (possibly in a terminal window )
B. I'd like to be able to change the editor from TextEdit to one I'm more used to...(I've installed Vim/Gvim which I quite like).
A. - Haven't managed to get anywhere trying to solve this....
B. - So far my attempts have got as far as...
1...
right-click -> open with -> Other -> select vim.app
tick Always open as
click open
The file then opens in a vim window.
however if I now close the vim application and double clike the file icon then the file opens in TextEdit again
2...
Right Click -> Get Info -> Open with VIM -> add -> Change all
message appears
'Are you sure you want to change all your Vimm.app documents to open with the application "vim.app"
This change will apply to all Vim.app documents with extension ".sh" '
click continue
In the Info pane the 'Open with' selection widget immediately changes to say 'Open with: TextEdit.app'
So I'm a bit stumped, can you help!
Regards
Mark
Mac Mini Mac OS X (10.4.3)Thanks to both people who answered.
You both gave me useful workarounds to my problem.
Renaming the scripts to be 'foo.command' was very hepful and useful to know. I tried this and it does indeed work. I may use this in the future.
I also had a play around with applescript and the automator to achieve similar results.
I agree that double clicking to run the file and also edit it is mutually exlcusive - I'm sort of trying to work out how I could make it do 'either/or' as I choose. In the Windows world i'd have the option of setting 'open' to run the script (assuming I'd got cygwin installed and had assiciated it) OR 'Edit with vim' if I wanted to edit the file (assuming vim was installed!).
Unresolved issue is that I'm still unable to get VIM to be associated with a .sh file.
The way I would envisage it working in Mac world would be to be able to right click on foo.sh -> Open with... and have a list to select from immediately there like..
Text Edit
Vim
Terminal (default)
and be able to somehow add and remove apps from the list and change which is the default.
My issue is that I don't seem to know how to get other apps than TextEdit to appear in the list - I suspect I need a better understanding of how these file/application associations work and are configured.
Regards
Mark -
Aborted calls at run external script step
hello everyone
when I was monitoring a script, I noticed a large percentage of calls are aborted on the node " run external script", and a few number of calls listed as " in process". only a small percentage of calls passed this node.
I would like to ask what does this "abort" means, does it mean the the call fails at this node, or the caller purposely terminate the call at this node.
thanks in advanceHi, David
thanks for replying me back
we are using IPIVR instead of CVP and system was under a really heavn load.
one RES was just simplely playing a prompt
Unfortunately some how, I couldn't get the log from IPIVR.
Maybe you are looking for
-
Drag and Drop game with only two targets
I created a drag and drop activity where their are five boxes that are supposed to go in to two columns in any order. I found a tutorial online that I based this activity off of. The problem is that the tutorial shows you how to make a target for eac
-
Hi, I have created a local varibale and stored my xml schema (xml structure) in it. I am using a sql query to fetch the records from databae and populating it to the schema using Assignment action block. But I have a requirement that one o
-
How to differentiate scaling information, condition or ratio info in me31k
hi, I am working on me31k contract, i am giving some values and saving it. Initially i was using CDPOS table to find whether change or delete is done. Now i have requirement of how to check whether it is scaling information, condition information or
-
Possible values for WDY_ATTRIBUTE_FORMAT_PROP-DATE_FORMAT?
Hi, where can I lookup possible values for formatting a date typed field using WDY_ATTRIBUTE_FORMAT_PROP-DATE_FORMAT? I did not find any documentation so far.
-
How to Access Attributes of Fields in VARIANT
Hi, Can anyone let me know how we can access Field attributes of a variant? I need to change and create these attributes dynamically. Below are the attributes of screen field saved when creating an variant Required field