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
Printable View
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
what do you want to achieve..? you want to redirect the output of some scipt to a file?
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.
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:
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.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`
You can also do this:
Code:sqlplus -s /nolog << EOF
connect user/pass
...
EOF
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.
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.
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.
This is on an Oracle 11.2.0.2 DB, Not the your being prompted for a password
sqlplus -s c0harpa
Enter password:
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.