Shell script error

isitpasrd03 {icfgtst2} / opt/apps/oracle > cat text.sh
#! / bin/ksh
Value1='/apps/opt/Oracle/product/10.2.0/bin/sqlplus-silencieux / as sysdba < < END
set pagesize 0 feedback off verify off position off off echo
Col TIME_TAKEN_DISPLAY to a10
Col INPUT_BYTES_DISPLAY to a10
Col OUTPUT_BYTES_DISPLAY to a10
Select value start_time, end_time, output_device_type, input_type, status, time_taken_display, input_bytes_display, output_bytes_display from v$ RMAN_BACKUP_JOB_DETAILS where to_date (Start_time, 'DD-MON-YY') = to_date(sysdate,'DD-MON-YY');
`

echo '$VALUE1 '.


isitpasrd03 {icfgtst2} / opt/apps/oracle > sh text.sh
Select value start_time, end_time, output_device_type, input_type, status, time_taken_display, input_bytes_display, output_bytes_display V where to_date (Start_time, 'DD-MON-YY') = to_date(sysdate,'DD-MON-YY')
*
ERROR on line 1:
ORA-00942: table or view does not exist


I don't understand what's wrong... can someone help me on this pls...

Use this code:

#!/bin/ksh
VALUE1=`/apps/opt/oracle/product/10.2.0/bin/sqlplus -silent / as sysdba <

Tags: Database

