DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: sqlplus -s

  1. #1
    Join Date
    Oct 2011
    Posts
    6

    sqlplus -s

    In solaris using oracle 920 sqlplus -s uname does not prompt for password.
    However if password is entered without asking , it gives the output.
    Can I set to prompt for askinhg password using sqlplus -s uname @script

  2. #2
    Join Date
    Oct 2008
    Posts
    20
    what do you want to achieve..? you want to redirect the output of some scipt to a file?

  3. #3
    Join Date
    Oct 2011
    Posts
    6

    sqlplus -s in oracle 920

    on running the
    sqlplus -s uname @script
    should prompt for passwd as the option was in earlier version of oracle.

    Now it doesn't prompt for 'Enter passwrod : ....' but wailts silently for the same.

  4. #4
    Join Date
    Oct 2011
    Posts
    6

    sqlplus -s in oracle 920

    It is desired that
    sqlplus -s uname @script
    should prompt like 'Enter passwd : ..'
    Currently it waits silently for passwd without any promt.
    In earlier verssion it was prompting ..

  5. #5
    Join Date
    Nov 2000
    Location
    Pittsburgh, PA
    Posts
    4,166
    Quote Originally Posted by pkjha View Post
    It is desired that
    sqlplus -s uname @script
    should prompt like 'Enter passwd : ..'
    Currently it waits silently for passwd without any promt.
    In earlier verssion it was prompting ..
    if you do "sqlplus -s '/as sysdba'" it should start up a sqlplus connection and not prompt for anything or send any extraneous output to the screen. this can be useful in the following case using bash:

    Code:
    export MYVAL=`sqlplus -s '/as sysdba' << EOF
    set term off
    set echo off
    set feedback off
    set heading off
    set term on
    select status from v\$instance;
    EOF`
    This will put the status of the database into an environment variable in bash. However, 8.1.7 had a bug where it would let you know that you were connected even though you asked it to not do that.

    You can also do this:

    Code:
    sqlplus -s /nolog << EOF
    connect user/pass
    ...
    EOF

  6. #6
    Join Date
    Oct 2011
    Posts
    6

    sqlplus -s

    The suggested code
    "sqlplus -s /nolog << EOF
    connect user/pass
    ...
    EOF"
    will not do.

    To make the case more clear :
    1. I have a script
    x1.sql as

    select sysdate from dual
    /
    exit
    2, I have a oracle user say u1 with passwd p1
    3. I want to execute
    sqlplus -s u1 @x1
    4. I want it to prompt
    Enter passwd :
    5. It waits for passwd to be entered ..
    If passord as "p1" is entered it returns the output as follows

    $sqlplus -s p1 @x1
    -- passwd q1 was entered without prompting which is not echoed

    SYSDATE
    -----------
    15-OCT-2011
    6. It is desired to get a prompt for entering passwd so that
    some step can ne executed by operator for batch jobs.
    7. I don't want to hard code the password in the script as
    sqlplus -s u1/p1 @x1 which works any way. But everytime password is changed, script needs to be modified.

  7. #7
    Join Date
    Jul 2006
    Posts
    195
    The -s option means run in silent mode, it does not mean supress password.


    This is from the sqlplus documention.

    http://download.oracle.com/docs/cd/B...b12170/ch6.htm


    Running a Script as You Start SQL*Plus
    To run a script as you start SQL*Plus, use one of the following options:

    •Follow the SQLPLUS command with your username, a slash, your password, a space, @, and the name of the file:

    SQLPLUS HR/your_password @SALES
    SQL*Plus starts and runs the script.

    •Include your username, a slash (/), and your password as the first line of the file. Follow the SQLPLUS command with @ and the filename. SQL*Plus starts and runs the file. Please consider the security risks of exposing your password in the file before using this technique.

    If you omit the slash (/) and password, SQL*Plus prompts for it.

  8. #8
    Join Date
    Oct 2011
    Posts
    6

    salplus -s

    I have very well spelled out that I don't want to put my passwd in the command line due functional/operational constraint.
    Pl give solution how do I get passwd prompt as I was getting in older version of sql*plus/oracle.

  9. #9
    Join Date
    Jul 2006
    Posts
    195
    This is on an Oracle 11.2.0.2 DB, Not the your being prompted for a password

    sqlplus -s c0harpa
    Enter password:

  10. #10
    Join Date
    Oct 2011
    Posts
    6
    Dear BeefStu,

    This is what I need but is not happening in our case using oracle 920 under solaris 5.9.
    However the same was happening while using oracle_home 716 and 815.

    Thanks for ur quick response. I am still looking for the solution.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width