Not able to call sql script from shell program

Hi Gurus,
I am facing issue while calling sqlplus script from my shell program. Please find below my shell script. This program I've written and registered as for one of concurrent program
in oracle applications.
p_userid_passwd=$1
p_appl_login=$2
p_user_name=$3
p_request_id=$4
v_conc_request_id=${5}
p_to_role=${6}
p_from_role=${7}
p_subject=${8}
p_body=${9}
p_dist_list=${10}
v_request=${11}
v_file_path_name=/u01/oraspt/REQUEST
cd $APPLCSF/$APPLOUT
echo "v_conc_request_id" $v_conc_request_id
echo "p_to_role" $p_to_role
echo "p_from_role" $p_from_role
echo "p_subject" $p_subject
echo "p_body" $p_body
echo "p_dist_list" $p_dist_list
echo "v_request" $v_request
ls -l $v_request
if [ $? -ne 0 ]
then
   echo "No output request generated"
else
   echo "Output request generated" 
fi
echo "connecting to ftp for placing out file to DB server"
echo FTP to 99.60.17.11
echo username: "oraspt"
echo pw:        
ftp -i -n 99.60.17.11 << EOF2
user "oraspt" orakdk
cd $v_file_path_name
put $v_request
bye
EOF2
output=`sqlplus -s /nolog <<EOT
whenever sqlerror exit failure;
connect  apps/apps
set verify off;
set serveroutput on size 120000;
       DECLARE
         l_errbuf      varchar2(300);
         l_retcode     varchar2(300);
       BEGIN      
        XXFND_SEND_MAIL.SEND_NOTIFICATIONS(  errbuf        => l_errbuf
                                           , retcode       => l_retcode
                                           , p_request_id  => $v_conc_request_id
                                           , p_to_role     => $p_to_role
                                           , p_from_role   => $p_from_role
                                           , p_subject     => $p_subject
                                           , p_body        => $p_body
                                           , p_dist_list   => $p_dist_list);
     EXCEPTION
        when others then
           dbms_output.put_line('Error encountered :'||SQLERRM);
     END;    
EOT
`
echo "connecting to ftp for deleting output file"     
echo FTP to 99.60.17.11
echo username: "oraspt"
echo pw:        
ftp -i -n 99.60.17.11 << EOF2
user "oraspt" orakdk
cd $v_file_path_name
delete $v_request
bye
EOF2
echo "Deleted successfully"Output for script is as below
v_conc_request_id 451906
p_to_role DC.DKHOO
p_from_role DC.DKHOO
p_subject Receivable audit report10
p_body Please find Audit Report Attachment.
p_dist_list
v_request o451906.out
-rw-r--r-- 1 applspt dba 2368 Dec 28 15:06 o451906.out
Output request generated
connecting to ftp for placing out file to DB server
FTP to 10.60.17.11
username: oraspt
pw:
connecting to ftp for deleting output file
FTP to 10.60.17.11
username: oraspt
pw:
Deleted successfullyPlease let me know how to trigger pl/sql script.
Thanks in advance for your help.
Regards
Nagendra
Edited by: 838961 on Dec 27, 2011 11:25 PM

