Execute a sheel script (that is login to sqlplus and do some query) by ssh

I have two unix box. lets say...box1's ip is : a.b.c.d and box2's ip is : w.x.y.z
We have shared the public key by "ssh-keygen -t rsa" in both the box so that it will not prompt password for ssh connection.
Now, in the 2nd box I wrote a shell script (test.sh) like below..
#!/usr/bin/sh
ORACLE_HOME=/u01/app/oracle/product/11.1/client_1
echo "Hi..." > /popdb/batchApp/scripts/a.txt_1
$ORACLE_HOME/bin/sqlplus -s user/pass@sid <<EOF > /popdb/batchApp/scripts/a.txt
select * from dual;
EOF
now from the box1, I want to execute the tesh.sh by ssh..run the command below...
ssh [email protected] exec /full_path/test.sh
we got an error message like below...
Error 6 initializing SQL*Plus
Message file sp1<lang>.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
and also found that a.txt_1 is generated with the desired output but a.txt is generated as 0 byte file in box2.
Can anybody give some light on it....thanks..

Hi;
Please see:
SP2-0750 Error when Trying to Invoke SQLPlus Executable [ID 742952.1]
Login SQL*Plus Encountered SP2-0667 SP2-0750 even $ORACLE_HOME Has Set in Profile [ID 1075034.1]
"Error 6 initializing SQL*Plus : Message file sp1.msb not found" when invoking SQL*Plus Instant Client [ID 368277.1]
Regard
Helios

