Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><code>ORACLE_HOME</code> isn't set in the <code>su</code> environment. The full path to the <code>lsnrctl</code> binary is being provided because <code>$ORACLE_HOME</code> is being expanded before <code>su</code> is called, so you're really doing:</p> <pre><code>su oracle -c "/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start CAPEX" &amp; </code></pre> <p>When you run it manually <code>ORACLE_HOME</code> is set, so it works. When run through <code>su</code> it isn't, but it still finds the binary since it has the full path. <code>dbstart</code> works because it resets <code>ORACLE_HOME</code> from the <code>oratab</code> entries as it processes them. The 'no message file' error is usually an indicator that <code>ORACLE_HOME</code> isn't set, and the permission error the code refers suggests it's looking for the <code>listener.ora</code> in the wrong place, presumably under the root directory.</p> <p>You can demonstrate this by having the script try to display the value:</p> <pre><code>su $ORACLE_OWNER -c "ORACLE_HOME is: \$ORACLE_HOME`" </code></pre> <p>You could set the <code>ORACLE_HOME</code> in the command you're running through <code>su</code>, as:</p> <pre><code>su $ORACLE_OWNER -c "ORACLE_HOME=$ORACLE_HOME;$ORACLE_HOME/bin/lsnrctl start CAPEX" &amp; </code></pre> <p>But it's simpler to <code>export</code> the variables in your script, which will make them visible to <code>su</code>:</p> <pre><code>export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 export ORACLE_OWNER=oracle </code></pre> <p>or</p> <pre><code>ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 ORACLE_OWNER=oracle export ORACLE_HOME ORACLE_OWNER </code></pre> <p>... depending on your shell.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload