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

Tags: Database

Similar Questions

  • 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

  • Put 'do shell script' multi-line with comments

    I would like to integrate a Bash in Applescript script, as it is on several lines with comments.

    The only documentation useful, that I can find is tn2065, but as far as I can see, it does not say how.

    What is the correct syntax?

    Maybe I'm missing something, but you can just write your script bash as a text object and passing to the shell script:

    game of longBashCommand to "# some relevant comments.

    CD /somedir

    / bin/something - foobar

    # one other comment here

    / bin/Gisèle

    ' # one other comment.

    the shell script longBashCommand

    The trickiest part is perhaps the need to escape some characters such as quotation marks in the command shell.

  • Get the progress and result of a shell script

    Hello

    I would use a shell script to convert MP3 / audio FLAC files MP3 files with a bitrate of 192kbs and do other things in Automator or AppleScript script.

    So I installed lame and flac with brew, run an Automator process with a selected file and perform an action of AppleScrip:

    on run {input, parameters}
    
      if input is not {} then
    
      repeat with theFile in input
    
      set posix_file to POSIX path of theFile
    
      if input is not {} then
    
      tell application "Terminal"
    
      set thescript to "/usr/local/bin/lame -b 192 \"" & posix_file & "\" "
    
      do script thescript
    
      end tell
    
      end if
    
      end repeat
    
      end if
    
      return input
    
    end run
    

    The Terminal window is there because you tell the Terminal to run your script - try using shell script.

  • 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

  • Insert a record, call a stored procedure and execute a shell script

    Hello

    I am trying to build a page APEX do these three things in order.

    #1. Insert a new record in a database table (pk, donnees_xml, attr1 and attr2, etc.) and download the XML file to the donnees_xml column

    #2. Save this XML file on a file system

    #3. Parse the XML file on a file system and update the database with the parsed data table

    I can do #1 with a regular shape based on the database table. I can do #2 with a stored procedure.

    I can do #3 with a shell script.

    I wonder how these tasks can be combined into a single action in APEX.

    do #1;

    If successful, do #2;

    If successful, do #3;

    I'd appreciate comments on this.

    Thank you

    Define a process of PL/SQL page submit that runs after the record is inserted, if P1_FILE is not null.

  • import program does not process customized when you use the shell script

    Hello

    I have the pkg in that

    PROC1 without leaving param in this procedure, I call you created proc2 import and program

    Now, I call this proc1 in the shell script, here my flat program to import does not work

    Why? and I try to use CONSCUB on proc1 using 2 output param which is errbuf, retcode in the newspaper, I'm "wrong number of arguments"

    Please help me?

    Thank you

    Renon,

    Proc1 is your first program at the same time, right?

    How many parameters is defined for that?

    You can paste a screenshot of the window parameter?

    If there is no parameter, just use this:

    $FND_TOP/bin/CONCSUB $LOGIN SQLAP 'Accounts payable Manager' WAIT ' rajesh' = N SIMULTANEOUS SQLAP PROC1

    Assuming that "Renon" is a username of fnd and the program is set in the Application of accounts payable.

    See you soon

    AJ

  • The work of the Disqualification of Linux Shell Script

    Hello

    We are the 11.1.1.7.3 with Weblogic Web server and Linux App Server Disqualification.

    I want to know how we can carry out the work of the Disqualification of the Linux and write these commands in the shell script.

    (1) present the task (run)

    (2) check the employment status to see if the work is in working condition or supplement

    I know that on Windows, it utility jmxtools.jar of command line operations in dnDirector/Tools folder. But I'm not able to find the jmxtools.jar file in one of the edq.home or edq.local.home of the directories under Linux install.

    Can you guide me to the location where the jmx utility will be available under Linux and also the command to check the status of the job?

    Thank you

    Ravi

    It's him!

    Jobs called via the command line interface return an exit status when finished.

    Monitor the precise status of the long-term work requires the use of the server of the Disqualification Console user interface.

  • Call Shell Script from within PL/SQL - using DBMS_PIPE

    Hi all

    I'm trying to run a shell script inside my PL/SQL using DBMS_PIPE block (not sure if this is the right way or not)

    Pl Sql script

    ==========

    Set serveroutput size 100000

    declare

    cursor c1 is select * from mag_images

    where nom_image like '% comp2.

    v_path varchar2 (100): = ' / home/maguzzi/DOCUMENTS_DIR / ";

    v_result number: = 0;

    v_in_filename varchar2 (100): = v_path | ' test_file.jpg';

    v_out_filename varchar2 (100): = v_path | ' test_file_out.jpg';

    v_script varchar2 (100): = "tst_convert.sh";

    v_command varchar2 (200): = 'sh'. v_path | v_script | » '|| v_in_filename | » '|| v_out_filename;

    Start

    A1 to c1 loop

    dbms_output.put_line ('v_command: ' | v_command);

    write_to_file ('test_file.jpg', 'DOCUMENTS_DIR', a1. Content);

    dbms_output.put_line (' file write result: ' | v_result);

    v_result: = exec_host_command (v_command);

    dbms_output.put_line (' resize result :'|| file v_result);

    end loop;

    end;

    Result DBMS_OUTPUT

    ====================

    v_command: /home/maguzzi/DOCUMENTS_DIR/tst_convert.sh test_file.jpg test_file_out.jpg

    Result of the entry of the file: 0

    Result of resizing the file: 0

    PL/SQL procedure successfully completed.

    Function exec_host_command

    =======================

    FUNCTION to CREATE or REPLACE exec_host_command (lc_cmd IN VARCHAR2)

    RETURN INTEGER IS

    ln_status NUMBER;

    lc_errormsg VARCHAR2 (80);

    lc_pipe_name VARCHAR2 (30);

    BEGIN

    lc_pipe_name: = 'Maguzzi_PIPE ';

    DBMS_PIPE. PACK_MESSAGE (lc_cmd);

    ln_status: = dbms_pipe.send_message (lc_pipe_name);

    RETURN ln_status;

    END;

    /

    The Image of the BLOB is written to the correct location on the server "test_file.jpg", and although the exec_host_command function returns a value of 0, the shell script (tst_convert.sh) is not executed (i.e. no output file is created - outfile.txt and the image is not copied/converted to a new file name "" test_file_out.jpg" )

    Shell script

    ========

    tst_convert.sh

    echo 'Here' > outfile.txt

    Echo $1 > > outfile.txt

    Echo $2 > > outfile.txt

    resizing to convert $1 - $200 2

    Could this be problems with permissions on files?

    test_file1.jpg has permission - rw-rw-r-

    test_convert.sh a permission rwxrwxrwx

    When I run the script manually and pass in 2 parameters ($1 = infilename and $2 = outfilename), it works...

    I'd appreciate if someone can point out my mistake or suggest another method that works.

    Thanks in advance

    How long does it take to create the converted file? Remember that the external Scheduler is running asynchronously, so it is possible that the converted file does not exist yet when the PL/SQL block subsequently tries to open it.

    Try to add some delay seconds to the routine to ensure that the external task is completed:

        begin
          dbms_scheduler.create_job(
              job_name => 'MAG_IMAGE_CONVERT2'
            , job_type => 'EXECUTABLE'
            , job_action => '/home/oracle/DOCUMENTS_DIR/tst_convert2.sh' );--  '/home/oracle/DOCUMENTS_DIR/tst_convert.sh');
          dbms_scheduler.enable('MAG_IMAGE_CONVERT2');
          dbms_lock.sleep(3);
        end;
    

    This probably isn't really a viable solution in the long term if it turns out that this is really the problem.

  • will not appear sql statemnt in shell script

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Hello

    2650697 wrote:

    Hello

    I have a shell script with an unfavourable sql she calls another script where I connect to dabase.

    In the journal of the script, I see the sql statement and I wish that that do not show me anything. How I make these?

    Thank you

    Your postal code.  It is very difficult to tell what you're doing wrong without knowing what you are doing.

    You can have SQL statements directly in your shell script.  They must be in a script by themselves, said fubar.sql, and shell script must contain

    @fubar

    instead of real SQL statements.

  • Re: Unix shell script to notify if an array has reached a number of lines

    Looking to write a script to send an alert notification when an Oracle database table object reaches a certain value of line number. If anyone has the logic "If this while" for a script shell unix would be great.

    With the logic of control and check on the table when it reaches the total line number can be added to the script and on-demand via cron.

    Thank you.

    Thus, you must periodically (how often?) a COUNT (*) on the target table?  Is this acceptable overhead?

    /Korn Bourne shell scripts can compare numbers and check if one is greater than another.  See "-gt" UNIX - Shell basic operators

    Hemant K Collette

  • Using the shell script sql variable

    OS: Oracle Linux 5.10

    DB Oracle 11.2.0

    I have need to query the database and assign the return value to a variable of shell, but it does not work.

    create table imr_env (key varchar2(1000), value varchar2(1000) ;
    insert into imr_env values('TblspcUsagePct','90');
    commit;
    

    Here is the shell script:

    #!/bin/bash
    echo "in script"
    ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1 ; export ORACLE_HOME
    ORACLE_SID=IMR1 ; export ORACLE_SID
    export PATH=$PATH:$ORACLE_HOME/bin
    
    pct=`sqlplus -S app/manager <<END
           set serveroutput on
           declare
              output_val number ;
           BEGIN
              select value into output_val from imr_env where key = 'TblspcUsagePct' ;
              dbms_output.put_line('output_val: ' || to_char(output_val)) ;
           END ;
           /
           exit;
    END`
    
    ## another sqlplus connection, use $pct in the where clause
    
    echo "var value is $pct"
    
    

    Here is the result:

    SQL> ./test.sh
    in script
    var value is 
    
    output_val: 90
    

    Why isn't the shell variable is populated with the value retrieved from the database?

    I need to use $pct in another query that will be storage spaces that are at least 90% full.

    I had to change to a korn shell - I couldn't get the "READ" command in shell or bash.

    But it is not only "READ" command:

    SQL > select * from IMR_ENV;

    THE KEY VALUE

    ------------------------- -----

    TblspcWarningLimit 90

    TblspcUsagePct 50

    SQL > exit

    Disconnected from the database to Oracle 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    With partitioning, OLAP, Data Mining and Real Application Testing options

    $ cat test.sh

    VAL = $(sqlplus-S test/test)<>

    Set feedback off

    set the position

    Select (value) from imr_env, including the key to_number = "TblspcUsagePct";

    Select (value) from imr_env, including the key to_number = "TblspcWarningLimit";

    "exit";

    EXPRESSIONS OF FOLKLORE

    )

    set $VAL

    Echo $1

    Echo $2

    $./test.sh

    50

    90

    $ echo $SHELL

    / bin/bash

    $

  • 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

  • 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

  • Symlink for Shell Script in concurrent programs

    Hi all

    Suppose we have a simultaneous program to host type. Now, we need to make changes in the Shell Script for the new requirement.

    Kindly asking you to confirm if we need to create the symbolic link .prog new file or existing link will work perfectly.

    Kind regards

    Amit

    Hi Amit,

    You do not have to re - create the soft link will work perfectly. I've tested and works.

    Kind regards

    Neeraj.

