Home > Ask the Oracle Experts > Questions & Answers
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Running SQL*Plus scripts without supplying password

Brian Peasland EXPERT RESPONSE FROM: Brian Peasland

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site
>
QUESTION POSED ON: 11 September 2002
What's the best way to implement running SQL*Plus scripts without a password being supplied? Example:
 
 SQL*Plus userid/pw @script

>
EXPERT RESPONSE

I'm assuming you ask this question since you do not want the password to appear when you do "ps -ef|grep sqlplus" on a Unix system. This is a security hole if one can see your password when doing a process status listing. You have a couple of ways of getting around this.

One way is to use a connection "script". Create a script called "connect.sql". This script will only have one line:

connect userid/password
Now have all your scripts call this script as the first line in that script. To stop SQL*Plus from prompting you for the password, start it with the "/nolog" option as follows:
sqlplus /nolog @my_script
Another way is to redirect the password as input to the executable as follows:
sqlplus username @my_script << password_file
The file "password_file" contains just one word, the password for this user. When SQL*Plus would normally prompt you for the password, the contents of this file would be used.

In either method, your password can be seen if you don't take methods to secure any files which hold the password. So make sure that only the Oracle user and/or DBA group can access this file by protecting it with OS file permissions.

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice

HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides enterprise IT professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective IT purchase decisions and managing their organizations' IT projects - with its network of technology-specific Web sites, events and magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Reprints  |  Site Map




All Rights Reserved, Copyright 2003 - 2008, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts