sqlplus/multiple DB's
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 5 of 5

Thread: sqlplus/multiple DB's

  1. #1
    Join Date
    Sep 2001
    Posts
    163
    I have created two database on a Win2000 machine. Oracle_sid = DB1 or DB2.

    How can I access the different databases from Sqlplus on my machine without having to go into the environment variables on the database machine and change the Oracle_SID to the target database? The TNSnames.ora file on my machine list both databases on the target machine. The target machine has two entries for the listener.ora. One for each database.

    Any help would be appreciated.


  2. #2
    Join Date
    Jan 2001
    Posts
    3,131
    simple let's say you are connected already then,

    SQL> connect your_id@instance

    Ex..
    SQL> connect scott@DB2

    You can also spcify your password on one line but this is a bad practice in my opinion.

    SQL> connect scott/tiger@DB2

    MH
    I remember when this place was cool.

  3. #3
    Join Date
    Sep 2001
    Posts
    163
    I try that and I get the following error message:
    ORA-24327: need explicit attach before authenticating a user

    I've tried signing on using the connect scott/tiger@db2, connect scott/tiger@machine name. Nothing seems to work. Something has to be set up incorrectly, but I can't figure out what.

  4. #4
    Join Date
    Jan 2001
    Posts
    3,131
    The only other thing I can think of is that when I use "connect"
    here at work I have to specify the entire HOST name as it is listed in the tnsnames.ora file.

    Ex..

    SQL> connect steve@D123.oracledb.mycompany.com

    Check the tnsnames file and look at the host listing, also make sure you updated the correct tns file, there are usually a few.

    MH
    I remember when this place was cool.

  5. #5
    Join Date
    Sep 2001
    Posts
    163
    I figured it out. The listeners were crossed (for lack of a better explanation). When the second database was created, a second listener was also created (listener2). Somehow the first listener (listener) was also listening for the second database, but not on the correct port. I stopped both listeners and then restarted then individually and now the first listener listens for the first DB and the second listener listens for the second DB. And my connections work.

    Thanks for you assistance.

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