Similar Questions

  • Shell script error: EXPECTED integer

    Hello

    I have a shell script:

    If test $#-No 3

    then

    echo "error: Incorrect number of parameters.

    echo "use: install.sh fist_day_of_the_month user pass.

    ECHO «»

    Output 1

    FI

    #pas 1

    sqlplus-s $2 / $3 @pas1.sql $1 > > $0.log;

    #verificare lame date

    User = $2

    passdb = $3

    get_Count () {}

    sqlplus-s ${user} / ${passdb} < <!

    set the position

    Set feedback off

    set pages 0

    SELECT COUNT (TI. CUSTOMERID)

    OF MBTIBUSER. TEMP_IB TI, MBTIBUSER. TEMP_MB TM

    WHERE TI. CUSTOMERID = TM. CUSTOMERID

    AND TI. REGULARFEEFORIB_AC IS NULL

    OR TI. INITIALFEEFORIB_AC IS NULL

    OR TM. INITIALFEEFORMOBILE_AC IS NULL

    OR TM. REGULARFEEFORMOBILE_AC IS NULL

    Group 1;

    !

    }

    Count = $(get_Count)

    echo $count

    If ["$count" - gt 0]; then

    echo ' STOP! "Nu exista curs valutar pentru ultima zi a lunii of billing.

    sqlplus-s $2 / $3 @STOP.sql > > $0.log;

    on the other

    echo 'OK '.

    FI

    I got the error "'integer should ' on the line: If ["$count"- gt 0];" then

    Do you have any ideeas?

    Thank you

    Claudiu

    I got the error "whole expression should" on the line: If ["$count" - gt 0]; then

    Remove the quotes from $count

    If [$count - gt 0]; then

  • AppleScript and shell scripts

    I'm on Mac OS X 10.11.2 and have problems with AppleScript and shell scripting.

    The following script is a cutting of a larger project:

    Tell application "Finder".

    the value the_MePath (path for me)

    the value the_MeCont (the_MePath container) as string

    tell the end

    the value of the_MeCont (text 1 thru-2) the_MeContShell

    -normally isn't here!

    the value the_MePara (the_MeCont & "STH - C Para WAV_48k_24.txt")

    the value the_Parameters (opening for access file the_MePara with permission to write)

    write ("WAV\r24\r48000\r48k\r") the_Parameters

    Close access the_Parameters

    -normally isn't here!

    -destined to be there!

    -the value the_MePara (shell script 'find' & city form the_MeContShell POSIX path & "-iname" "Para STH - C *'")

    the value the_Parameters (opening for access file the_MePara)

    the value the_ParaList (read the the_MePara file)

    Close access the_Parameters

    paragraph 1 of the value userFormat the_ParaList

    paragraph 2 of the the_ParaList the value userBitDepth

    paragraph 3 of the the_ParaList the value userSampleRate

    paragraph 4 of the the_ParaList the value shortSampleRate

    The lines between the "-normally isn't there!"-lines fills a file in the directory of the AppleScript with the data.

    So now the file is there.

    If I remove these lines and enable the line below "-intended to be here! ', the shell should find this file.

    What I get, then, is a mistake:

    "Fehler beim Zugriff auf das Netzwerk." error number - 5000 file "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt" to "class fsrf".

    to "open for access file the_MePara.

    Any ideas, anyone?

    Kind regards...

    ... Maik

    Hello

    Remove the end of file before the_MePara.

    the_MePara contains a posix path type path--> "/ users/shared/_AppleScript development/_Archiv Sniplets/STH-C Para WAV_48k_24.txt.

    You can use the file on the path of type HFS --> ' StartupDiskName:Users: shared: _AppleScript development: _Archiv Sniplets:STH - C Para WAV_48k_24.txt.

    Information:

    The script didn't need to open and close the access when the script to read-only.

    Use this line only--> the value the_ParaList to read the_MePara

  • OBIEE-Shell Script

    Hi all

    I'm trying my hands on scripting in OBIEE. I wrote following script

    #!/bin/bash
    export PATH=$PATH::$HOME/bin:/u01/app/oracle/obiee117g/instances/instance1/bin
    . /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl status
    
    

    When I run this script. I get the following error.

    /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 25: =: command not found
    /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 26: =: command not found
    /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: syntax error near unexpected token `('
    /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl: line 28: `%commands = ('
    

    What Miss me?

    Thank you

    V

    TL; DR: this point on the third line of your script is redundant and the origin of the problem. Run this instead:

    /u01/app/oracle/obiee117g/instances/instance1/bin/opmnctl status
    

    Also, since you are using the absolute path (that is the full path to opmnctl, starting with a /) setting the environment variable PATH is redundant.

    Explanation:

    The dot is a shortcut for the command of the source , which has a different behavior to just run the script directly.

    You use source when you are wanting to run a script to set the environment etc. variables (an example of this is the script of bi - init.sh, which implements the OBI environment to run utilities such as nqcmd).

    If you open opmnctl itself, you will see that it is a perl script. The "shebang" on the first line tells linux to run the script using the perl interpreter, and I suppose when you are sourcing it Linux tries to pass under the shell running (bash) - and the perl language throws the bash syntax errors that you see

    More information: executable - different ways to execute a shell script - Unix & Linux change battery source or dot operator Man Page. Bash | SS64.com

  • CDF to run commands / Shell scripts

    Hi friends,

    I need help serious here regarding the CDF function.

    I created a JAR file to run batch/shell scripts via the calculation script.

    I tested the JAR file and it works perfectly well that run without the calculation script, but I get errors including in Calc script, I get the error message.

    Initially, the error was: error of Machine virtual Java and later, it is class not found.

    Here are the steps to register the CDF:

    1. place the JAR file in the location: E:\Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer\java\udf\

    2. update the file udf.policy with the following statement:

    Grants all permissions to BatEx

    give the code "file:${essbase.java.home}/BatEx.jar" {}

    permission java.security.AllPermission;

    };

    3 restart the Essbase services.

    4. I am trying to create this function at Global level so no mention is not the name of the Application in the MaxL at registration:

    create or replace function '@BatEx' as

    "BatEx.

    Spec '@BatEx(Complete path in double quotes) '.

    Comment "Functions A CDF that runs the batch file in Essbase Server";

    5 this is the calc script:

    @BatEx 'E:/Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat '; -It gives an error: error: invalid syntax 1012000 - not a command CALC [@BatEx]

    I tried another way:

    RUNJAVA @BatEx 'E:/Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat '; -Gives an error: problem running [@BatEx 'E:/Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat']: [can't find @BatEx class]

    Where I am wrong here? Please help me out here.

    Kind regards

    RB

    Thanks much Amit and Jake! I finally cracked!

    Sad thing is that I have found no OTN correct information regarding function Java Custom, rather there was a lot of information about CDFs pre-existing provided by Oracle, so I decided to write a complete solution of CDF, where Java code too was created by the developer of Essbase applications.

    The requirement that I had was to trigger the batch file in the calculation script. Here is the detailed requirement:

    Update Variable of Substitution by planning web form.

    1. the user enters the data in the form of the planning web and saves it.

    2. the calc script attached to the web form, extracts data and records the flat file on Essbase server.

    3. earlier we were executing the script batch on the web server as the workflow will identify the lots on the web server and not on Essbase server, but after the development of this CDF to run the batch job, the batch files can be run directly Essbase server.

    4. the idea is to keep the user limited to the tasks list, so that it does not jump to the to-do list to SubVar web form, workflow and then return to the task list for a simple job to change SubVar.

    There were a few challenges that I encountered during the development of this JAVA function, namely:

    1 function CDF records do not : I tested JAVA code separately using command line and the executable Jar file will execute the batch, as expected. But I couldn't get why my CDF is not have recorded trace. After a lot of searching on Google and analysis, I found that it was the difference between the Version of JAVA (the JAVA compiler I used to compile and create my JAR file) and JAVA (JVM Essbase) virtual machine. I used JDK 1.7 update 65 to compile and create my POT so that the JVM used in the Essbase Server Update 1.6 is 35. I uninstalled JDK 1.7 of my machine, downloaded Update 1.6 35 archives of the Oracle and recompiled the code. Guess what! My CDF function was recorded first.

    So always check the compatibility of the Version of the JDK you used to compile and create the JAR file and JVM on your Essbase server.

    You can check the version of the JVM in console EAS-> EssbaseCluster-> right click-> Edit-> properties-> tab environment. There is a line that appears something like:

    ; JvmModuleLocation $J (EPM_ORACLE_HOME)-...-jdk160_35\jre\bin\server\jvm.dll (the bold is your version of the JVM).

    2. "main class not found" error after successful registration of CDF:

    I haven't had that one category of Public in my JAVA code and this error took me by surprise. I also checked the "public static void main" section in my code and everything seems to be OK. Please note that JAVA is case sensitive - 'hand' and 'Hand' aren't even in JAVA.

    I did some further research and one of John's response to a CDF request, I came to know that I need to include another argument (context) in the main section of my Java code and recompile with classpath "essbase.jar" (I will explain the controls in the next steps). I changed the main section of my JAVA code and included the argument:

    Public Shared Sub main (paramContext context, String [] paramArrayOfString)

    The following JAVA code to perform the batch in Essbase Server:

    import com.hyperion.essbase.calculator.Context;

    import java.io.BufferedReader;

    import java.io.InputStream;

    import java.io.InputStreamReader;

    import java.io.OutputStream;

    import java.io.PrintStream;

    public class BatEx

    {

    Public Shared Sub main (context, paramContext, String [] paramArrayOfString)

    {

    Try

    {

    String str1 = paramArrayOfString [0];

    LocalProcess process = Runtime.getRuntime () .exec (str1);

    InputStream localInputStream1 = localProcess.getInputStream ();

    OutputStream localOutputStream = localProcess.getOutputStream ();

    InputStream localInputStream2 = localProcess.getErrorStream ();

    BufferedReader in = new BufferedReader (new InputStreamReader (localInputStream1)) localBufferedReader;

    String str2;

    While ((str2 = localBufferedReader.readLine ())! = null) {}

    System.out.println (str2);

    }

    System.out.println ("package executed successfully.");

    }

    catch (Exception localException)

    {

    System.out.println ("error!:" + localException);

    localException.printStackTrace ();

    }

    }

    }

    Install the (compatible to Essbase JVM) compatible version of the JDK on your machine. Compile the above code by using the following command:

    C:\ >javac - classpath essbase.jar BatEx.java - please specify the path to the file "essbase.jar". It generally to the location: : \Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer\java\

    The code should compile without any problem, and a .class file must be created with the same name.

    Now is the time to create the JAR file. Use the following command:

    C:\ >jar cf BatEx.jar BatEx.class

    Now the executable JAR file must also be created.

    Place this JAR file: : \Oracle\Middleware\EPMSystem11R1\products\Essbase\EssbaseServer\java\udf\

    Restart the service of Essbase and application (the only Application Restarting should work, but I didn't take any chances to restart both).

    Check the log of function CDF recording applications. The application log should be at the location:

    : \Oracle\Middleware\user_projects\epmsystem3\diagnostics\logs\essbase\essbase\app\-

    The CDF enrollment message should be something like:

    External function of [GLOBAL] [@BatEx] saved OK

    I used the following MaxL to register my function in Essbase:

    create or replace function '@BatEx' as

    "BatEx.

    Spec '@BatEx (StringArray).

    Comment "Functions A CDF that runs the batch file in Essbase Server"

    I used the following script to calc to run my CDF (fairly simple however):

    ESS_LOCALE English_UnitedStates.Latin1@Binary

    RUNJAVA BatEx "": / Oracle/Middleware/EPMSystem11R1/common/utilities/Test.bat ";" -Note: please replace with the name of the physical drive.

    I went and checked the logs that the Test.bat written and "wallah! The log file had some content and 1 KB in size. I deleted the contents of the log file and checked again, the result was the same.

    Hope this answer helps all of us who work on CDF that is clean.

    Please like this post if this can help you in some way.

    Thanks again to Amit, Jake and John for helping me solve this puzzle.

    Kind regards

    Amit Kumar Singh

  • OEDQ 9.0.8 - external task - execution of Shell Script

    Hello Disqualification Experts.

    I am looking for your expert advise on this... With the help of the external task I am able to call the .bat (batchfiles) but I'm not able to run .ksh (UNIX shell script file), attached is the example script I am trying to run via the external task.

    File name: testfile.ksh

    #! / usr/bin/ksh

    Set - x

    $ORACLE_HOME/bin/sqlplus - s edq_test/edqtest@edqd < < EOF

    WHENEVER SQLERROR EXIT SQL. SQLCODE

    EXECUTE SP_TRUNCATE_TABLE ('ABC_OWN', 'ABC_TABLE');

    COMMIT;

    quit smoking;

    EXPRESSIONS OF FOLKLORE

    output

    Disqualification-> Manager-> External tasks-> Creates a new task called TestTask who has the below...

    Command: testfile.ksh

    Working directory: \opt\local\software\edq\config\commandarea

    Get this error Message:

    The external task (Execute testfile.ksh) failed because of the following exception: cannot run program "/ opt/local/software/edq/config/commandarea/testfile.ksh": error = 2. No such file or directory

    Thanks in advance!

    BG

    Dear Richard, thank you for your prompt response.

    # / bin/bash helped and I also have to export the ORACLE_HOME in the script, somehow the $ORACLE_HOME is not recognized by the external task.

    Example of Script working:

    #! / bin/bash

    export ORACLE_HOME=/ora02/oracle/product/11.2.0.4/client

    $ORACLE_HOME/bin/sqlplus - s edq_test/edqtest@edqdev<>

    WHENEVER SQLERROR EXIT SQL. SQLCODE

    EXECUTE SP_TRUNCATE_TABLE ('ABC_SCHEMA', 'ABC_TABLE');

    COMMIT;

    QUIT SMOKING;

    EXPRESSIONS OF FOLKLORE

    output

    Thanks for your help!

    BG

  • Query does not not in shell scripts

    Hi Experts,

    I created a query to check the temp tablespace use in production servers and I wanted to run the query using shell scripts, but when I run the query in the script I get no error or output I am unale to correct where exactly, I make the mistake

    This is the query

    SELECT A.tablespace_name 'space', D.gb_total, ROUND (SUM (A.used_blocks * D.block_size) / 1024 / 1024/1024,2) "gb_used", ROUND (D.gb_total - SUM (A.used_blocks * D.block_size) / 1024 / 1024/1024,2) 'gb_free' v$ \sort_segment A, (SELECT B.name, C.block_size, ROUND(SUM (C.bytes) / 1024 / 1024/1024,2) 'gb_total' v$ \tablespace B, v$ \tempfile C WHERE B.ts #= C.ts # GROUP BY B.name, C.block_size) D WHERE A.tablespace_name = D.name GROUP by A.tablespace_name D.gb_total

    You can help in this.

    Thank you...

    Basic Linux/Unix shell script format

    #! / bin/sh

    oracle set environment #.

    Export ORACLE_HOME =...

    export of SID =... or TWO_TASK = export

    .. etc.

    # launch sqlplus

    sqlplus-s/nolog<>

    Connect scott/tiger

    together... environment of sqlplus

    -execution of script sql (or sql query)

    @script.sql

    output

    EXPRESSIONS OF FOLKLORE

    #end script

    Character $ is interpreted by the shell as environment variables, you must escape the $ character is as well as it not assimilated to the variable approx.

    For example, v$ instance should be written as v$ instance.

  • SQL more s in shell script

    Hi people

    I have this code in my shell script, but I get the below error please check
    sqlplus -s scott@xyz/tiger @1.sql > 1.log
    
    and oracle home is 
    
    /oracle/app/oracle/product/11.2.0/dbhome_1
    
    error thrown is
    
    Error 6 initializing SQL*Plus
    SP2-0667: Message file sp1<lang>.msb not found
    SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory
    
    i have checked i have sp1us.msb 
    Please help me on this

    Newbie says:
    Mr President, I gave my oracle home.

    How to check if she properly o?

    No, you said that you believe that oracle_home should be. But you have NOT proven that it was properly defined in the session that threw the error and the error itself is almost certain evidence that it was NOT set correctly. And your assertion that the referenced file exists (again, your assertion, not proof) gives more weight to the evidence that ORACLE_HOME is not set correctly.

    Run the following commands, and then copy and paste the whole session (complete order, full power) to your next assignment

    env |grep ORA|sort
    echo $PATH
    sqlplus -s scott@xyz/tiger @1.sql > 1.log
    
  • Shell script to catch DB

    Hi all

    I have oracle DB in Amazon EC2. This DB will go down and I have to make every day.

    I want to write a shell script that checks the State of the DB and do.

    The things I do is

    Log in as root
    Su - oracle

    sqlplus
    user name:
    PWD:

    If DB is down, it shows error.

    So I'll do it again
    Log in as root
    . / stopPageview
    Su - oracle
    sqlplus
    user name: sys as sysdba
    PWD:

    the judgment
    startup

    output
    output
    . / startPageview

    How automatically using shell script?

    Published by: 969707 on January 9, 2013 04:36

    #! / bin/bash
    #
    # /etc/init.d/oracledb
    #
    # Startup script execution for the Oracle Listener and instance level
    # It relies on information on/etc/oratab

    # These are the paths for our basic installation
    export ORACLE_BASE = / opt/oracle
    export ORACLE_HOME=/opt/oracle/product/11.1.0/db_1
    Export ORACLE_OWNR = oracle
    export PATH = $PATH: $ORACLE_HOME/bin

    If [! f $ORACLE_HOME/bin/dbstart - o! d $ORACLE_HOME]
    then
    echo "Oracle startup: cannot start.
    Output 1
    FI

    case '$1' in
    implementation)
    # Start a listener and oracle instance
    echo - n "starting from Oracle:
    known $ORACLE_OWNR - c "start ORACLE_HOME/bin/lsnrctl $".
    known $ORACLE_OWNR-c "$ORACLE_HOME/bin/dbstart $ORACLE_HOME.
    touch/var/lock/oracle
    echo 'OK '.
    ;;
    stop)
    # Stop listener and oracle instance
    echo - n "" shutdown Oracle: "."
    "judgment of $ORACLE_HOME/bin/lsnrctl" known $ORACLE_OWNR - c
    known $ORACLE_OWNR-c "$ORACLE_HOME/bin/dbshut $ORACLE_HOME.
    RM-f/var/lock/oracle
    echo 'OK '.
    ;;
    reload | restart)
    $0 stop
    starting at $ 0
    ;;
    *)
    echo "use:" basename $0' start | stop | restart | reload. "
    Output 1
    ESAC

    Exit 0

    also use link below to create start & stop the database...
    http://www.Oracle-base.com/articles/Linux/automating-database-startup-and-shutdown-on-Linux.php
    http://www.exzilla.NET/docs/instance/StartupNshutdownWithshell.php

    *****************************************
    Best regards
    Shishir Tekade.
    My Blog: http://shishirtekade.blogspot.com

  • How to connect to remote Oracle through shell script server.

    Hi, I'm new to Shell scripting. I try to connect to remote oracle system, but I think Sqlplus not found error. I have sqlplus executable inside bin under oracle home, but still, I get the same error. can someone guide me to get this thing done.

    export ORACLE_HOME=/opt/oracle/oracle11g/product/11.2.0
    export NLS_LANG = American_America.US7ASCII
    export LD_LIBRARY_PATH = $ORACLE_HOME/lib: $LD_LIBRARY_PATH
    Export ORACLE_PATH = $ORACLE_HOME/bin
    export PATH = $ORACLE_HOME/bin: $PATH

    sqlplus-s/nolog < < EOF
    connect wcadmin / [email protected]:1521 / wctest98
    Select * twice;
    output
    EXPRESSIONS OF FOLKLORE

    Please describe in more detail what you are doing. You run scripts 2 or is it in a script? If you set the variables of Oracle in a separate script, you need to run the script.

    Source to run a script, the commands in the script are executed as if you type to the current command prompt. A script that is not executed source will lose the variables that you define in the script when the script stops. You can source run a script using the '. '. " script" or "source" (bash). The export command adds variables to the environment of the executed orders later.

    See the following examples:

    cat > shelltest <
    
    Test1:
    $ a=a
    $ ./shelltest
    
    $ echo $a
    a
    
    Test2:
    $ export a=a
    $ ./shelltest
    a
    $ echo $a
    a
    
    Test3:
    $ . ./shelltest
    a
    $ echo $a
    b
    
  • Fail the query v$ views of shell script

    Hello world


    the following query is runing with a SQL * MORE (database is mounted and unopened)

    SQL > SELECT Member FROM v$ logfile;

    MEMBERS
    --------------------------------------------------------------------------------
    +Data/testgfi/onlinelog/group_1.298.773871647
    +Data/testgfi/onlinelog/group_2.294.773871647
    +Data/testgfi/onlinelog/group_3.295.773871647



    But in error if I run Shell script?

    $ s sqlplus "/ as sysdba" < < EOF
    SELECT Member FROM v$ logfile;
    EOF
    Member SELECT FROM v
    *
    ERROR on line 1:
    ORA-01219: database is not open: motions allowed on fixed tables/views only...


    Help, please...

    Thank you...

    Aljaro

    Aljaro wrote:
    Hello world

    the following query is runing with a SQL * MORE (database is mounted and unopened)

    SQL > SELECT Member FROM v$ logfile;

    MEMBERS
    --------------------------------------------------------------------------------
    +Data/testgfi/onlinelog/group_1.298.773871647
    +Data/testgfi/onlinelog/group_2.294.773871647
    +Data/testgfi/onlinelog/group_3.295.773871647

    But in error if I run Shell script?

    $ s sqlplus "/ as sysdba".<>

    SELECT Member FROM v$ logfile;

    change as below

    SELECT Member FROM v$ logfile;

  • VERY simple shell script makes me crazy!

    I have a two-line shell script to take a snapshot of a virtual machine. The script works and a snapshot is taken with the correct name and description using the vmware-cmd command. But I get an error as if the script tries to run the two parts of the same line.

    CODE

    #! / bin/sh

    "vmware-cmd /vmfs/volumes/Storage1/roadrunner.cooper.local/roadrunner.cooper.local.vmx"_BackupShot_""for snapshot backups"createsnapshot 1 0'.

    OUTPUT

    #./backup.sh

    . / backup.sh: line 3: createsnapshot (_BackupShot_,: command not found)

    I'm no expert in shell script, but I don't understand why this error occurs when the command runs perfectly!

    Thanks for any help!

    I would then use the backtick?

    In this case Yes, or you can also use:

    variable = $(ligne de commande)

    André

  • Problem to run the shell script procedure

    Hello

    I wrote a shell script which needs to execute the stored procedure

    The shell script:
    cat bi_loading2.sh
    #!/usr/bin/ksh
    export ORACLE_BASE=/u01/app/oracle
    export ORACLE_HOME=/u01/app/oracle/product/11.2.0/DWH11gR2
    export ORACLE_SID=DWH
    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
    echo "zero  arg  is  :$0"
    echo "First arg  is  :$1"
    echo "Second arg is  :$2"
    
    
    /u01/app/oracle/product/11.2.0/DWH11gR2/bin/sqlplus  system/xxx@dwh << EOF
    insert into SYSTEM.POC_EXDATA_RESULTS  values($1,'$2',sysdate,null);
    commit;
    
    
    execute system.$2;
         
    update SYSTEM.POC_EXDATA_RESULTS
    set end_date=sysdate
    where id= $1;
    
    commit;
    EOF
    exit 0
    The script gets two parameters: id (1) (2) the procedure that I have to run

    As you can see below oracle is to omit the 'run' command
    Please notice why I can't run the stored procedure.


    $ 83 poc_cf54xbx6cchf2 bi_loading2.sh
    zero  arg  is  :bi_loading2.sh
    First arg  is  :83
    Second arg is  :poc_cf54xbx6cchf2
    
    SQL*Plus: Release 11.2.0.2.0 Production on Thu Dec 15 17:46:37 2011
    Copyright (c) 1982, 2010, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    With the Partitioning, Automatic Storage Management and Real Application Testing options
    
    SQL> 
    1 row created.
    
    SQL> 
    Commit complete.
    
    SQL> SQL> SQL> BEGIN  system.poc_cf54xbx6cchf2; END;
    
                    *
    ERROR at line 1:
    ORA-06550: line 1, column 17:
    PLS-00103: Encountered the symbol "SYSTEM" when expecting one of the following:
    := . ( @ % ;
    The symbol ":=" was substituted for "SYSTEM" to continue.
    
    
    SQL> SQL>   2    3  
    4 rows updated.
    
    SQL> 
    Commit complete.

    Read the error stack.

    ORA-06512: at "SYSTEM.POC_CF54XBX6CCHF2", line 3
    

    The error is on line 3 of the POC_CF54XBX6CCHF2 procedure
    If the procedure is called.

    ----------
    Sybrand Bakker
    Senior Oracle DBA

  • How2 validate the chain of connection in unix shell script

    I am writing a shell script unix which removes the instance user/passwd/user, form a connection string and pass it to sqlplus. Now, I want to validate if a valid/clean connection string was formed. Basically, I want to do something like below

    sqlplus-s $CONN_STR

    and disconnect if valid string and always disconnect and return to guest if it's not a string valid.

    Is there a clean way, I can check if the return has been after a successful login and how disconnect it in script and check if a string is not valid.

    Create a file name test.sql containing only the OUTPUT and use-L option to SQL * more (attempts to connect only once, instead of reprompting error.)

    D:\>sqlplus -L hr/ko@XE @test.sql
    
    SQL*Plus: Release 11.1.0.6.0 - Production on Wed Feb 17 08:48:37 2010
    
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    
    ERROR:
    ORA-01017: invalid username/password; logon denied
    
    SP2-0751: Unable to connect to Oracle.  Exiting SQL*Plus
    
    D:\>echo %errorlevel%
    1
    
    D:\>sqlplus -L hr/hr@XE @test.sql
    
    SQL*Plus: Release 11.1.0.6.0 - Production on Wed Feb 17 08:48:49 2010
    
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    
    Connected to:
    Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    Disconnected from Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production
    
    D:\>echo %errorlevel%
    0
    
    D:\>sqlplus -L hr/hr@KO @test.sql
    
    SQL*Plus: Release 11.1.0.6.0 - Production on Wed Feb 17 08:52:22 2010
    
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    
    SP2-0751: Unable to connect to Oracle.  Exiting SQL*Plus
    D:\>echo %errorlevel%
    1
    
  • Password Oracle symbol # does not not in shell script

    I have the shell script that exports the database schema. My Userid password export subscription contains #. Shell script is throwing error. If we have the password without this character, then it works fine. How do we use the password in shell script to perform this task?

    $ORACLE_HOME/bin/expdp system/test #test = userid parfile test.par dumpfile = test.dmp =

    I tried to use double-quotes and apostrophes for this password... but it still does not. any help is appreciated.

    Please post the contents of test.par.

    You can try to run before running EXPDP:

    drop table SYSTEM.EXP_DEVDB06;
    

    Edited by: P. Forstmann on 27 Jan. 2010 17:46

    Edited by: P. Forstmann on 27 Jan. 2010 17:47

Maybe you are looking for