Home » Infrastructure » Unix » How to call sqlplus from shell script by hide password
How to call sqlplus from shell script by hide password [message #148925] Tue, 29 November 2005 01:55 Go to next message
Supaporn
Messages: 4
Registered: May 2004
Junior Member
Please advice how to call sqlplus by hiding password. Currently, I create Unix shell script (ksh) by call :
sqlplus userid/password@ORACLE_SID program_name1
sqlplus userid/password@ORACLE_SID program_name2
...
So, I can run the all program by submit the script but password are hard code in program and show to everyone whom can see this shell script.

How to call the sqlplus by hiding the password.

Thank you for your advice.
Re: How to call sqlplus from shell script by hide password [message #148951 is a reply to message #148925] Tue, 29 November 2005 03:45 Go to previous messageGo to next message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member


Pass username and password as command line arguments rather than hardcoding them.

for eg :

 #script demo.sh
 sqlplus $1/$2@ORACLE_SID program_name1
 sqlplus $1/$2@ORACLE_SID program_name2
 .
 .
 


and now when you want to call this script from shell prompt

 $ demo.sh your_username your_password 


Hope it will help you.
To know more about command line arguments refer any UNIX manual.

regards,
tarun
Re: How to call sqlplus from shell script by hide password [message #148976 is a reply to message #148925] Tue, 29 November 2005 06:11 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
http://www.orafaq.com/faq/can_one_prevent_passwords_from_appearing_in_the_system_process_table
Previous Topic: Korn Shell- Trim spaces
Next Topic: need help in shell script
Goto Forum:
  


Current Time: Mon Nov 25 10:39:12 CST 2024