If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Need help in shelll script

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-13-04, 06:37
arunprasadlv arunprasadlv is offline
Registered User
 
Join Date: Mar 2004
Location: India
Posts: 41
Need help in shelll script

Hi EverB,
I am writing a shell script which logs into database and do some processing.The userid and passwd to log into the database is given as a parameter.

The problem is when u ececute ps -ef|grep -i scriptname,
it reveals the username and pwd which i want to avoid.
How can i achieve this.

Thanks in Advance ,
Arun
Reply With Quote
  #2 (permalink)  
Old 12-13-04, 11:32
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 325
__________________
vlad
+-----------------------+
| #include <disclaimer.h> |
+-----------------------+
Reply With Quote
  #3 (permalink)  
Old 12-16-04, 20:55
jim_1650 jim_1650 is offline
Registered User
 
Join Date: Sep 2004
Posts: 1
A very easy way to do that is declaring the username and the password as an environment variable.

Let me know if you need more help,
Thanks.

JIM.
Reply With Quote
  #4 (permalink)  
Old 12-16-04, 22:18
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 325
yeeah, could be a bit more specific and post a sample code, pls.
__________________
vlad
+-----------------------+
| #include <disclaimer.h> |
+-----------------------+
Reply With Quote
  #5 (permalink)  
Old 12-27-04, 14:47
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Cool

Other ways to 'hide' the userid/password are:
1) execute sqlplus with /nolog option:
Code:
sqlplus /nolog <<!EOF
connect <uid>/<pw>
@MyScript
exit
!EOF
2) Invoke sqlplus with the userid only and supply the password on first line:
Code:
sqlplus <userid> <<!EOF
<pw>
@MyScript
exit
!EOF
3) Create an 'externally identified user:
Code:
CREATE USER OPS$THEOPR IDENTIFIED EXTERNALLY ...etc
and when you logon to the server with user THEOPR, just execute sqlplus like this:
Code:
sqlplus / ...
Note: THEOPR must be a unix user-id and the 'OPS$' is the value of the 'os_authent_prefix' init.ora parameter.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On