Shell Script Error

Hello:
I am getting a error when running a process flow which is calling a shell script. The process flow has a simple user defined activity and the parameters are set up this way
COMMAND: /bin/bash
Parameter List:
Result code:
Script: /bin/ls -l > /oraapp/datos/ficheros/sv/a.lst
Success Threshold: 0
First i have the error: RPE-02248: For security reasons, activity operator Shell has been disabled by the DBA., then the Administrator set property.RuntimePlatform.0.NativeExecution.Shell.security_constraint to NATIVE_JAVA an now the error is this:
Error en Proceso: PRUEBA_SHELL , Mapping: USER_DEFINED
INFORMATIONAL: 01:05:27 15-MAY-09 90778 90769 RPE-02229: The following debug information was collected:
INFORMATIONAL: 01:05:27 15-MAY-09 90778 90769 RPE-02230: Debug Information: os.name = SunOS
INFORMATIONAL: 01:05:28 15-MAY-09 90778 90769 RPE-02230: Debug Information: os.version = 5.8
INFORMATIONAL: 01:05:28 15-MAY-09 90778 90769 RPE-02230: Debug Information: os.arch = sparc
INFORMATIONAL: 01:05:28 15-MAY-09 90778 90769 RPE-02230: Debug Information: user.name = ora10
INFORMATIONAL: 01:05:28 15-MAY-09 90778 90769 RPE-02230: Debug Information: user.dir = /oraapp/app/oracle/product/102WB/owb/bin/unix
INFORMATIONAL: 01:05:29 15-MAY-09 90778 90769 RPE-02230: Debug Information: argv.arg0 = /bin/bash
INFORMATIONAL: 01:05:29 15-MAY-09 90778 90769 RPE-02230: Debug Information: argv.arg1 = {Task.Input}
INFORMATIONAL: 01:05:29 15-MAY-09 90778 90769 RPE-02230: Debug Information: argv.stdin = /bin/ls -l > /oraapp/datos/ficheros/sv/a.lst
INFORMATIONAL: 01:05:29 15-MAY-09 90778 90769 RPE-02230: Debug Information: ORACLE_SPAWNED_PROCESS = 1
INFORMATIONAL: 01:05:29 15-MAY-09 90778 90769 RPE-02230: Debug Information: ORACLE_BASE = /oraapp/app/oracle
INFORMATIONAL: 01:05:30 15-MAY-09 90778 90769 RPE-02230: Debug Information: LD_LIBRARY_PATH_64 = /oraapp/app/oracle/product/102WB/lib:../../../discoverer/lib:/oraapp/app/oracle/product/102WB/owb/bin/admin:
INFORMATIONAL: 01:05:30 15-MAY-09 90778 90769 RPE-02230: Debug Information: HZ = 100
INFORMATIONAL: 01:05:30 15-MAY-09 90778 90769 RPE-02230: Debug Information: PWD = /export/home/ora10
INFORMATIONAL: 01:05:30 15-MAY-09 90778 90769 RPE-02230: Debug Information: _ = /oraapp/app/oracle/product/102/bin/sqlplus
INFORMATIONAL: 01:05:31 15-MAY-09 90778 90769 RPE-02230: Debug Information: ORACLE_SID = cdid2
INFORMATIONAL: 01:05:31 15-MAY-09 90778 90769 RPE-02230: Debug Information: PORT = 1522
INFORMATIONAL: 01:05:31 15-MAY-09 90778 90769 RPE-02230: Debug Information: SERVICE = CDID2
INFORMATIONAL: 01:05:31 15-MAY-09 90778 90769 RPE-02230: Debug Information: NLSPATH = /usr/dt/lib/nls/msg/%L/%N.cat
INFORMATIONAL: 01:05:32 15-MAY-09 90778 90769 RPE-02230: Debug Information: OCM_HOME = /oraapp/app/oracle/product/102WB
INFORMATIONAL: 01:05:32 15-MAY-09 90778 90769 RPE-02230: Debug Information: NLS_LANG = AMERICAN_AMERICA.WE8ISO8859P1
INFORMATIONAL: 01:05:32 15-MAY-09 90778 90769 RPE-02230: Debug Information: HOME = /export/home/ora10
INFORMATIONAL: 01:05:32 15-MAY-09 90778 90769 RPE-02230: Debug Information: HOSTNAME = cor0003s059
INFORMATIONAL: 01:05:32 15-MAY-09 90778 90769 RPE-02230: Debug Information: NODEID = 1
INFORMATIONAL: 01:05:33 15-MAY-09 90778 90769 RPE-02230: Debug Information: RTHOME = /oraapp/app/oracle/product/102WB
INFORMATIONAL: 01:05:33 15-MAY-09 90778 90769 RPE-02230: Debug Information: LD_LIBRARY_PATH = /oraapp/app/oracle/product/102WB/jdk/jre/lib/sparc/client:/oraapp/app/oracle/product/102WB/jdk/jre/lib/sparc:/oraapp/app/oracle/product/102WB/jdk/jre/../lib/sparc:/oraapp/app/oracle/product/102WB/lib32:../../../discoverer/lib:/oraapp/app/oracle/product/102WB/owb/bin/admin:
INFORMATIONAL: 01:05:33 15-MAY-09 90778 90769 RPE-02230: Debug Information: SKGP_HIDDEN_ARGS =
INFORMATIONAL: 01:05:33 15-MAY-09 90778 90769 RPE-02230: Debug Information: OWB_HOME = /oraapp/app/oracle/product/102WB
INFORMATIONAL: 01:05:34 15-MAY-09 90778 90769 RPE-02230: Debug Information: LOGNAME = ora10
INFORMATIONAL: 01:05:34 15-MAY-09 90778 90769 RPE-02230: Debug Information: ORACLE_HOME = /oraapp/app/oracle/product/102WB
INFORMATIONAL: 01:05:34 15-MAY-09 90778 90769 RPE-02230: Debug Information: SHELL = /usr/bin/bash
INFORMATIONAL: 01:05:34 15-MAY-09 90778 90769 RPE-02230: Debug Information: MACHTYPE = sparc-sun-solaris
INFORMATIONAL: 01:05:35 15-MAY-09 90778 90769 RPE-02230: Debug Information: IAS_HOME = /oraapp/app/oracle/product/102WB
Thanks
Edited by: user11136124 on 15-may-2009 5:36

