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
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:
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;
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.
The suggested code
"sqlplus -s /nolog << EOF
will not do.
To make the case more clear :
1. I have a script
select sysdate from dual
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
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.
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.
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.