Similar Messages

  • Can anyone help me write a script that would click "get info" and then "enter" on each movie in my itunes library? I am asking because my itunes 11 repeatedly loses the artwork to my movies in my itunes library.

    Can anyone help me write a script that would click "get info" and then "enter" on each movie in my itunes library? I am asking because my itunes 11 repeatedly loses the artwork to my movies in my itunes library. I can restore the artwork (and make my apple tv see the movie exists as well) by going into the movie library and clicking on each movie by hand, slecting get info, and then selecting enter. Now doing this 10 times in 20 days was fun and all BUT I would really like to automate the process so everytime itunes screws it up I can fix it easier.
    I saw this example of an itunes script that restores artwork for music
    tell application "iTunes" set theSelection to selection repeat with i from 1 to count of theSelection tell (item i of theSelection) set artworkCount to count of artwork repeat artworkCount times set theArtwork to data of artwork 1 delete artwork 1 set data of artwork artworkCount to theArtwork end repeat end tell end repeat end tell
    but I need to tweak this to fit my needs for simply clicking the "get info" button and "enter" in the movie library rather than all the stuff this guy has listed. Any ideas or help on writing this? Thanks.

    Try assigning Queen as the Album Artist on the compilations in iTunes on your computer.

  • Is there a script that Quickly get the Equidistant and The same size images.

    Is there a script that Quickly get the Equidistant and The same size images.
    General,I used the paste into the interior one by one, when it is a lot ,will waste a lot of time

    Is there a script that Quickly get the Equidistant and The same size images.
    General,I used the paste into the interior one by one, when it is a lot ,will waste a lot of time

  • Need a VB-Script that read a txt-file and only the lines that are new since last time

    Hi,
    I need help to write a VB script that read all new lines since the last time.
    For example:  The script reads the textfile at specific time, then 10 minutes later the script read the file again, and it should now only read the lines that are new since last time. Anyone that has such a script in your scriptingbox?
    cheers!
    DocHo
    Doc

    Based on the excellent idea by Pegasus, where is a VBScript solution. I use a separate file to save the last line count read from the file, then each time the file is read I update the line count. Only lines after the last count are output by the program:
    Option Explicit
    Dim strFile, objFSO, objFile, strCountFile, objCountFile, strLine, lngCount, lngLine
    Const ForReading = 1
    Const ForWriting = 2
    Const OpenAsASCII = 0
    Const CreateIfNotExist = True
    ' Specify input file to be read.
    strFile = "c:\Scripts\Example.log"
    ' Specify file with most recent line count.
    strCountFile = "c:\Scripts\Count.txt"
    ' Open the input file for reading.
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strFile, ForReading)
    ' Check if the line count file exists.
    If (objFSO.FileExists(strCountFile) = False) Then
        ' Initial count is 0, so all lines are read.
        lngCount = 0
    Else
        ' Open the line count file.
        Set objCountFile = objFSO.OpenTextFile(strCountFile, ForReading)
        ' Read the most recent line count.
        Do Until objCountFile.AtEndOfStream
            lngCount = CLng(objCountFile.ReadLine)
        Loop
    End If
    ' Read the input file.
    lngLine = 0
    Do Until objFile.AtEndOfStream
        ' Count lines.
        lngLine = lngLine + 1
        strLine = objFile.ReadLine
        If (lngLine >= lngCount) Then
            ' Output the line.
            Wscript.Echo strLine
        End If
    Loop
    ' Close all files.
    objFile.Close
    If (lngCount > 0) Then
        objCountFile.Close
    End If
    ' Ignore last line of the file if it is blank.
    If (strLine = "") Then
        lngLine = lngLine - 1
    End If
    ' Save the new line count.
    Set objCountFile = objFSO.OpenTextFile(strCountFile, _
        ForWriting, CreateIfNotExist, OpenAsASCII)
    objCountFile.WriteLine CStr(lngLine + 1)
    objCountFile.Close
    Richard Mueller - MVP Directory Services

  • Need Help with logins for SQLPLUS and Database Control

    Hi,
    I am new to Oracle. I installed "Oracle 10g Standard Version" on Win XP Pro. I have two questions regarding logins:
    (1)     After installing the software I used “dbca” to create a General Purpose database. At the end of the database creation I clicked on the Password Management button and I entered the password for SYS, SYSTEM and SCOTT. Then at the DOS command prompt I typed “SQLPLUS” and I can login as SCOTT and system, but I cannot as login as sysdba or sysoper. I get invalid username/password; logon denied message.
    But I can type “SQLPLUS /NOLOG” and then issue command “connect /as sysdba” and connect successfully as sysdba. Any idea why I cannot login sysdba or sysoper?
    (2)     When I go to windows Start->All Programs->Oracle - OraDb10g_home1 and select “Database Control”. A browser windows open up Database Control page. I cannot start Listener nor Start up a Database Instance. No matter whether I try SYS, SYSDBA, SYSOPER or SCOTT I cannot login. Any idea what is going on here?
    At the SQLPLUS command prompt if I enter “select status from v$instance;” I get status as “OPEN”.
    I am lost in Oracle world as a typical newbie. Many thanks in advance for any advice or pointers.
    Thanks
    Joe

    (1) Yes I can login if I type "sqlplus / as sysdba". Does that mean "sysdba" doesn't have a password?
    (2) when I run "emctl status dbconsole", I get a message saying "Environment variable ORACLE_SID not defined. Please define it." Can someone tell me what should I do?
    Thanks
    Joe

  • Is there a script that automates mail:to links and hyperlinks?

    In a nutshell, maybe this was already done.  I searched the forum, but cant say I found what I was looking for.
    Jim Simon can be reached at [email protected]  Jim Simon work's gallery can be found at www.jsgallery.com.   Basic stuff like this.

    Automate Creation of Hyperlinks
    An InDesign CS2 JavaScript. Put it into the "Version 4.0 Scripts" folder to make it work in up-to-date versions of InDesign.
    Finds a string in text and creates a hyperlink based on the contents of the string. This script employs a hybrid approach to finding and changing text, using both JavaScript regular expressions and InDesign's search method.

  • What is the reason that auto login is not triggered on some web pages, while FF saved the credentials the first time that i logged on

    I'm trying to logon to my routers configuration webpage. While FF stored the loginname and password, it will not automatically logon. For other accounts it's just working fine. My router is an Cisco RV042

    The website might be using autocomplete=off to prevent Firefox from filling form data like name and password automatically.
    *http://kb.mozillazine.org/User_name_and_password_not_remembered
    Firefox won't auto-fill saved form data automatically when autocomplete=off is used and you need to start typing the name to get a drop-down list.
    You can check that with the Inspector via the right-click context menu.
    *https://developer.mozilla.org/Tools/Page_Inspector

  • Looking for a script that will size photos down and give unique filenames

    Here's the challenge:
    I have a bunch of photos that need to be sized down to three different types of thumbnails, each group of thumbnails needs to have a specific prefix to the filename while keeping the rest of filename in tact.
    So example:
    I start out with a photo 1400 x 933
    That photo needs to be sized down to 3 different smaller sizes: 630 x 420, 210 x 140 and 140 x93 (all of those have the same aspect ratio as 1400 x 933). So far this is a simple Action in Photoshop.
    The trick I can't figure out is that these photos need to have a specific file naming convention. Say for example the 1400 x 933 photo we start out with is named w_paul_001.jpg the other photos once sized down need to be: x_paul_001.jpg (for the 630x420), y_paul_001.jpg (for the 210 x 140) and z_paul_001.jpg (for the 140x93).
    How I do dat?

    This will do what you want:
    var srcDoc = app.activeDocument;
    var imgNum = srcDoc.name.substring(7, (srcDoc.name.length)-4);
    var myJpgQuality = 12
    var sizeArray = [
    [1400, 933, "x_paul_"],
    [630,  420, "y_paul_"],
    [100,  100, "z_paul_"]
    for (var i=0; i<sizeArray.length; i++)
      var shrinkWidth =  sizeArray [i][0];
      var shrinkHeight = sizeArray [i][1];
      var mySaveName = sizeArray [i][2];
      var id428 = charIDToTypeID( "Dplc" );
      var desc92 = new ActionDescriptor();
      var id429 = charIDToTypeID( "null" );
      var ref27 = new ActionReference();
      var id430 = charIDToTypeID( "Dcmn" );
      var id431 = charIDToTypeID( "Ordn" );
      var id432 = charIDToTypeID( "Frst" );
      ref27.putEnumerated( id430, id431, id432 );
      desc92.putReference( id429, ref27 );
      var id433 = charIDToTypeID( "Nm  " );
      desc92.putString( id433, mySaveName );
      executeAction( id428, desc92, DialogModes.NO );
      activeDocument.resizeImage(shrinkWidth, shrinkHeight, 72, ResampleMethod.BICUBIC);
      filePath = srcDoc.path + '/' + mySaveName + imgNum + '.jpg';
      var jpgFile = new File(filePath);
      jpgSaveOptions = new JPEGSaveOptions();
      jpgSaveOptions.formatOptions = FormatOptions.OPTIMIZEDBASELINE;
      jpgSaveOptions.embedColorProfile = true;
      jpgSaveOptions.matte = MatteType.NONE;
      jpgSaveOptions.quality = myJpgQuality;
      activeDocument.saveAs(jpgFile, jpgSaveOptions, true, Extension.LOWERCASE);
      app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);

  • Need a Script that will count different codes and enter in another field

    I am using ES2,  I have a form which users enter codes (50 different codes) in a code field.  I need for the corresponding toatl box for each code to increase by 1 for each time the corresponding code is entered.  Have just started using ES2 and any help would be welcome.
    TY

    I am using ES2,  I have a form which users enter codes (50 different codes) in a code field.  I need for the corresponding toatl box for each code to increase by 1 for each time the corresponding code is entered.  Have just started using ES2 and any help would be welcome.
    TY

  • How to create script that run sudo-command?

    I often need to run command:
    sudo "/Library/Application Support/VMware Fusion/boot.sh" --restart
    This needs to be run as admin.
    Can anybody tell me how to create script that will login as admin and run that command in terminal?
    Or from where can I get help how to add commands to a script?
    Thanks
    Tomi

    Your best bet on getting a cogent answer is to post to the Unix forum under OS X Technologies.

  • Essbase error 1033, executing a calc script through HAL

    A daily HAL job executes a calc script that returned a 1033 error.
    Any ideas? Essbase 7.1.6, HAL 7.3 build 327
    "error code - 1033: Essbase Error, <full path with calc script name> at ...."

    Sorry, no answer yet.
    Our job that failed which runs about 6 times daily successfully ran on the next scheduled run with zero changes. Some sort of hiccup (unexplainable).

  • Create a script that can create entire schema with data when run

    Hi,
    I need to create a script that creates the entire schema on a database when the script is run. the need is that the script should be capable of creating all schema objects with grants and all, including the table data.
    The same objective can be achived through export / import.But we don't want to deliver the dump files instead a script which will be executed on a database created with same database stucture of tablespaces etc.
    I have serched the net but yet to achive the goal.
    Is there any oracle utility / script file that can do this for me ?
    Can Oracle import be used to create the same, the way it is used to create index File ?
    Please suggest !!
    Regards

    You should look at the package dbms_metadata to be able to extract all ddl to recreate a schema. To load the data, you could write scripts that will generate insert statements and spool these to a file (sql generating sql), or you could write scripts that generates a delimited file and use sql loader to load the data into the target system. There are lots of little gotchas in either of these 2 solutions. The biggest 2 right away. 1 - picking a delimiter, 2 - dealing with carriage returns in text data. SQL Developer is able to do some extraction, so before you go writing this stuff yourself, I would check it out to see if it does what you are looking for before you reinvent the wheel.

  • Get system variable and execute a Java Script

    I'm not sure it is the appropriate forum to ask this
    question. I'm using Captivate 2 without LMS.
    I need to execute a java script that take read a system
    variable (eg. USERNAME) and opens an URL using the USERNAMe as
    parameter. The idea here is to update a database opening a specific
    URL for a specific USERNAME.
    Any one has an example to do something similar ?

    Hello All,
    Could anyone please help me with some examples or
    tutorials how I can create Java Applet to run telnet
    to UNIX and execute a shell script?
    Presumably you don't need to write the telnet code yourself (like for a class.)
    If so then you can use this...
    http://jakarta.apache.org/commons/net/
    There might be some other dependencies from other commons stuff that you will need to resolve to run it.
    Once you have that, presumably you are not telnetting back to the source of the applet. If so you will need to deal with security for the applet. Usually that means that you must sign the applet. Otherwise you will have to modify the policy file on each client machine that will run the applet.

  • Is there a plugin or script that will optimize my layout to maximize use of document space?

    I'm producing labels for museum gallery objects.  We are printing them on adhesive vinyl with peel off back (i'm not sure what the correct term is at the moment).  We pay for the labels by the sheet.  It costs the same whether I get 2 or 6 labels on an 8.5 x 11 sheet.  We get anywhere from 10 to 200+ of these labels print at a time so you can imagine it can be a challenging puzzle to maximize the use of space in order to minimize the wasted space on each sheet.  It is essentially the same issue that people using laser cutters or CNC routers run into.  The material is too expensive to let any real estate go unused unless necessary.
    Is anyone aware of a plugin or script that can process a document and move text boxes or objects around to the most economical arrangement possible?  I could also produce these labels in Illustrator if this issue cannot be addressed within InDesign.
    Thank you in advance for you advice!
    Brandon

    Well it look like Brandon lost interest when I mention the word "quote".
    Either way the basic algorithm is as below.  (lines 19 to 34 - the rest is just for decoration).
    I might put out a script on my site whenever it comes into existence that would do what Brandon is looking for, it would cost but not too much.
    This only works for fitting heights it will not make use of the horizontal spacing.
    To solve that it might be good to use what's know as the Hungarian Algorithm.  I don't have time for that to put it mildly.
    I've seen the problem referred to as the "Holy Grail" see Re: Is there a script available for arranging elements for optimal use of the printable area?
    Trevor
    // "Trevor's Fitting Algorithm" not optimized but considering the speed of the DOM operations that would be need the optimization would be pointless
    // Generate Random model of Text Frames of a range of heights to be fitted on pages of a given height
    // By Trevor www.creative-scripts.com (Still not there yet!)
    var st = +new Date, tt, frameCollection, pageN, a, aa, n, nFames, t, x, pageHeight, pageNumber = 1, safety, minFrameHeight, maxFrameHeight, xx, result;
    safety = 500; // just in case?
    nFames = 500; // The smaller this is the higher the fill % will be
    pageHeight = 210;
    minFrameHeight = 20; // The smaller this is the higher the fill % will be
    maxFrameHeight = 160;
    a = [];
    frameCollection = [];
    pageN = [];
    xx = 0;
    for (n = 0; n < nFames; n++) {a[n] = ["#" + n ,~~(Math.random() * (maxFrameHeight - minFrameHeight + 1)) + minFrameHeight];}
    a.sort(function (a,b) {return a[1] < b[1]});
    aa = a.join(", ");
    // This is the "Trevor Fitting Algorithm"
    while (a.length && safety--) {
    frameCollection =[];
    t = 0;
        for (n = 0; a[n] != undefined; n++) {
            x = a[n][1];
            if ((t + x) > pageHeight) continue;
            t += x;
            frameCollection.push(a[n]);
            a.splice(n,1);
            n--;
        a.shift();
        x = ~~(100* t / pageHeight);
        xx += x;
    pageN.push("Page [" + pageNumber++ + "] frameCollection: " + frameCollection.join(", ") +
        " \tHeight Used: " + t + ", " + x + "%")
    // Show the Results
    x = pageN.length;
    tt = "\nTook " + ((new Date - st)/1000) + " seconds\n";
    result = "\"Trevor's Fitting Algorithm\" not optimized but considering the speed of the DOM operations that would be need the optimization would be pointless\
    Generates Random model of Text Frames of a range of heights to be fitted on pages of a given height\
    By Trevor www.creative-scripts.com (Still not there yet!)\n******************************\
    A Random Collection of " + nFames + " Text Frames\nHeights Between " +
    minFrameHeight + " and " +  maxFrameHeight +
    " Whatchamacallits\nFitted on " + pageNumber +
    " Pages " + pageHeight + " Whatchamacallits Tall\nAverage Page Filling: " + ~~(xx/x) +
    "%\nThe # Before the Text Frame Number is it's Index (Would really use ID) this is followed by the Height of The Text Frame" + tt +
    "These are the Sorted Random Text Frame Heights\n\n" +
    aa + "\n\n" + pageN.join("\n") +
    "\n\nLast Page Get's the Left Overs - So Might be Quite a Low % Fill\
    Average Page Filling: " + ~~(xx/x) + tt;
    //$.writeln(result);
    var w = new Window ('dialog', '"Trevor\'s Fitting Algorithm"'),
        e = w.add('edittext', undefined, result, {multiline: true});
    /* some fun and games for muti screens */ var sc = $.screens.length, h, wd, c = 0, t; h = ($.screens[0].bottom - $.screens[0].top); wd = ($.screens[0].right - $.screens[0].left); while (sc--) {    t = $.screens[sc].bottom - $.screens[sc].top;    if (t < h) h = t;    t = ($.screens[sc].right - $.screens[sc].left);    if (t < wd) wd = t;};
    e.preferredSize = [.85 *wd, .85* h];
    w.show()

  • Script that enables Remote Management and adds user

    I need to make a script that can enable Remote Management and add a user to control it.
    I have tried to watch which plist files it uses so I could edit those.
    It writes some text in com.apple.RemoteManagement.plist and com.apple.ARDAgent.plist bit I can't find where the user is added.
    Any ideas guys
    Thanks

    No need to mess around with .plists. ARD has a command-line admin tool. The syntax is a little funky, but this should give you an idea:
    $ sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/k ickstart -activate -configure -access -on -users john -restart -agent -privs -all
    This is all covered in more detail in Apple's technote.

Maybe you are looking for