Please find output as suggested, I've placed set -x in script.
+ p_userid_passwd=APPS/APPS
+ p_appl_login=1110
+ p_user_name=DC.DKHOO
+ p_request_id=451949
+ v_conc_request_id=451945
+ p_to_role=DC.DKHOO
+ p_from_role=DC.DKHOO
+ p_subject=Receivabless
+ p_body=report
+ p_dist_list=
+ v_request=o451945.out
+ v_file_path_name=/u01/oraspt/REQUEST
+ cd /u01/applspt/inst/apps/SPT_nfs-stg-app1/logs/appl/conc/out
+ echo v_conc_request_id 451945
v_conc_request_id 451945
+ echo p_to_role DC.DKHOO
p_to_role DC.DKHOO
+ echo p_from_role DC.DKHOO
p_from_role DC.DKHOO
+ echo p_subject Receivabless
p_subject Receivabless
+ echo p_body report
p_body report
+ echo p_dist_list
p_dist_list
+ echo v_request o451945.out
v_request o451945.out
+ ls -l o451945.out
-rw-r--r-- 1 applspt dba 2368 Dec 28 15:54 o451945.out
+ '[' 0 -ne 0 ']'
+ echo 'Output request generated'
Output request generated
+ echo 'connecting to ftp for placing out file to DB server'
connecting to ftp for placing out file to DB server
+ echo FTP to 10.60.17.11
FTP to 10.60.17.11
+ echo username: oraspt
username: oraspt
+ echo pw:
pw:
+ ftp -i -n 10.60.17.11
++ sqlplus -s /nolog
+ output=Connected.
+ echo 'connecting to ftp for deleting output file'
connecting to ftp for deleting output file
+ echo FTP to 10.60.17.11
FTP to 10.60.17.11
+ echo username: oraspt
username: oraspt
+ echo pw:
pw:
+ ftp -i -n 10.60.17.11
+ echo 'Deleted successfully'
Deleted successfully

