DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: How to connect as sysdba remotely

  1. #1
    Join Date
    Dec 2001
    Location
    USA
    Posts
    620

    How to connect as sysdba remotely

    Hi all,

    I need to connect as sys to a database XYZ on server-A from server-B. On Server-B, I have TNS entry for XYZ.

    I am trying following command on server-B but it is not working.

    sqlplus "/ as sysdba"@XYZ

    Please note I do not want to use sys password here.

    Please help.

    Thanks in Advance,

    Sam
    Last edited by samdba; 12-04-2010 at 01:06 PM.
    Sam
    ------------------------
    To handle yourself, use your head. To handle others, use your heart

  2. #2
    Join Date
    May 2002
    Posts
    2,645
    It is the connection as sysdba, not sysdba at SID.
    Conn un/pwd@sid as sysdba, not conn un/pwd as sysdba @sid.
    You will have to use the password since you are not on the server. You won't get the benefit of OS authentication.
    If you are on the server, you can do things like conn fake_un/fake_pwd as sysdba and still connect. If over the network, you have to use real username and password.
    Can you use/try conn username@sid as sysdba and get a prompt for the password?

  3. #3
    Join Date
    Dec 2001
    Location
    USA
    Posts
    620
    Thanks for your reply.

    Yes, I can do sqlplus sys@XYZ as sysdba and then it prompts for password and let me connect after I give the password.

    I want to connect as sys from the unix shell script and therefore, I cannot have it prompt for password.

    Is there any other alternate?

    Thanks,

    Sam
    Sam
    ------------------------
    To handle yourself, use your head. To handle others, use your heart

  4. #4
    Join Date
    May 2002
    Posts
    2,645
    file name = secret_data.txt
    #contents of the file:
    sys_pass=whatever

    Your script:

    #! /bin/ksh (or whatever shell)

    #source the password file
    . ./path_to/secret_data.txt
    sqlplus -s username/$sys_pass@wherever as sysdba << END
    ...
    END

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