Auto Authentication
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: Auto Authentication

  1. #1
    Join Date
    May 2001
    Posts
    28

    Question

    I have a Unix account named TEST but would like to find out how I can set it up so when it runs PL SQL procedures from the Unix prompt (SQLPLUS /@DBNAME @SQL_FILE) it connects to Oracle as a different Oracle account such as QUERY account. Please advice?


  2. #2
    Join Date
    Feb 2000
    Location
    Washington DC
    Posts
    1,843
    In the SQL_FILE use connect QUERY as the first statment.

    REM sql_file.sql
    connect query/pwd@db_name
    ----
    ----
    ----
    rest of the script....
    Reddy,Sam

  3. #3
    Join Date
    May 2001
    Posts
    28
    I would prefer using Auto Authentication without having to specify the logon account and password. We have many scripts that we would have to modify and we definetely do not want to hard-code the account/password.

    Thanks for your reply.

  4. #4
    Join Date
    Aug 2000
    Posts
    5

    alternate way

    create one sql file as sreddy mentioned and call it in your scripts if you do not want to hard code in every script.

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    What you are looking for is called OS Authentication. OS Authentication assumes that since you have logged into the OS that you will use the same username to login to the database.

    First, create a user with an OPS$ prefix that corresponds to your username. For example, my unix username is jeffh and my oracle username is OPS$JEFFH:
    create user ops$jeffh identified externally
    temporary tablespace temp
    default tablespace users;
    grant connect, resource to ops$jeffh;

    Then, you have to futz with some init.ora parameters. The three relevent lines are below. (Note: os_authent_prefix is commented out)
    #os_authent_prefix=""
    remote_login_passwordfile=exclusive
    remote_os_authent=true

    Then, bounce you instance and you can login using:
    sqlplus /@yourdbname.domain
    Jeff Hunter
    marist89@yahoo.com
    http://marist89.blogspot.com/
    Get Firefox!
    "I pledge to stop eating sharks fin soup and will not do so under any circumstances."

Posting Permissions

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



Click Here to Expand Forum to Full Width