Maybe you are looking for

  • Impossible to uninstall foxfilter

    I can't uninstall FoxFilter. When I click on Add - ons, it will not be open to uninstall the add-on. I don't want to pay for the program. I tried to uninstall FireFox and re - install, but it's still there. How to remove this add-on?

  • IMovie 10 can be used to edit videos of 2 hours?

    I live in a community band events for others to view later. Until now, the volunteer writers have used iMovie 6, because this version, say, is the most recent who can edit videos of 2 hours. I would switch to iMovie 10, which is what I have on my new

  • LabVIEW 2009 x 32 and x 64 on windows 7 x 64 install error

    When you try to install the evaluation version of labview installed by clicking on the labview test free link on ni.com, I encounter a Setup error. the complete error appears in the attachment below and is as follows; The VC2005MSMs OR x 64 installat

  • start the host vi pxi

    Hello I'm sure that this issue has a very simple answer, I can't find what it is.  I'm trying to implement a process of data acquisition on a PXI system.  I use a vi on the host PC to control the DAQ vi on the PXI target.  How to cause the host vi to

  • Edge 520: Start error

    When I start and I get to my page of password my computer goes to an error with the error 000000 page I couldn't get all the numbers, but at the bottom of the page, it performs a memory dump and that goes to where you can choose the choice of safe mo