ORA-01017 encountered while executing shell scripts

Hi,
While executing backup scripts for one of my databases, the script contains a login section which fails as shown below
Script login section:
sqlplus / << END > /tmp/$PROGRAM.tmp
Error generatedf in logfile:
SQL*Plus: Release 11.2.0.3.0 Production on Wed Apr 10 11:32:06 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid username/password; logon denied
Couple of points to be noted:
1) There are two other databases in the same server and they don't have any issue
2) I am able to login into this database as "/"
3) I am able to connect to the same databases as sysdba from another server
4) The script runs successfully when I modify it as: sqlplus / as sysdba << END > /tmp/$PROGRAM.tmp

if you connect sqlplus as
$ sqlplus /You're not identifying that's why you got ORA-01017
instead if you connect as "sqlplus / as sysdba" , check:
sqlplus / as sysdba--how it works
===========================================
please mark your threads as answered when you got the correct answer:
      866746     
Handle:      866746 
Status Level:      Newbie
Registered:      Jun 18, 2011
Total Posts:      3
Total Questions:      3 (3 unresolved)Edited by: Fran on 12-abr-2013 3:47

Similar Messages

  • Command not found error while executing shell programs in terminal

    I have written one sample shell program.
    while executing shell program in terminal,it shows COMMAND NOT FOUND error.
    How to slove this.

    Post the "Actual" error.  It says more than command not found.
    Post your script.
    Post the output from:
    echo $PATH
    Post the output from:
    which name_of_command_not_found

  • Error while executing the script adgetlnxver.sh

    Error while executing the script adgetlnxver.sh on apps&db tier during upgrade from 11.5.9 to 11.5.10.2
    -bash: [: -lt: unary operator expected
    [aptinst@dba5 TINST_dba5]$ sh adapcctl.sh restart
    adapcctl.sh version 115.55
    /u01/app/tinst/tinstappl/ad/11.5.0/bin/adgetlnxver.sh: line 123: [: -lt: unary operator expected
    Apache Web Server Listener :httpd ( pid 8645 ) is running.
    Restarting the Apache Web Server Dedicated HTTP Listener..
    Apache Web Server Listener (PLSQL) :httpd ( pid 8673 ) is running.
    Restarting the Apache Web Server Dedicated PLSQL Listener..
    adapcctl.sh: exiting with status 0
    In adgetlnxver.sh: line 123 says
    if [ ${setflag}x = "x" -a $os = "RH" ]; then
    redhatver=`grep -oP "Enterprise Linux [a-z A-Z 0-9]* release [0-9]+" /etc/redhat-release | sed 's/Enterprise Linux [a-z A-Z 0-9]* release //g'`
    if [ $redhatver -lt 5 ]; then
    LD_ASSUME_KERNEL="2.4.19"
    export LD_ASSUME_KERNEL
    fi
    fi
    Thanks,
    Vamsi

    Hi Vamsi.
    The exactly erro refers to a problems when you try upgrade from these version to 11.5.10.
    Can you read this note and apply solution? The note refers a patch, but the problem is the same.
    After Patch 4334965, adstrtal.sh & adstpall.sh is failing with errors [ID 360046.1]
    BR Rafael Ceolim

  • Dump while executing SAP Script

    Hello,
    My program is throwing a dump while executing this script. Request you all to please help me in removing this.
    /E   MAIN_DATA
    /:    BOX FRAME 10 TW
    PA To,  ,,Invoice No. & Date,,  &JVBRK-VBELN&  &JVBRK-FKDAT&
    PA M/s  &JKNA1-NAME1(35)&,,Your P.O. No.,,  &JVBAK-BSTNK&
    /*           &JKNA1-NAME2(35)&,,Truck No.,,  &JLIKP-TRAID&
    PA         &JKNA1-NAME2(35)&,,Truck No.,,  &WRK_VEHNO&
    PA         &JKNA1-ORT01(20)&,,LR No.& Date,,  &WRK_LRNO&   &JJ_1IEXCDTL-EXDAT& 
    /*           &JKNA1-REGIO(20)&,,Net Qty.in kgs.,,  &JLIPS-NTGEW(10.3L)&
    PA         &JKNA1-REGIO(20)&,,Net Qty.in kgs.,,  &W_NETWT(12.3L)& KG
    PA         ,,Material,,  &JVBRP-ARKTX(30)&
    My Report has the following code:
    FORM write_to_layout_set.
      PERFORM write_layout_set USING 'MAIN' 'SET' 'BODY' 'MAIN'.
      PERFORM write_layout_set USING '' 'SET' 'BODY' 'LOGO'.
      PERFORM write_layout_set USING '' 'SET' 'BODY' 'HEADER2'.
      PERFORM write_layout_set USING 'HEADER' 'SET' 'BODY' 'TEST2'.
      PERFORM write_layout_set USING 'FOOTER' 'SET' 'BODY' 'FOOTER2'.
      PERFORM write_layout_set USING '' 'SET' 'BODY' 'SIGN'.
    ENDFORM.                               " WRITE_TO_LAYOUT_SET
    FORM write_layout_set USING wrk_element
                                wrk_function
                                wrk_type
                                wrk_window.
      CALL FUNCTION 'WRITE_FORM'
         EXPORTING
               element       =  wrk_element
               function      =  wrk_function
               type          =  wrk_type
              window         =  wrk_window
       IMPORTING
            PENDING_LINES =
           EXCEPTIONS
                element       = 1
                function      = 2
                type          = 3
                unopened      = 4
                unstarted     = 5
                window        = 6
                OTHERS        = 7.
    +
      IF sy-subrc NE 0.
        PERFORM protocol_update.
      ENDIF.
    +
    ENDFORM.                               " WRITE_LAYOUT_SET

    As per my first reply you have to change the perform
    PERFORM write_layout_set USING 'MAIN' 'SET' 'BODY' 'MAIN'.
    to
    PERFORM write_layout_set USING 'MAIN_DATA' 'SET' 'BODY' 'MAIN'.
    and now check and one more thing whether this main_data element is in main window or not just check.
    if it does not work then just change &W_NETWT(12.3L)&  to
    &W_NETWT& and check

  • Execute Shell Script through Demantra Workflow

    Hi All ,
    Can we execute shell script from Demantra Workflow ?
    If yes where should we place the shell script file and wat should be the commandline command in the step .
    We have the Demantra installed on a windows server and the workflow manager is on a linux server .
    the batch file on the windows server can be executed through the secure shell from the linux server .
    I am trying to achieve the same through thr demantra workflow
    Appreciate any input on the same .
    Thanks and regards
    Suzy

    Hi,
    Shell script is not supported till Demantra 7.2.0.2 WF.
    I have checked with Oracle team also and reply I got below for your reference:
    QUESTION
    *=========*
    As per your details, shall we conclude like this:
    *"only *.bat and *.exe files can be used in workflow. Demantra standard functionality doe*
    *s not support shell script in workflow"*
    ANSWER
    *=======*
    Hi ,
    The Demantra standard functionality 7.2.0.2 does support shell script in workflow.
    Thanks,
    Asya
    Please review the note#468071.1-Unable to Run EBS Workflows that Call EngineManager.exe in
    You will find this note is referring to the Enhancement Request Bug 6644455-- ANALYTICAL ENGINE
    NOT AVAILABLE ON UNIX/LINUX
    But the enhancement bug exist and I hope it is fixed in Demantra 7.3.
    Tks
    MJ

  • Error encountered while executing the transform project name.map name. Error:Unable to create the transform. Microsoft.XLANGs.Engine

    Hi All,
    I developed a Biztalk Application aims to upload a flat file data to our system MS SQL Server database. It works fine until one day, an exception is generated as below.
    "Error encountered while executing the transform project name.map name. Error:Unable to create the transform. Microsoft.XLANGs.Engine"
    It continues to generate an exception until I restart the Biztalk instance. And it happens occasionally, no pattern, cannot be traced and debugged.
    Anybody has an idea about this error? Please help, thank you very much.
    The Biztalk Server is running on Hyper-V Virtual machine, Biztalk Server 2009 on Windows Server 2008.
    The Biztalk Application consists of Mapping Functoid, Orchestration, Flatfile Schema, Flatfile Disassembler Pipeline, SQL Send Port, File Receive Port and Send Port
    Eric

    HI Eric,
    I think it might happen because of large message (Out of Memory exception). As you said you have flat file as inbound, you are doing mapping and then sending it to MSSQL
    SO you can check below mentioned things
    1) Any custom pipeline component is used in receive pipeline. (if so optimize the code)
    2) This issue haapen only with large message (BizTalk convert flat file to XMl to if you have 1MB file corresponding XML will be of higher size)
    again all thing mentioned above is assumption.
    YOu can use debugdiag tool to see if memory leak is happening
    http://www.microsoft.com/en-in/download/details.aspx?id=26798

  • Error encountered while executing the transform

    My message failed at orchestration with the following error. Kindly help in finding the issue.
    xlang/s engine event log entry: Uncaught exception (see the 'inner exception' below) has suspended an instance of service 'Ibox.UNEDIFACT.CODECO.Orchestration.CodecoDownload(df91e55f-c6aa-914d-f042-acdb45bdcaf4)'.
    The service instance will remain suspended until administratively resumed or terminated.
    If resumed the instance will continue from its last persisted state and may re-throw the same unexpected exception.
    InstanceId: cc8fac84-47dc-4d31-be15-80c9f86ffaac
    Shape name: CodecoMapping
    ShapeId: 32b0a92d-82f7-4b3a-8e22-a94b53bf2804
    Exception thrown from: segment 1, progress 22
    Inner exception: Error encountered while executing the transform Ibox.UNEDIFACT.CODECO.Orchestration.CodecoMap. Error:Transformation failed..
    Exception type: XTransformationFailureException
    Source: Microsoft.XLANGs.Engine
    Target Site: Void ApplyInMemoryTransform(System.Type, Microsoft.XLANGs.RuntimeTypes.TransformMetaData, System.Object[], System.IO.Stream[])
    The following is a stack trace that identifies the location where the exception occured
       at Microsoft.XLANGs.Core.Service.ApplyInMemoryTransform(Type mapRef, TransformMetaData trfMetaData, Object[] outParams, Stream[] inStreams)
       at Microsoft.XLANGs.Core.Service.ApplyTransform(Type mapRef, Object[] outParams, Object[] inParams)
       at Ibox.UNEDIFACT.CODECO.Orchestration.CodecoDownload.segment1(StopConditions stopOn)
       at Microsoft.XLANGs.Core.SegmentScheduler.RunASegment(Segment s, StopConditions stopCond, Exception& exp)
    Additional error information:
            Exception has been thrown by the target of an invocation.
    Exception type: TargetInvocationException
    Source: mscorlib
    Target Site: System.Object InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
    The following is a stack trace that identifies the location where the exception occured
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at Microsoft.XLANGs.BaseTypes.CompiledXsltWrapperTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver resolver)
       at Microsoft.XLANGs.BaseTypes.CompiledXsltWrapperTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, Stream output, XmlResolver resolver)
       at Microsoft.XLANGs.Core.Service.ApplyInMemoryTransform(Type mapRef, TransformMetaData trfMetaData, Object[] outParams, Stream[] inStreams)
    Additional error information:
            Attribute and namespace nodes cannot be added to the parent element after a text, comment, pi, or sub-element node has already been added.
    Exception type: XslTransformException
    Source: System.Data.SqlXml
    Target Site: Void ThrowInvalidStateError(System.Xml.XPath.XPathNodeType)
    The following is a stack trace that identifies the location where the exception occured
       at System.Xml.Xsl.Runtime.XmlQueryOutput.ThrowInvalidStateError(XPathNodeType constructorType)
       at System.Xml.Xsl.Runtime.XmlQueryOutput.ConstructInEnumAttrs(XPathNodeType rootType)
       at System.Xml.Xsl.Runtime.XmlQueryOutput.WriteStartAttribute(String prefix, String localName, String ns)
       at <xsl:template name="compiler:generated"> (36)(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current, Double {http://schemas.microsoft.com/BizTalk/2003/var}var:v237,
    Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v239, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v240, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v242, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v244,
    Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v246, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v248, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v250, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v252,
    Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v255, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v256, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v258, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v259,
    Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v261, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v262, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v264, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v265,
    Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v267, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v268, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v271, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v272,
    Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v281, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v283, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v284, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v286,
    Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v287, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v289, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v290, Boolean {http://schemas.microsoft.com/BizTalk/2003/var}var:v292,
    String {http://schemas.microsoft.com/BizTalk/2003/var}var:v295)
       at <xsl:template name="compiler:generated"> (12)(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
       at <xsl:template match="/s2:Root">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
       at <xsl:template match="/">(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime, XPathNavigator {urn:schemas-microsoft-com:xslt-debug}current)
       at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
       at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
       at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
       at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer)
       at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)

    Hi,
    It is clearly an issue in your map. You can test your map out of Orchestration to make sure it is working.
    "Exception has been thrown by the target of an invocation" is a very generic exception. you
    need the inner exception to see the actual error. You can also try to test the map in the MapTester tool. It also shows also the inner exception. It's designed for BizTalk 2010 but with the .exe file you maybe also can test BizTalk 2006 maps,.
    http://code.msdn.microsoft.com/Execute-a-BizTalk-map-from-26166441
    If this answers your question please mark as answer. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • App-V 5: Error encountered while executing command Mount-AppvClientPackage

    I am getting this error in which no Google search reveals anyone else as having reported it anywhere.  In fact, after having posted this, it was the only search result that came up with either of these two event ID's or errors.
    I am trying to sequence an in house application. It's a manual install. The application runs perfectly prior to creating the package so I am not sure what this "specified file" is that it can't find.  It says to refer to the AppV Client Event
    Log for more details. This event was *IN* the AppV Client Event Log and there was another event along side it.
    Event ID 9001
    Error encountered while executing command Mount-AppvClientPackage -PackageId eb77be98-bc44-45fd-a0e5-95e0c315808b -VersionId c5013ec7-0456-401b-b99e-d988d97bfa55. Error: Application Virtualization Service failed to complete requested operation. 
    Operation attempted: Mount Package. 
    Windows Error: 0x80070002 - The system cannot find the file specified
    Error module: Streaming Manager. Internal error detail: 74F0262C80070002. 
    Please consult AppV Client Event Log for more details.
    Event ID 14016
    The package {eb77be98-bc44-45fd-a0e5-95e0c315808b}
    version {c5013ec7-0456-401b-b99e-d988d97bfa55} could not be mounted
    because the network connection has been lost or is unavailable.  Check your network connection and try again.
    The network connection is still quite alive on the client and the firewall is disabled on the App-V server. I can still reach and view the xml file when browsing to the web service on the App-V server.  I can also run Sync-AppVPublishingServer from
    powershell without error.
    For more inside info on the app: 
    1. It is a manual install. A directory is simply copied to the hard drive manually.
    2. An ocx file gets registered from the Syswow64 directory.
    3. MySQL 5.1.13 client is installed.
    4. Shortcuts are created.
    5. A system DSN is created using C:\Windows\SysWOW64\odbcad32.exe
    6. The app runs perfectly on the sequencer prior to creating and publishing.
    UPDATE:
    Get-AppVClientPackage reveals this:
    PackageId            : eb77be98-bc44-45fd-a0e5-95e0c315808b
    VersionId            : c5013ec7-0456-401b-b99e-d988d97bfa55
    Name                 : Tietan
    Version              : 0.0.0.1
    Path                 : \\wuspappv01\appv1\TietanProd\Tietan.appv
    IsPublishedToUser    : True
    UserPending          : False
    IsPublishedGlobally  : False
    GlobalPending        : False
    InUse                : False
    InUseByCurrentUser   : False
    PackageSize          : 217155655
    PercentLoaded        : 0
    IsLoading            : False
    HasAssetIntelligence : True
    The path is accessible from the client server. I can see the file. It's there.

    Hello,
    If you execute get-appvclientpackage
    And then check what is the value for Path for the package you have an issue with.
    Most likely the error message means that the file in Path isn't reachable.
    As indicated here;
    The package {eb77be98-bc44-45fd-a0e5-95e0c315808b}
    version {c5013ec7-0456-401b-b99e-d988d97bfa55} could not be mounted
    because the network connection has been lost or is unavailable.  Check your network connection and try again.
    Nicke Källén | The Knack| Twitter:
    @Znackattack

  • Upgraded ROX filer not executing shell scripts

    Hi all,
    I run ICEWM+ROX filer as my lite desktop but after a recent upgrade, ROX does not execute shell scripts on mouse click. It appears that filetype detection has changed so that all scripts are shown with the shellscript icon, whereas before those without a .sh extension where shown with the kde type "cogwheel".
    Any tips much appreciated.
    My thanks in advance!

    I've found a lot of things I don't like about the latest ROX upgrade... too much caching nowadays in my  opinion.

  • Finding path to source executed shell script

    Hello,
    I have shell script A which executes shell script B. The scripts A and B reside in the same directory.
    Following requirements:
    Scripts A and B need to be source executed.
    The directory where A and B resides should be anywhere.
    The present working directory from where A is executed should be anywhere.
    The directory of scripts A and B may not be defined in $PATH.
    The current shell could be any Bourne or Korn shell, Linux or Unix.
    Problem:
    Let's assume scripts A and B are installed in "/custom".
    The users working directory is /home/oracle and he executes "source /custom/A".
    If script A executes "source ./B", the result would be "source /home/oracle/B", which will fail.
    Possible Solution:
    Since script A is being sourced, $0 will always be the name of the current shell and not the name and path to script A.
    I have not found a universal solution to locate the absolute path of a shell script that is being source executed.
    So I was wondering about defining a variable in script A. e.g. SCRIPT_HOME=./custom. When script A executes "source $SCRIPT_HOME/B" it will work, but then script A needs to be customized by the user.
    I could write a script C that edits script A to search and edit the SCRIPT_HOME variable. For this to work I will have to verify that script C is not source executed, and that script A is in the same directory as C based on $0. This is not a problem..
    The question however is whether I need to create script C, or could simply execute script A with -config argument to edit itself and exit. I would prefer the later case and from what I understand, Unix and Linux do not lock files by default and this should be possible.
    Any comments or suggestions please?
    Thanks!
    Edited by: Dude on Apr 5, 2011 3:59 AM

    The $_ solution is actually very simple:
    $ cat thatsme
    mypath=$(dirname $_)
    echo "$mypath/B"
    $ source /home/oracle/thatsme
    /home/oracle/BI do not need the absolute path of script A. The relative path from my current directory will do as well.
    But, it does not work with an alias:
    $ alias thatsme='source /home/oracle/thatsme'
    $ thatsme
    ./B

  • ORA-01722: Error while executing query in Query Designer

    Hi All;
    I am getting the below error while executing a query
    ORA-01722: invalid number
    Error reading the data of InfoProvider
    Error while reading data; navigation is possible
    Have anyone encountered this before? How do i resolve this?
    Thanks!
    ~ Arun KK

    Hi,
    Did you checked all the setting required to run this query are present in the Qualtiy system??
    Which means all the characteristics,key figures are in active state.
    Also all the cubes are in active state with no issues with the involved in the dimensions used for the query.
    Also do a check in the query and if you have authorization try to save the same query and execute the saved one again in quality and see if the same error happens again.
    Thanks
    Ajeet

  • ORA-06550 error while executing procedure

    HI Friends,
    I have written a proc for the below process.
    SP_Control (table)
    sno     campgn_id     campgn_typ     campgn_no     current_wave
    1     ET07001     ONB     ONB01     1
    2     ET07001     ONB     CNB01     1
    3     ET03053     IAL     IAL1A     A
    4     ET03053     IAL     IAL2A     A
    5     ET03053     IAL     IAL3A     A
    6     ET03053     IAL     IAL4A     A
    After calling the procedures with bellow parameters
    Get_next_campgn(‘ONB01’,’ONB’);
    Get_next_campgn(‘CNB01’,’ONB’);
    Get_next_campgn(‘IAL1A’,’IAL’);
    Get_next_campgn(‘IAL2A’,’IAL’);
    Get_next_campgn(‘IAL3A’,’IAL’);
    Get_next_campgn(‘IAL4A’,’IAL’);
    …………… it should update the table with below data.
    sno     campgn_id     campgn_typ     campgn_no     current_wave
    1     ET07001     ONB     ONB02     2
    2     ET07001     ONB     CNB02     2
    3     ET03053     IAL     IAL1B     B
    4     ET03053     IAL     IAL2B     B
    5     ET03053     IAL     IAL3B     B
    6     ET03053     IAL     IAL4B     B
    I have written a procedure like this and its compliled successfully.
    But throws error while executing like
    execute Get_next_campgn(‘ONB01’,’ONB’);
    create or replace procedure Get_next_campgn(p_campgn varchar2,p_type varchar2)
    as
    begin
    update SP_Control set campgn_no = substr(p_campgn,1,length(p_campgn)-1)||to_char(ascii(substr(p_campgn,-1,1))+1) ,
    curr_wave = to_char(ascii(curr_wave)+1)
    where campgn_type = p_type
    and campgn_no = p_campgn ;
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end Get_next_campgn;
    Error::::
    Error starting at line 15 in command:
    execute Get_next_campgn(‘ONB01’,’ONB’)
    Error report:
    ORA-06550: line 1, column 24:
    PLS-00103: Encountered the symbol "" when expecting one of the following:
    ( ) - + case mod new not null <an identifier>
    <a double-quoted delimited-identifier> <a bind variable>
    table continue avg count current exists max min prior sql
    stddev sum variance execute multiset the both leading
    trailing forall merge year month day hour minute second
    timezone_hour timezone_minute timezone_region timezone_abbr
    time timestamp interval date
    <a string literal with character set specification>
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Please suggest....

    The procedure executed successfully for me.
    drop table sp_control;
    create table sp_control
      campgn_no varchar2(20),
      curr_wave varchar2(20),
      campgn_type varchar2(20)
    insert into sp_control values ('ONB01', '1', 'ONB');
    insert into sp_control values ('IAL1A', 'A', 'IAL');
    create or replace procedure Get_next_campgn(p_campgn varchar2,p_type varchar2)
    as
    begin
    update SP_Control set campgn_no = substr(p_campgn,1,length(p_campgn)-1)||to_char(ascii(substr(p_campgn,-1,1))+1) ,
    curr_wave = to_char(ascii(curr_wave)+1)
    where campgn_type = p_type
    and campgn_no = p_campgn ;
    exception
    when others then
    dbms_output.put_line(sqlerrm);
    end Get_next_campgn;
    begin
      Get_next_campgn('ONB01','ONB');
    end;
    select * from sp_control;
    --Output as Follows:
    drop table sp_control succeeded.
    create table succeeded.
    1 rows inserted
    1 rows inserted
    procedure Get_next_campgn(p_campgn Compiled.
    anonymous block completed
    CAMPGN_NO            CURR_WAVE            CAMPGN_TYPE         
    ONB050               50                   ONB                 
    IAL1A                A                    IAL                 
    2 rows selectedJust a hunch, in the Procedure call
    execute Get_next_campgn(‘ONB01’,’ONB’);the "Single Quotes" does not appear correct. They were probably typed into some other editor.
    When executed as
    execute  Get_next_campgn(‘ONB01’,’ONB’);
    Error starting at line 1 in command:
    begin
      Get_next_campgn(‘ONB01’,’ONB’);
    end;
    Error report:
    ORA-06550: line 2, column 19:
    PLS-00103: Encountered the symbol "‘" when expecting one of the following:
       ( ) - + case mod new not null <an identifier>
       <a double-quoted delimited-identifier> <a bind variable>
       table continue avg count current exists max min prior sql
       stddev sum variance execute multiset the both leading
       trailing forall merge year month day hour minute second
       timezone_hour timezone_minute timezone_region timezone_abbr
       time timestamp interval date
       <a string literal with character set specification>
    06550. 00000 -  "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:So, just replace them in any SQL editor and your Invoker block shall work properly.
    Regards,
    P.

  • ORA-01031 error while executing package..

    Hi All,
    user is getting an error ORA-01031 while executing a procedure (i.e create or replace procedure).
    Please let me know how I can trobuleshoot it..let me know the script to check the required privileges..
    Thanks a lot.......

    It's not a bug, check Oracle doc,
    System Privileges Needed to Create or Alter a Procedure
    http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/authoriz.htm#i1009241
    To create a procedure, you must have been explicitly granted the necessary privileges (system or object) on all objects referenced by the procedure. You cannot have obtained the required privileges through roles. This includes the EXECUTE privilege for any procedures that are called inside the procedure being created.

  • Need Help on Executing Shell Scripts through PL-SLQ

    Hi All,
    I am trying to execute a shell script from PL-SQL but I am not getting it right .
    the code i used is as follows
    ----JAVA CLASS ---
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "Host" AS
    import java.io.*;
    public class Host {
    public static void executeCommand(String command) {
    try {
    String[] finalCommand;
    if (isWindows()) {
    finalCommand = new String[4];
    // Use the appropriate path for your windows version.
    finalCommand[0] = "C:\\windows\\system32\\cmd.exe"; // Windows XP/2003
    //finalCommand[0] = "C:\\winnt\\system32\\cmd.exe"; // Windows NT/2000
    finalCommand[1] = "/y";
    finalCommand[2] = "/c";
    finalCommand[3] = command;
    else {
    finalCommand = new String[3];
    finalCommand[0] = "/bin/sh";
    finalCommand[1] = "-c";
    finalCommand[2] = command;
    final Process pr = Runtime.getRuntime().exec(finalCommand);
    pr.waitFor();
    new Thread(new Runnable(){
    public void run() {
    BufferedReader br_in = null;
    try {
    br_in = new BufferedReader(new InputStreamReader(pr.getInputStream()));
    String buff = null;
    while ((buff = br_in.readLine()) != null) {
    System.out.println("Process out :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_in.close();
    catch (IOException ioe) {
    System.out.println("Exception caught printing process output.");
    ioe.printStackTrace();
    finally {
    try {
    br_in.close();
    } catch (Exception ex) {}
    }).start();
    new Thread(new Runnable(){
    public void run() {
    BufferedReader br_err = null;
    try {
    br_err = new BufferedReader(new InputStreamReader(pr.getErrorStream()));
    String buff = null;
    while ((buff = br_err.readLine()) != null) {
    System.out.println("Process err :" + buff);
    try {Thread.sleep(100); } catch(Exception e) {}
    br_err.close();
    catch (IOException ioe) {
    System.out.println("Exception caught printing process error.");
    ioe.printStackTrace();
    finally {
    try {
    br_err.close();
    } catch (Exception ex) {}
    }).start();
    catch (Exception ex) {
    System.out.println(ex.getLocalizedMessage());
    public static boolean isWindows() {
    if (System.getProperty("os.name").toLowerCase().indexOf("windows") != -1)
    return true;
    else
    return false;
    ---PROCEDURE TO BE EXECUTED WHICH USES THE ABOVE JAVA CLASS IS ----
    CREATE OR REPLACE PROCEDURE Host_Command (p_command IN VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'Host.executeCommand (java.lang.String)';
    --- THE PERMISSIONS ---
    call dbms_java.grant_permission('SYSTEM', 'SYS:java.io.FilePermission', '<<ALL FILES>>', 'read ,write, execute, delete');
    call dbms_java.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'writeFileDescriptor', '');
    call dbms_java.grant_permission('SYSTEM', 'SYS:java.lang.RuntimePermission', 'readFileDescriptor', '');
    --- THE SHELL SCRIPT IS -----
    #!/bin/sh
    # This script removes the carriage returns from the Files having .DAT1 extensions in the /test/ Directory
    # and the sends the single line stream to the new file with the use of 'gawk' command
    # so finaly the files with same primary name but different secondary name are created
    # e.g. file 'test.DAT1' is onverted to 'test.DAT'
    # LOOP on /test/ DIRECTORY FOR SEARCHING FILES HAVING EXTENSION *.DAT1
    for file_name in `ls /test/*.DAT1`
    do
    new_file_name=`echo $file_name | sed 's/DAT1/DAT/'`
    # SEND THE CONTAINTS OF SELECTED FILE IN LOOP AS A CONTINUOUS STREAM TO NEW FILE NAME USING 'gawk' COMMAND
    gawk 'BEGIN { ORS = "''" } { print $0 }' $file_name >> $new_file_name
    # ABOVE LINE WILL CREATE A NEW FILE WITH SAME PRIMARY NAME BUT .DAT AS SECONDARY NAME(EXTENSION)
    # REMOVE THE PRIOR FILE(s) AFTER SUCCESSFUL CALL TO 'gawk'
    # $? returns 0 if the call to gawk command is succesfull
    if test 0 = "$?"
         then
         rm -f $file_name
    fi
    done
    # END LOOP ON /test/ DIRECTORY
    ---THE CALL TO THE PROCEDURE --
    SQL>CALL DBMS_JAVA.SET_OUTPUT(1000000);
    SQL>SET SERVEROUTPUT ON SIZE 1000000
    SQL>exec host('/root/sh ecs_script.sh'); -----------------------------------------------1
    now, the statement 1 is the path of the Shell Script ecs_script.sh
    which uses gawk command and does some operations on some file..
    but when i give the call in Statement 1 its giving error like
    /bin/sh is not a directory
    so i am not getting wHat should I do so that my script "ecs_script.sh" gets executed..
    Please Help.

    @ Bhagat & Michaels
    Dear Friends,
    I changed my shell name as per ur suggestions
    and recompiled the Java class source with
    finalCommand[0] = "/bin/bash"; instead of finalCommand[0] = "/bin/sh";
    and then recompiled the host procedure
    executed the host procedure as per ur suggestion as follows (with out put)
    SQL> exec host('/bin/bash ecs_script.sh')
    PL/SQL procedure successfully completed.
    bt, bt, bt, it still did not do any operations defined in the "ecs_script.sh"
    in fact the script did nt executed.......
    pls help , I am loosing my time..
    regards.

  • How to set the time limit to execute shell script

    I am using Runtime exec() method to execute a shell script
    if the script hangs for long time infinitely then how to get the control
    return to the program.
    Thanks in advance

    rmi_rajkumar wrote:
    let me explain with an example
    script name is test.sh
    Runtime.exec("test.sh") this will start a new process
    if (proc.waitFor() == 0) {
    try {
    InputStreamReader isr = new InputStreamReader(proc.getInputStream());
    BufferedReader br = new BufferedReader(isr);
    String line;
    while ((line = br.readLine()) != null) {
    outputBuf.append(line).append(ConfigOptions.getLineModeStr());
    } catch (IOException ioe) {
    if test.sh did not exit and hangs with no response
    in this case proc.waitFor() will not execute try catch the control will remain if statement
    my question is insteadof waiting indefinitely need to set a time out say 1 hour and kill the process that executed the scriptYou really need to read the article in the link given by another poster. Your code will not work correctly because you are waiting for the process to end before reading the stream and the processes may never end because you are not reading the stream until after it ends (you need to use muli-threading as explained in the article). If the process really did hange you could probably use destroy(); but, for now, the real problem is your code.

Maybe you are looking for