Hi
needed to change the following file on server
$OWB_HOME/owb/bin/admin/Runtime.properties
the following parameters are disbaled by default, change to NATIVE_JAVA :
property.RuntimePlatform.0.NativeExecution.FTP.security_constraint = NATIVE_JAVA
property.RuntimePlatform.0.NativeExecution.Shell.security_constraint = NATIVE_JAVA
property.RuntimePlatform.0.NativeExecution.SQLPlus.security_constraint = NATIVE_JAVA
and then bounce the Control Center service using:
<owb-home>/owb/rtp/sql/stop_service.sql
<owb-home>/owb/rtp/sql/start_service.sql
Cheers
Nawneet

Similar Messages

  • Automator and "Run Shell Script" error

    First, if I'm in the wrong place with this- sorry. Figured this was an OS kind-of thing.
    I recently migrated to a new iMac ... I brought along an Automator script; I've been using it for years to perform a little rsync backup to an USB HDD. It's 'never' given me any problems ... until now!
    "*Run Shell Script*" encountered an error .. but alas, the system log is devoid of messages ... and the verbose log I have running indicates that all the files are copied/backed-up ... I would love any input on this that might help me get back on the feet. .....
    *Here's what my Shell Script Looks like:*
    Shell Option: /bin/bash
    Pass Input: to stdin
    rm -dfr '/Volumes/Backup HD/*********'
    rm -dfr '/Users/***********/Library/Logs/Profile_Backup.log'
    rsync -rltv /Users/******** '/Volumes/Backup HD/' > /Users/*******/Library/Logs/Profile_Backup.log
    (I'm sure there's way to only sync the changed stuff between backups ... but I've simply preferred the fresh copy approach).
    *I do however note this in my logs when I open Automator:*
    12/14/10 3:15:46 PM [0x0-0x42042].com.apple.automator.Backup[464] Application Stub: OpenScripting.framework - scripting addition "/Library/ScriptingAdditions/Adobe Unit Types.osax" declares no loadable handlers.

    @Tony T1
    Thanks, I'll certainly adjust the log file as suggested
    In troubleshooting the problem I went the terminal route - and issued each command ... during the rsync process I was getting an error ... turns out when it was syncing the SyncServices folder it was encountering a copy of the keychain ... which had root permissions - naturally rsync was not able to copy the file (personally I have no idea why the keychain would be being sync'd with anything)!
    I removed the file from the sync ... I'm still doing some "debugging" to correct the problem-
    Again, thanks for the assist!

  • UNIX shell script error

    HI
    I am using below shell script to deploy components on server. I am facing issues while running this script from unix shell.
    any help will be great.
    Please find the script file attached.
    Thanks in advance
    Charvie

    Hi,
    Your script use the variable shell $XXMPP_TOP which is not defined in the script, take care of this.
    And also, make sure where you execute this script (the command cp copys files in same directory where you execute your script)
    cp XXMPP_PRE_DELIVERY_PO_VS.ldt           $XXMPP_TOP/bin/XXMPP_MEASURE_WS
    cp XXMPP_PRE_DELIVERY_VENDOR_VS.ldt       $XXMPP_TOP/bin/XXMPP_MEASURE_WS
    cp XXMPP_PREDEL.fmb                       $AU_TOP/forms/US
    Also, make sure the command FNDLOAD exists. for more example about Oracle FNDLOAD Scripts
    Best Regards

  • Dbbackup shell script error

    hi frnds
    i need a help,i want to use a shell script to shutdown the database if the database is not shutdown properly using shutdown immediate.If shutdown immediate hangs it should check whther the database is up then call another script contains shutdown abort and startup and shutdown.
    The problem is it is not go to the next line when the shutdown immediate hangs.I am giving my script how can i fix this
    with regards
    ramya
    ORACLE_SID=CDRD; export ORACLE_SID
    ALERT=/tmp/dbalert
    dbstop.sh
    sleep 300
    ps -ef | grep ora_smon_$ORACLE_SID >$ALERT
    if test -s $ALERT
    then
    dbabort.sh
    sun7start.sh
    sun7stop.sh
    echo "Database Down"
    else
    echo "Database DOwn"
    fi

    I suppose that when you say "shutdown immediate hangs" you mean that it hangs indefinitely. Shutdown immediate could take a long time to complete for some reason (e.g. SMON has to clean up extents which are no longer needed and mark them as freed).
    I don't know a way to exit from an (indefinitely) hanging process, unless you kill it from another session.
    Maybe shutdown abort is not the most advisable way to go normally, but sometimes you can't avoid it, and personally I've never had problem with it (maybe I'm lucky :-)).

  • Activate "Team Collaboration Lists" feature by power shell script - Error

    Hello,
     I have written the following script to activate "Team Collaboration List" feature , But I get the following Error :
       The string is missing the terminator: ".
        + CategoryInfo          : ParserError: (:) [], ParseException
        + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
     The Script :
    $siteUrl = "http://serverName:2020"
    if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) 
        Add-PSSnapin "Microsoft.SharePoint.PowerShell"
    Enable-SPFeature -identity "00bfea71-4ea5-48d4-a4ad-7ea5c011abe5" –URL $subSiteURL
       How Can I solve it?
    ASk

    Hi,
    The dash in front of the “URL” seems a bit different from the normal dash.
    Please try the script below in your environment:
    Enable-SPFeature -identity "00bfea71-4ea5-48d4-a4ad-7ea5c011abe5" -URL $subSiteURL
    Feel free to reply with the test result if the issue still exists.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Error in calling SQL plus program with parameter from Shell script

    This is my Shell script. I am trying to call in the SQL plus program with the parameter and the shell script is registered as a concurrent program.
    PARAMETERS=`echo $1 |tr -d '\"'`
    DB_USER_ID=`echo $PARAMETERS|cut -d" " -f3|cut -d"=" -f2`
    CONN_STRING=$DB_USER_ID
    REQ_DATE=`echo $PARAMETERS|cut -d" " -f9|cut -d"=" -f2`
    timestamp=`date +%m-%d-%y-%H:%M:%S-%Z`
    timestam=`date +%y-%m-%d`
    sqlplus -s $CONN_STRING @ar_statement.sql $REQ_DATE
    chmod 755 statement.sh
    . statement.sh
    My Sql plus program is like this.
    set pagesize 0
    set heading off
    set feedback off
    spool $GEC_TOP/log/ge_ar_statement.sh
    select output_file_name
    from fnd_concurrent_requests
    where trunc(actual_completion_date) = '&2';
    spool off;
    exit;
    When i run the concurrent program, i am getting the following error:
    ar_statement: line 14: REQ_DATE: command not found
    Enter value for 2:
    User requested Interrupt or EOF detected.
    ar_statement.sh: line 1: Enter: command not found
    ar_statement.sh: line 2: User: command not found
    ar_statement
    Program exited with status 127
    I am not strong at Unix Porgamming and i would request someone who can
    help me out as soon as possible.
    I need this solution quickly and thank everyone in advance.
    Thanks.

    Can you put your coding between code statements, like shown in the FAQ. It will be easier to read.
    Looking at your script, my first guess is that crontab will not find your sqlplus since your script does not have $HOME/bin in the $PATH. From what I understand, running .profile in your script will not work either because variables are exported to sub-shells, not to the shell above. You can call your script with a dot like . ./script which means that the script will run like it was typed at the command prompt. But it will be less confusing to define appropriate variables in the script. eg.
    ORACLE_SID=my_instance_name
    ORACLE_HOME=/my_path_to_oracle_home_directory
    LD_LIBRARY_PATH=$ORACLE_HOME/lib
    PATH=$ORACLE_HOME/bin:$PATH
    I remember some slightly different way of coding to handle the sqlplus return codes.
    For instance:
    sqlplus -s /nolog > /dev/null <<-EOF
    connect system/manager
    @ssm.sql
    whenever oserror exit failure
    whenever sqlerror exit failure
    EOF
    sql_err=$?
    if [ $sql_err -ne 0 ]; then
       echo "FAILURE"
    else
       echo "SUCCESS"
    fiThe - in -EOF supresses tab's
    Using connect will prevent ps from showing your login credentials
    In some versions of bash the ending EOF needs to be at the beginning of the line to work.
    Edited by: waldorfm on Jul 14, 2010 7:05 PM
    complaining about putting code between code delimiters and forgot myself ;-)
    Edited by: waldorfm on Jul 14, 2010 7:08 PM
    Btw, if you "source" a script running it like . .script, than an exit in that script will log you out.

  • Error while trying to execute a unix shell script from java program

    Hi
    I have written a program to execute a unix shell script in a remote machine. I am using J2ssh libraries to estabilish the session connection with the remote box.The program is successfully able to connect and authenticate with the box.
    The runtime .exec() is been implemented to execute the shell script.I have given below the code snippet.
    try {
         File file_location = new File("/usr/bin/");
         String file_location1 = "/opt/app/Hyperion/scripts/daily";
         String a_mib_name = "test.sh";
         String cmd[] = new String[] {"/usr/bin/bash", file_location1, a_mib_name};
         Runtime rtime = Runtime.getRuntime();
         Process p = rtime.exec(cmd, null, file_location);
    System.out.println( "Connected to the server1" );
    BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
    String line = br.readLine();
    while(line !=null)
    System.out.println(line);
    line = br.readLine();
    br.close();
    p.getErrorStream ().close ();
    p.getOutputStream().close();
    int retVal = p.waitFor();
    System.out.println("wait " + retVal);
    //session.executeCommand("ls");
    catch (IOException ex) {
    I get an error message
    Connected to the server
    java.io.IOException: Cannot run program "/usr/bin/bash" (in directory "\usr\bin"
    ): CreateProcess error=3, The system cannot find the path specified
    at java.lang.ProcessBuilder.start(Unknown Source)
    at java.lang.Runtime.exec(Unknown Source)
    at SftpConnect.main(SftpConnect.java:143)
    Caused by: java.io.IOException: CreateProcess error=3, The system cannot find th
    e path specified
    at java.lang.ProcessImpl.create(Native Method)
    at java.lang.ProcessImpl.<init>(Unknown Source)
    at java.lang.ProcessImpl.start(Unknown Source)
    I am sure of the file path where the bash.sh and test.sh are located.
    Am i missing something? Any help would be greatly appreciated.
    Thanks
    Senthil

    Hi, I am using a simple program to connect to a RMI server and execute shell script. I use the Runtime.exec aommand to do the same.
    The script is sh /tmp/pub/alka/test.sh /tmp/pub/alka/abc/xyz/ul ul
    The script when run from the server, gives no errors. But when ran using rthe above method in java, gives errors as follows,
    Mycode:
    String command = "/bin/sh /tmp/pub/alka/test.sh /tmp/pub/alka/abc/xyz/ul ul";
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec(command);
    int exitVal = proc.exitValue();
    System.out.println("Process exitValue: " + exitVal);
    java.io.IOException: CreateProcess: /bin/sh /tmp/pub/alka/test.sh /tmp/pub/alka/abc/xyz/ul ul error=3
         at java.lang.ProcessImpl.create(Native Method)
         at java.lang.ProcessImpl.<init>(Unknown Source)
         at java.lang.ProcessImpl.start(Unknown Source)
         at java.lang.ProcessBuilder.start(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at java.lang.Runtime.exec(Unknown Source)
         at DecryptTest.main(DecryptTest.java:18)
    Can anyone please help

  • Error while submitting a conc program through CONCSUB in shell script

    Hi All,
    I am working on 11.5.10.2.
    I have a shell script from which I am calling a concurrent program using CONCSUB utility as below
    CONCSUB $p_login $p_resp_appl_short_name "$p_resp_name" $p_user_name CONCURRENT $p_conc_appl_short_name $p_conc_prog_name "ABC" $v_seq_num
    There are two types of error I am getting:
    1. When I am submitting it from Order Management Super User it is giving error
    Please enter a valid responsibility. The responsibility Order Management Super User does not exist or is not active. Check that the correct application short name is specified for your responsibility.
    2. When I am submitting it from some custom responsibility I am getting following error
    Cannot submit concurrent request for program APPS/APPS0
    Check if the concurrent program is registered with Application Object Library.
    Check if you specified the correct application short name for your concurrent program.
    Cannot submit your concurrent request
    Please suggest me the possible cause of the error.
    Thanks
    Vishalaksha

    It is solved now. In the script I had p_data_file_path=$10 instead of p_conc_prog_name=${10}. This is the reason I was not getting the right concurrent program name as input parameter.
    Thanks
    Vishalaksha

  • Error while executing unix shell script from java program

    Hi All,
    I am trying to execute unix shell script from a java program using Runtime.execute() method by passing script name and additional arguments.
    Code snippet :
    Java Class :
    try{
         String fileName ="test.ksh";
         String argValue ="satish"; // value passed to the script
         String exeParam = "/usr/bin/ksh "+fileName+" "+argValue;
         Process proc = Runtime.getRuntime().exec(exeParam);
         int exitValue = proc.waitFor();
         sop("Exit Value  is : "+exitValue);
    catch(Exception e)
    e.printStackTrace();
    }Test.ksh
      export -- application realated paths..
      nohup  abc.exe 1> test.log 2>&1;
      $1
      exit.By running the above java class , i am getting exit Value: 139 and log file test.log of 0 bytes.
    when i am running the same command (/usr/bin/ksh test.ksh satish) manually, it's calling abc.exe file successfully
    and able generate the logs properly.
    Pls let us know where exactly i am stuck..
    Thanks in advance,
    Regards,
    Satish

    Hi Sabre,
    As per the guidelines provided by the article, i had done below changes..
    InputStream is = null;
    InputStreamReader iStreamReader = null;
    BufferedReader bReader = null;
    String line = null;
    try{
    String fileName ="test.ksh";
    String argValue ="satish"; // value passed to the script
    String exeParam = "/usr/bin/ksh "+fileName+" "+argValue;
    Process proc = Runtime.getRuntime().exec(exeParam);
    is = proc.getErrorStream();
    iStreamReader = new InputStreamReader(is);
    bReader = new BufferedReader(iStreamReader);
    System.out.println("<ERROR>");
    while((line = bReader.readLine()) != null)
    System.out.println("Error is : "+line);
    System.out.println("</ERROR>");
    int exitValue = proc.waitFor();
    sop("Exit Value is : "+exitValue);
    catch(Exception e)
    e.printStackTrace();
    Now , it's showing something like..
    <ERROR>
    </ERROR>

  • Error with dbms_scheduler and shell script execution

    Hi,guys.
    I have an issue with a dbms_scheduler and a shell script execution. So, the shell script as it self works fine, when i'm executing ./test.sh all process is running, but when i'm executing the script from dbms_scheduler it just simply doesn't work. Actually it works, but some of executable information in sh doesn't work, seems it just jump over of the part of the script. Sendmail part is running, maybe there is problem with rman script as it self?
    DB version: 10g
    And my scripts:
    Shell scripts (permisons 755):
    #!/bin/ksh
    export PATH=/home/oracle/product/asm_home/bin:/home/oracle/product/db_home/bin:/usr/bin:/etc:/usr/sbin:/usr/ucb:/home/oracle/bin:/usr/bin/X11:/sbin:.
    export ORACLE_BASE=/home/oracle/product
    export ORACLE_SID=zabbix
    export ORACLE_HOME=/home/oracle/product/db_home
    ${ORACLE_HOME}/bin/rman<<EOF
    connect target /
    run {backup recovery area delete all input;}
    EOF
    {       echo "From:[email protected]"
            echo "To: [email protected]"
            echo "Subject: Recovery area"
            echo 'Content-Type: text/html'
            echo
            echo '<html><body><table border="1" cellspacing="1">'
            echo '<tr><td><b>Process</b></td><td><b>Statuss</b></td></tr>'
            echo "<tr><td>RMAN</td><td><b>Works</b></td></tr>"
            echo "</table></body></html>"
    } | sendmail -tIn the first part i'm exporting all of the important stuff for oracle, then I call RMAN with specific atributes. And then there is just simply sendmail functionality inside script to represent if script works (for now).
    And below pl/sql script:
    begin
      DBMS_SCHEDULER.CREATE_JOB
      job_name => 'FLASH_RECOVERY',
      job_type => 'EXECUTABLE',
      job_action => '/home/oracle/backup/test.sh',
      start_date => sysdate,
      job_class => 'DEFAULT_JOB_CLASS',
      enabled => TRUE,
      auto_drop => FALSE,
      comments => 'FLASH RECOVERY USAGE AREA backup and delete'
      END;
      /And this job execution:
           begin
               DBMS_SCHEDULER.run_job (job_name =>'FLASH_RECOVERY',use_current_session => TRUE);
           end;What can be wrong? For me, I think it's something with permisions.
    I hope you got my idea and could help me.
    Tom
    Edited by: safazaurs on 2013.18.2 22:16

    There is no error, i just receive all the time e-mail, seems it jumps over rman. I tried almost everything and still couldn't get result as i want. And, if i'm running script from command line - it works. Rman calls, and starts to recover archivelogs.

  • Error Using dbms_scheduler to call a shell script

    Hi,
    I have been assigned a job of sending emails through unix utility(Mailx), based on certain activity in database.
    Email needs to be sent on insert/update of a column in one of the database tables.
    I am trying to use the block below to call the unix script responsible to send mails:
    begin
    dbms_scheduler.create_job
    job_name => 'TPP_SEND_EMAIL_JOB',
    job_type => 'EXECUTABLE',
    job_action => '/opt/ENV/code/BIL/users/usrbil01/Hemz/sndmailscrpt.ksh',
    repeat_interval => 'FREQ=MINUTELY; INTERVAL=30',
    enabled => true,
    comments => 'Send Email on ISU update'
    end;
    sndmailscrpt.ksh: Script to send email is embedded within the shell script
    I am getting the below error when i try to run the job using 'exec dbms_scheduler.run_job('TPP_SEND_EMAIL_JOB');'
    Error:
    ORA-27370: job slave failed to launch a job of type EXECUTABLE
    ORA-27300: OS system dependent operation:accessing extjob wrapper failed with status: 2
    ORA-27301: OS failure message: No such file or directory
    ORA-27302: failure occurred at: sjsec 3
    ORA-06512: at "SYS.DBMS_ISCHED", line 150
    ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
    ORA-06512: at line 1
    I am not aware of any db related permissions that needs to be given, is this related to that or is there somethin i need to do for execution to be successfull
    Request you to let me know the exact solution and also the steps i need to take in order to ensure successfull execution of this script.
    Please also let me know if there is any other way wherein i can call a unix script from a database trigger on run time(i.e, whenever insert/update on a particular column in database)
    Regards,
    Hemanth

    Hi All,
    Thank you for your inputs.
    I am now pressed to explore the option of utl_mail as this dircetly sends mail from database. This is suggested as an option for my delivery now.
    I am able to install utl_mail and send a mail using the block below:
    begin
    utl_mail.send(
    sender => '[email protected]',
    recipients => '[email protected]',
    subject => 'Testing utl_mail',
    message => 'The receipt of this email is checking on working of UTL_MAIL '
    exception
    when others then
    dbms_output.put_line('error: '||sqlerrm);
    end;
    The block gets executed successfully, but i have not received a mail yet, is there a table or oracle log from where i can trace the delivery status for the mai, or if the mail is successfully sent too?
    I have heard from users in this forum for support of mime type "HTML", Should i pass the whole html body in the *'message'* input parameter here or can i pass a html template name with path present else where?
    Please do assist me in this regard.
    Regards,
    Hemanth

  • Error reading data from Infocube using shell script.

    Dear all ,
    I am facing a problem while reading data from an infocube using a shell script.
    The details are as follows.
    One of the shell script reads the data from the infocube to extract files with the values.
    The tables used for extraction by the shell script are :
    from   SAPR3."/BIC/F&PAR_CUBE.COPA"     FCOPA,
           SAPR3."/BIC/D&PAR_CUBE.COPAU"    COPAU,
           SAPR3."/BIC/D&PAR_CUBE.COPAP"    COPAP,
           SAPR3."/BIC/D&PAR_CUBE.COPA1"    CCPROD,
           SAPR3."/BIC/D&PAR_CUBE.COPA2"    CCCUST,
           SAPR3."/BIC/D&PAR_CUBE.COPA3"    COPA3,
           SAPR3."/BIC/D&PAR_CUBE.COPA4"    COPA4,
           SAPR3."/BIC/D&PAR_CUBE.COPA5"    COPA5,
           SAPR3."/BIC/MCCPROD"      MCCPROD,
           SAPR3."/BIC/SCCPROD"      SCCPROD,
           SAPR3."/BIC/MCCCUSTOM"    MCCCUSTOM,
           SAPR3."/BIC/SCCCUSTOM"    SCCCUSTOM,
           SAPR3."/BIC/SORGUNIT"     SORGUNIT,
           SAPR3."/BIC/SUNIMOYEAR"   SUNIMOYEAR,
    /*     SAPR3."/BI0/SFISCPER"     SFISCPER, */
           SAPR3."/BI0/SREQUID"      SREQUID,
           SAPR3."/BI0/SCURRENCY"    SCURRENCY,
           SAPR3."/BIC/SSCENARIO"    SSCENARIO,
           SAPR3."/BIC/SSOURCE"      SSOURCE
    The problem is that the file generation by this script (after reading the data from teh infocube) is taking an unexpected time of 2 hours which needs to be maximum 10 mins only.
    I used RSRV to get the info about these tables for the infocube:
    Entry '00046174', SID = 37 in SID table is missing in master data table /BIC/MCUSLEVEL2
    Entry '00081450', SID = 38 in SID table is missing in master data table /BIC/MCUSLEVEL2
    and so on for SID = 39  and SID = 35 .
    Checking of SID table /BIC/SCUSLEVEL2 produced errors
    Checking of SID table /BIC/SCUSLEVEL3 produced errors
    Can you please let me know if this can be a reason of delay in file generation (or reading of data from the infocube).
    Also , Please let me know how to proceed with this issue.
    Kindly let me know for more information, if required.
    Thanks in advance for your help.
    -Shalabh

    Hi ,
    In continuation with searching the solution to the problem , I could manage to note a difference in the partition of the Fact table of the infocube.
    Using SE14 -> Storage Parameters, I could find the partition done for the fact table as :
    PARTITION BY: RANGE
    COLUMN_LIST: KEY_ABACOPA
    and subsequently there are partitions with data in it.
    I need to understand the details of these partitions .
    Do they correspond to each requests in the infocube(which may not be possible as there are 13 requests in infocube and much more partitions).
    Most importantly, since this partition is observed for this onfocube only and not for other infocubes, it is possible that it can be a reason for SLOW RETRIEVAL of data from this ionfocube( not sure since the partition is used to help in fast retreival of data from the infocubes).
    Kindly help.
    Thanks for your co-operation in advance.
    -Shalabh

  • Random SP2 error when starting oracle process through SHELL script

    Hi All,
    I am trying to process data in n-Number of tables through a package. The package is called through a shell script to create start data processing. All calls to the package are in a sql script which is basically exec calls-
    exec package.process ('T1','some param');
    exec package.process ('T1','some param');
    exec package.process ('T..n','some param');
    I have a shell script which I use to execute commands from the sql script. There is a reason behind using shell script. For some strange reason, I keep on getting -
    ERROR: logon denied - check for valid user with valid privileges
    SP2-0640: Not connected
    SP2-0641: "EXECUTE" requires connection to server
    SP2-0640: Not connected
    for some EXEC calls. Problem is, errors are generated at random. So in one run, I get error for T10,T11 and then in next run I might get for some other tables.
    However, when I am running the sql script from the sql prompt, all calls to the package are executed without any problem.
    This makes me think, it is something to do with the way database connection being initiated through UNIX.
    Has anyone faced similar issue? Your help/gudence is much appreciated.
    DB: Oracle 10.2.0.5
    OS: SUN Solaris 10
    Thanks in advance.

    Login credentials are provided inside the shell script.
    I did put a sleep(10) after EOF but no help. As mentioned if I run script file from sql promt, it runs without any hiccup. So it is the connection through the UNIX that is causing issue.
    As pointed out by Sybrand, I agree that it does not make a sense to connect and commit after every sql statement. So decided to change the shell script and so far, the result from my initial tests on a sample data is quite encouraging. Hopefully I will have a solution.
    But it will be nice to know why SHELL is doing what it is doing!!
    Legacy prog are sometime big time eye-openers..;)

  • How to get ORA errors in alertlog file using shell script.

    Hi,
    Can anyone tell me how to get all ORA errors between two particular times in an alertlog file using shell script.
    Thanks

    Hi,
    You can define the alert log as an external table, and extract messages with SQL, very cool:
    http://www.dba-oracle.com/t_oracle_alert_log_sql_external_tables.htm
    If you want to write a shell script to scan the alert log, see here:
    http://www.rampant-books.com/book_2007_1_shell_scripting.htm
    #!/bin/ksh
    # log monitoring script
    # report all errors (and specific warnings) in the alert log
    # which have occurred since the date
    # and time in last_alerttime_$ORACLE_SID.txt
    # parameters:
    # 1) ORACLE_SID
    # 2) optional alert exclusion file [default = alert_logmon.excl]
    # exclude file format:
    # error_number error_number
    # error_number ...
    # i.e. a string of numbers with the ORA- and any leading zeroes that appear
    # e.g. (NB the examples are NOT normally excluded)
    # ORA-07552 ORA-08006 ORA-12819
    # ORA-01555 ORA-07553
    BASEDIR=$(dirname $0)
    if [ $# -lt 1 ]; then
    echo "usage: $(basename) ORACLE_SID [exclude file]"
    exit -1
    fi
    export ORACLE_SID=$1
    if [ ! -z "$2" ]; then
    EXCLFILE=$2
    else
    EXCLFILE=$BASEDIR/alert_logmon.excl
    fi
    LASTALERT=$BASEDIR/last_alerttime_$ORACLE_SID.txt
    if [ ! -f $EXCLFILE ]; then
    echo "alert exclusion ($EXCLFILE) file not found!"
    exit -1
    fi
    # establish alert file location
    export ORAENV_ASK=NO
    export PATH=$PATH:/usr/local/bin
    . oraenv
    DPATH=`sqlplus -s "/ as sysdba" <<!EOF
    set pages 0
    set lines 160
    set verify off
    set feedback off
    select replace(value,'?','$ORACLE_HOME')
    from v\\\$parameter
    where name = 'background_dump_dest';
    !EOF
    `
    if [ ! -d "$DPATH" ]; then
    echo "Script Error - bdump path found as $DPATH"
    exit -1
    fi
    ALOG=${DPATH}/alert_${ORACLE_SID}.log
    # now create awk file
    cat > $BASEDIR/awkfile.awk<<!EOF
    BEGIN {
    # first get excluded error list
    excldata="";
    while (getline < "$EXCLFILE" > 0)
    { excldata=excldata " " \$0; }
    print excldata
    # get time of last error
    if (getline < "$LASTALERT" < 1)
    { olddate = "00000000 00:00:00" }
    else
    { olddate=\$0; }
    errct = 0; errfound = 0;
    { if ( \$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (dtconv(\$3, \$2, \$5, \$4) <= olddate)
    { # get next record from file
    next; # get next record from file
    # here we are now processing errors
    OLDLINE=\$0; # store date, possibly of error, or else to be discarded
    while (getline > 0)
    { if (\$0 ~ /Sun/ || /Mon/ || /Tue/ || /Wed/ || /Thu/ || /Fri/ || /Sat/ )
    { if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    OLDLINE = \$0; # no error, clear and start again
    errfound = 0;
    # save the date for next run
    olddate = dtconv(\$3, \$2, \$5, \$4);
    continue;
    OLDLINE = sprintf("%s<BR>%s",OLDLINE,\$0);
    if ( \$0 ~ /ORA-/ || /[Ff]uzzy/ )
    { # extract the error
    errloc=index(\$0,"ORA-")
    if (errloc > 0)
    { oraerr=substr(\$0,errloc);
    if (index(oraerr,":") < 1)
    { oraloc2=index(oraerr," ") }
    else
    { oraloc2=index(oraerr,":") }
    oraloc2=oraloc2-1;
    oraerr=substr(oraerr,1,oraloc2);
    if (index(excldata,oraerr) < 1)
    { errfound = errfound +1; }
    else # treat fuzzy as errors
    { errfound = errfound +1; }
    END {
    if (errfound > 0)
    { printf ("%s<BR>",OLDLINE); }
    print olddate > "$LASTALERT";
    function dtconv (dd, mon, yyyy, tim, sortdate) {
    mth=index("JanFebMarAprMayJunJulAugSepOctNovDec",mon);
    if (mth < 1)
    { return "00000000 00:00:00" };
    # now get month number - make to complete multiple of three and divide
    mth=(mth+2)/3;
    sortdate=sprintf("%04d%02d%02d %s",yyyy,mth,dd,tim);
    return sortdate;
    !EOF
    ERRMESS=$(nawk -f $BASEDIR/awkfile.awk $ALOG)
    ERRCT=$(echo $ERRMESS|awk 'BEGIN {RS="<BR>"} END {print NR}')
    rm $LASTALERT
    if [ $ERRCT -gt 1 ]; then
    echo "$ERRCT Errors Found \n"
    echo "$ERRMESS"|nawk 'BEGIN {FS="<BR>"}{for (i=1;NF>=i;i++) {print $i}}'
    exit 2
    fi

  • Dbms_scheduler error when running shell script

    I have 2 shell scripts.
    ftp_file_from_apps.sh copies a file from one server to antoher. It receives an input which is the name of the file to be copied.
    scp_file_to_dbs.sh does a secure copy. Copying the file fo anther directory on the same server.
    ftp_file_from_apps.sh
    ~~~~~~~~~~~~~~~~~
    #!/bin/bash
    sftp applprod@<host.domain>:/<source_directory>/$1
    /<destination_directory>/$2
    scp_file_to_dbs.sh
    ~~~~~~~~~~~~~
    scp -r /<source_directory>/$1 <host.domain>:/<destination_directory>/$1
    Both of these scripts works 100% when i run them from os level:
    ftp_file_from_apps.sh xxx.out xxx.pdf
    scp_file_to_dbs.sh xxx.pdf
    the problem is when i run them with dbms_scheduler:
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    v_file_name and v_file_name_pdf is varchar2(20) with values assigned.
    begin
    dbms_scheduler.create_job(
    job_name=>'FTP_FILE_FROM_APPS',
    job_type=>'executable',
    job_action=>'/<directory_of_script>/ftp_file_from_apps.sh
    v_file_name v_file_name_pdf',
    enabled=>TRUE
    end;
    begin
    dbms_scheduler.create_job(
    job_name=>'SCP_FILE_TO_DBS',
    job_type=>'executable',
    job_action=>'/<directory_of_script>/scp_file_to_dbs.sh
    v_file_name_pdf',
    enabled=>TRUE
    end;
    ftp_file_from_apps.sh error:
    ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory
    scp_file_to_dbs.sh error:
    ORA-27369: job of type EXECUTABLE failed with exit code: No such file or directory
    I tripple checked my <directory_of_script>.
    Please help.
    Regards
    John

    Hi,
    What Paul means is that you should not be using
    job_action=>
    '/<directory_of_script>/scp_file_to_dbs.sh v_file_name_pdf',
    Instead job_action should be the name of the shell script only. So you should have
    job_action=>
    '/<directory_of_script>/scp_file_to_dbs.sh',
    number_of_arguments=>1
    enabled=>false
    And then make a call to dbms_scheduler.set_job_argument_value (for each argument) and finally a call to dbms_scheduler.enable.
    Hope this helps,
    Ravi.

Maybe you are looking for

  • Microphone level too low

    It seems like the microphone input level on my wife's iPhone 4 is too low. People have trouble hearing her during her calls. Using the headset, speakerphone, or Bluetooth doesn't increase the volume, nor does covering up the noise-cancelling input on

  • National characters in pages, accessed through Application/URl

    Jambo all! I hope you can help me with this little problem: 1. I've created application and added URL item to it 2. URL is pointing to an external ASP page (I hope that fact that this is an ASP page does not influent the behavior) 3. I've published i

  • HT201328 How can we test that our phone is unlocked after we restore our iPhone?

    How can we test that our phone is unlocked after we restore our iPhone? I don't have access to another sim card at the moment. Only my AT&T sim card.

  • Recent iTunes Videos Won't Play

    Here is an odd one...over the last three months, I've purchased all of the episodes to Eli Stone and loaded them on my iPod (that's a terrific show, by the way). All of the episodes view fine on my MacBook Pro running 10.4.11. The first 10 episodes a

  • Problem about tree

    Hi,everyone,I am just new to java.And now I got a problem with storing the following expression into a binary tree: The expression is like: ((a/b)+((c-d)*e)) in a txt file. so,what i want to do is to store variable and operation(+-*/)into a tree.And