Similar Messages

  • Calling sql script from shell script

    Hi,
    I know this question has been asked many time in various forums, but I tried many combinations and not able to figure out what I'm missing.
    Basically - I'm trying to call a sql script from a shell script.
    This is my sql script (plsql.sql) -
    DELCARE
    v_empno NUMBER := '&empno';
    BEGIN
    select ename,sal from emp where empno = v_empno;
    dbms_output.put_line('Inside the plsql file');
    END;
    This is my unix shell script - I'm caling the plsql.sql file with the parameter passed(97882). I don't get any output. at least I should be able to view the dbms output if not for the sql query inside the sql script.
    #!/usr/bin/ksh
    sqlplus -s sam/olo01 << HERE
    @plsql.sql 97882;
    HERE
    What is it I am missing ?

    Using your scripts (and having to create and populate a table myself, that would have what your select statement implies),
    oracle:oklacity$ cat plsql.sql
    DELCARE
    v_empno NUMBER := '&empno';
    BEGIN
    select ename,sal from emp where empno = v_empno;
    dbms_output.put_line('Inside the plsql file');
    END;
    oracle:oklacity$ cat doit.sh
    #!/usr/bin/ksh
    sqlplus -s sam/olo01 << HERE
    @plsql.sql 97882;
    HERE
    oracle:oklacity$ ./doit.sh
    SP2-0042: unknown command "DELCARE" - rest of line ignored.
    SP2-0734: unknown command beginning "v_empno NU..." - rest of line ignored.
    oracle:oklacity$
    This is the kind of information you should have put in your opening post.

  • Calling sql script from pl/sql block

    Hi
    I want to call a sql script from pl/sql block.
    like
    CREATE OR REPLACE procedure DataBaseExport(user_name in varchar2, pwd in varchar2)
    as
    begin
    execute immediate  '@ C:\Documents and Settings\umesh\emp.sql';
    end DataBaseExport;
    /

    Try something like this -
    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;
    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', '');And, finally,
    create or replace procedure call_sql_file(usr  in varchar2,
                                              pwd  in varchar2,
                                              host_str in varchar2)
    is
    begin
       host('sqlplus -s usr/pwd@host_str C:\UAX_Auto_Count.sql');
    exception
      when others then
        dbms_output.put_line(sqlerrm);
    end;Now, you can pass all the argument in order to execute that file.
    N.B.: Not Tested...
    Regards.
    Satyaki De.

  • How to call SQL script from PL/SQL block

    Hi All,
    I have a pl/sql block from which i need to call a *.sql script file.
    Please tell me that how can i do this?
    Thanks and Regards.

    > Though just for knowledge sake, would you please tell if there is a way
    to call a sql script from a pl/sql block.
    This question stems usually from a confusion about client-server and which is which in Oracle.
    SQL*Plus is a client. PL/SQL is a server side language. SQL is a server side language.
    When entering either one of these two languages in SQL*Plus (or TOAD, SQL-Developer, etc), the content is shipped to an Oracle server process, is parsed there, and is executed there.
    The Oracle server process servicing the client can accept a single SQL statement or PL/SQL block at a time.
    It cannot accept a block of SQL statements delimited with a semicolon. That is a client concept where the client will read each delimited statement and send that, one after the other (in synchronous call mode) to the Oracle server for execution.
    The Oracle server does not have a "script parser". It understands SQL. It understands PL/SQL. And that is what it expects from the client.
    Whether the client supports the SET command, the HOST command, SPOOL command, ability to run scripts, and so... have no bearing on what the server itself is capable of doing. The server does not care what feature set the client has. It is tasked with servicing the client via SQL and PL/SQL.
    It is not tasked to support or emulate client features like running SQL scripts.
    Nor confuse PL/SQL with the very limited command set of SQL*Plus. The two has nothing in common. And just as PL/SQL cannot understand C# or Delphi commands, it cannot understand SQL*Plus commands.

  • Not able to call action method from the javascript

    I am using weblogic 10.3.2 portal.
    My requirement is to call a action in controller throuhg java script when user selects a different option in a dropdown.
    When try it we are not able to call it is returning null as a elementId. Below is the snippet of my code.
    <%@ page language="java" contentType="text/html;charset=UTF-8"%>
    <%@taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
    <%@taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
    <%@taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
    <netui:html generateIdScope="true">
    <head>
    <netui:base/>
    </head>
    <script language="JavaScript" type="text/JavaScript">
    function SelectBANSubmit(id)
         var scope = document.getElementById("scopeOneSpan");
         alert("value====arv" + scope);
         //var form = document.getElementById(lookupIdByTagId(form,scope));
         //alert("value====arv" + form);
         var knoVal = document.getElementById(lookupIdByTagId(id,scope));
    alert("in method" + knoVal);
         </script>
    <netui:body>
    <span id="scopeOneSpan">
         <netui:form action="getBillDetails" >
         <netui:select dataSource="actionForm.selection" tagId="arvind" optionsDataSource="${actionForm.resDTO.kno}" onChange="SelectBANSubmit('arvind')"/>
              </netui:form>
         </span>
         </netui:body>
    </netui:html>
    Any help would be appreciated.

    Below is my code
    JS Code
    function fundemo(id)
    alert("so currently we are in fundemo function ");
         var scope = document.getElementById("scopeOneSpan");
    alert(scope);
         var check = document.getElementById(lookupIdByTagId('textbox1',scope));
    alert("check id is " + check.id + " and its value is "+ check.value);
    JSP Code
    <%@ page language="java" contentType="text/html;charset=UTF-8"%>
    <%@taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
    <%@taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
    <%@taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
    <netui:html generateIdScope="true">
    <head>
    <netui:base/>
    </head>
    <script type="text/JavaScript" src="D:/testWS/testWebProject/WebContent/WEB-INF/js/test.js"> </script>
    <script language="JavaScript" type="text/JavaScript">
    function SelectBANSubmit(id)
    alert("In JS Method of the JSP File ");
    fundemo(id);
    </script>
    <netui:body>
    <span id="scopeOneSpan">
    <netui:form action="getBillDetails">
    <td >
    <netui:textBox dataSource="actionForm.selection" tagId="textbox1" />
    </td>
    <td>
    <netui:button type="button" onClick="javascript:fundemo('textbox1')" value="Test click"/>
    </td>
    </netui:form>
    </span>
    </netui:body>
    </netui:html>

  • Calling sql script from anonymous block

    Hi
    how to call an script from an anonymous block, like
    declare
    v_reccord_account number :=0;
    begin
    SELECT xx.cc INTO v_reccord_account FROM
    (select count(1) cc
    from accounts
    group by account_id
    having count(account_id) > 1
    )xx
    where ROWNUM=1;
    if v_reccord_account <1
    then
    dbms_output.put_line('no duplicates');
    ELSE
    < here i have to call this script -- @e:/test44.SQL >
    end if;
    end;

    Hi
    thanks for replying, i'm having some sql statements, i have to spool the results of those statements .. below is the content of the file i'm calling.
    =================================================
    whenever sqlerror exit sql.sqlcode
    set serveroutput on
    column fn new_value filename
    select 'remove_duplicates_'||to_char(sysdate, 'yyyymmddhh24miss')||'.log' as fn from dual;
    spool E:/&filename
    prompt 'Checking for duplicates'
    --select account_id, count(1)
    --from accounts
    --group by account_id
    --having count(1) > 1;
    prompt 'Records to be deleted'
    select *
    from accounts
    where decode ( substr(account_id,1,3),'COG',1,0)=1
    group by account_id
    having count(1) > 1;
    prompt ' Deleting duplicates'
    delete
    from accounts
    where account_id in (
    select account_id
    from accounts
    where decode ( substr(account_id,1,3),'COG',1,0)=1
    group by account_id
    having count(1) > 1
    commit;
    ==========================================

  • Calling SQL scripts from subdirectories using SQL*Plus 9.2.0.1

    Is it possible to run an SQL script that in turn calls other SQL scripts from subdirectories? This seemed to work fine using SQL*Plus 8.1.7
    Did it break in 9.2.0.1?
    Any fixes available?

    Ryan,
    What exactly is your problem? Can you tell me any errors you are seeing? Platform?
    Alison

  • Calling javaFX script from Java program

    I am trying to call JavaFX script from a simple Java program. code as follows:
    import java.io.*;
    import javax.script.ScriptEngine;
    import javax.script.ScriptEngineManager;
    public class My{
    public static void main(String[] args) {
    ScriptEngineManager manager = new ScriptEngineManager();
    ScriptEngine engine = manager.getEngineByExtension("fx");
    try {  
    InputStreamReader reader = new InputStreamReader(My.class.getResourceAsStream("first.fx"));
    engine.eval(reader);
    reader.close();
    } catch (Exception e) {
    e.printStackTrace();
    my first.fx file code is here:
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import javafx.scene.text.Font;
    import javafx.scene.text.TextAlignment;
    Stage {
    title: "My First JavaFX Sphere"
    scene: Scene {
    width: 250
    height: 250
    content: [
    Text {
    font: Font { size: 24 }
    x: 20, y: 90
    textAlignment: TextAlignment.CENTER
    content:"Welcome to \nJavaFX World"
    } //Text
    ] // content
    } // Scene
    } // Stage
    I am not able to run My.java. runtime error as follows:
    java.lang.NullpointerException
    Kindly correct me, where I am wrong

    I am able to call .fx file from Java. Thank you all for helping me to resolve this problem
    Regards,
    Ritu

  • Calling GUI Scripting from ABAP program

    Is it possible to call GUI Scripting from ABAP and thus to use GUI Scripting as an alternative to CALL TRANSACTION?
    Is the class CL_JAVA_SCRIPT suitable to access GUI Scripting engine? Accessing ABAP data object would work as well in this case as i think. What SAP Logon and WAS releases are required? Is the 6.20 release sufficient for this case?
    I would appreciate if somebody could post an example.

    Hi,
    CL_JAVA_SCRIPT has nothing to do with SAPGUI Scripting.
    Calling SAPGUI Scripting API from ABAP could be possible for programmes experienced with OLE automation calls from ABAP coding.
    The hardest thing will be, to access the scripting engine handle as an entry point. Once you have a handle in your abap session, any api function can be invoked.
    Best regards
    Jens
    BTW: SAP testtool eCATT does call SAPGUI-Scripting from ABAP.

  • Not able to read sql script file in ADF mobile

    hi,
    i am trying to create some DB tables in SQLLite DB (similar to the HR sample app where it creates bunch of DB objects using hr.sql file in .adf/META-INF)..
    but i am getting following error at runtime. i placed the file in .adf/META-INF directory in my application.
    "sqllite returned: error code=14, msg = cannot open file at source...."
    what am i missing here?
    please help.
    regards,
    ad

    This how I have done it.
    This is the start method from my Listener:
      public void start()
          String databaseName = "mydatabase";
          File dbFile = new File(AdfmfJavaUtilities.getDirectoryPathRoot(AdfmfJavaUtilities.ApplicationDirectory)+"/"+databaseName+".db");
          if(!dbFile.exists())
                try {
                    this.initializeDatabase(databaseName);
                } catch (Exception e) {
                    System.out.println(e.getMessage());
      }And this is a custom method also in the listener class
      private static void initializeDatabase(String databaseName) throws Exception
          List stmts = null;
          try {
              ClassLoader cl = Thread.currentThread().getContextClassLoader();
              InputStream is = cl.getResourceAsStream(".adf/META-INF/"+databaseName+".sql");
              if (is == null) {
                  // .sql script not found
              BufferedReader bReader = new BufferedReader(new InputStreamReader(is));
              stmts = new ArrayList();
              String strstmt = "";
              String ln = bReader.readLine();
              while (ln != null) {
                  if (ln.startsWith("REM") || ln.startsWith("COMMIT")) {
                      ln = bReader.readLine();
                      continue;
                  strstmt = strstmt + ln;
                  if (strstmt.endsWith(";")) {
                      System.out.println(strstmt);
                      stmts.add(strstmt);
                      strstmt = "";
                      ln = bReader.readLine();
                      continue;
                  ln = bReader.readLine();
              String Dir = AdfmfJavaUtilities.getDirectoryPathRoot(AdfmfJavaUtilities.ApplicationDirectory);
              String connStr = "jdbc:sqlite:" + Dir + "/"+databaseName+".db";
              Connection conn = null;
              conn = new SQLite.JDBCDataSource(connStr).getConnection();
              conn.setAutoCommit(false);
              for (int i = 0; i < stmts.size(); i++)
                  Statement pStmt = conn.createStatement();
                  pStmt.executeUpdate((String)stmts.get(i));
              conn.commit();
              conn.close();
          } catch (Exception ex)
              ex.printStackTrace();
          }My .sql scrip named "mydatabase.sql" located in the ADF META-INF folder.
    See this picture :
    http://upload.wiim.be/img/Screenshot%20at%20jan.%2019%2011-39-30.pngDon't forget the register your Listener class to the adfmf-application.xml file!
    http://upload.wiim.be/img/Screenshot%20at%20jan.%2019%2011-42-24.png

  • Calling SQL LOADER From Java Program

    Hi
    I need to invoke sql loader from inside a Java Class.
    Any Pointers in this regards will be really appreciated.
    Thanks
    Vishal

    You can create two different files which has sqlldr command defined....
    1. loader.sh
    2. loader.bat
    and in the depending on the OS execute one...
             String command = "";
             if(System.getProperty("os.name").equals("Windows 2000")){
                    //if os is windows 2000  then execute bat file
                     command =  <<bat file path>>
              }else{
                      command = <<shell path>>
              Runtime rt = Runtime.getRuntime();
              Process p = rt.exec(command);
              int i = p.exitValue();
             

  • Not able to connect mysql server from java program

    Hi
    I have mysql server running in one machine and I am accessing from another machine using java program. I have added an user from the server and given all the permission. But its not working. But when I hav java program locally its working.
    The following is my program
    private Connection getConnection(){
    Connection con=null;
    try{
    Class.forName("com.mysql.jdbc.Driver");
    String url="jdbc:mysql://10.5.18.135:3306/test";
    con = DriverManager.getConnection(url,"new","");
    System.out.println("Connected");
    }catch(Exception e){
    System.out.println("Not Connected"+e);
    e.printStackTrace();
    return con;
    its throwing me the follwoing exceptioon
    Not Connectedjava.sql.SQLException: Unable to connect to any hosts due to exce
    ion: java.net.ConnectException: Connection timed out: connect
    java.sql.SQLException: Unable to connect to any hosts due to exception: java.n
    .ConnectException: Connection timed out: connect
    at com.mysql.jdbc.Connection.createNewIO(Connection.java:1690)
    Thanks in advance
    Sathish

    Try this way I think you will need the user and password.
    Connection con=null;
    try{
      Class.forName("com.mysql.jdbc.Driver");
      // assuming database test
      // assuming user is root
      // assuming user password is me
      String connectionString="jdbc:mysql://10.5.18.135:3306/test?user=root&password=me"
      con = DriverManager.getConnection(connectionString);
    [code/]
    rykk                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Calling SQL statements from Shell scripts

    Hi,
    I want to call external package procedures, declare some variables & do some oracle validations in the shell script.
    How SQL environment is set in shell script & is this one time process or I have to write few statements before every SQL statement.
    Please explain with an example.
    Thanks..

    is this one time process Yes. Example :
    $ cat script.sh
    export ORACLE_HOME=/home/oracle/base/OraHome10
    export ORACLE_SID=db102
    export PATH=$ORACLE_HOME/bin:$PATH
    sqlplus -s / as sysdba << EOF
    select to_char(sysdate,'dd/mm/yyyy hh24:mi:ss') date_time
    from dual;
    exit
    EOF
    sqlplus -s / as sysdba << EOF
    col global_name for a60
    select * from global_name;
    exit
    EOF
    $ ./script.sh
    DATE_TIME
    27/02/2008 11:11:27
    GLOBAL_NAME
    DB102
    $

  • Error while calling sql loader from shell script.

    In the table DBMS_SCHEDULER_JOB_RUN_DETAILS im getting the error as ""SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon denied""....do we need previliges for creating session of the db user????.....or wht other settings we require to do.....if the username and password used is right.

    user1122577 wrote:
    SQL*Loader-128: unable to begin a session ORA-01017: invalid username/password; logon deniedI don't know, but somehow the error you recived looks like ORA-01017 : )
    [oracle@dell ~]$ sqlplus ring/ring
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Jul 22 11:50:58 2010
    Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Data Mining and Real Application Testing options
    SQL> exit
    Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
    With the Partitioning, Data Mining and Real Application Testing options
    [oracle@dell ~]$
    [oracle@dell ~]$
    [oracle@dell ~]$ sqlldr ring/ring
    control = i don't have it
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Jul 22 11:51:08 2010
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    SQL*Loader-500: Unable to open file (i don't have it.ctl)
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: No such file or directory
    [oracle@dell ~]$
    [oracle@dell ~]$
    [oracle@dell ~]$ sqlldr ring/wrongpassword
    control = i don't have it again
    SQL*Loader: Release 10.2.0.4.0 - Production on Thu Jul 22 11:51:38 2010
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    SQL*Loader-128: unable to begin a session
    ORA-01017: invalid username/password; logon denied
    [oracle@dell ~]$

  • Encrypt or hide password in sql script from shell

    Hello
    Have I some possibility to encrypt or hide password in this shell script :
    $ORACLE_HOME/bin/sqlplus -S /nolog<<EOF
    connect user/passw3@tns
    select * from dual;
    exit;
    EOF
    thank You
    Brano

    Or do not use login userid/pw at all. Instead use client authentication (externally identified account).
    CREATE USER ops$me identified externally;
    then as me on the host,
    $ORACLE_HOME/bin/sqlplus / >> /dev/null <<EOF1
    select * from dual;
    exit;
    EOF1
    That way your password never has to be stored or passed. Oracle knows that you have been authenticated by the server.

Maybe you are looking for