Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2004
    Location
    India
    Posts
    41

    Unanswered: 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

  2. #2
    Join Date
    Apr 2004
    Location
    Boston, MA
    Posts
    325
    vlad
    +-----------------------+
    | #include <disclaimer.h> |
    +-----------------------+

  3. #3
    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.

  4. #4
    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> |
    +-----------------------+

  5. #5
    Join Date
    Jun 2003
    Location
    West Palm Beach, FL
    Posts
    2,713

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •