[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Can i connect os authentication user with out connection string in oracle

Posted on 2012-08-17
5
Medium Priority
?
539 Views
Last Modified: 2012-08-17
Hi Experts,

I am having one  database user with authentication_type externally.

Assume that database is on server2 and i connected to server1 and from there i would like to connect to database2.

Hope i can connect with the below command..

sqlplus / @connection string

But still can i connect with below statement?

set oracle_sid=db_name
sqlplus /

In the above case assume that db_name is same as connect string in the tnsnames.ora file in the server1.

Please let me know if i my question is not clear.

Thanks,
Rama.
0
Comment
Question by:chanikya
  • 3
  • 2
5 Comments
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38304630
If the user on the second server is allowed to connect and everything else is set up properly it should work.

Just remove the space after the '/':
sqlplus /@tnsnames_alias
0
 

Author Comment

by:chanikya
ID: 38304664
Hi Expert,

I would like to know  if the second one will work.

set oracle_sid=db_name
sqlplus /

Assume the tnsnames_alias and db_name(ORACLE_SID)  are same. db server is different from the server i am trying to connect.

Thanks,
Chanikya.
0
 
LVL 78

Accepted Solution

by:
slightwv (䄆 Netminder) earned 2000 total points
ID: 38304730
>>I would like to know  if the second one will work.

No.  That is only for local connections.

You can set a 'default' remote database by setting an enviornment variable:
Windows:  set LOCAL=tns_names_alias
Unix: export TWO_TASK=tns_names_alias

Then sqlplus / 'should' work.  It's been many years since I messed with LOCAL and TWO_TASK so I'm going from memory.
0
 

Author Comment

by:chanikya
ID: 38304956
Hi slightww,

You are excellent.. I got the answer..

Thanks,
Chanikya.
0
 
LVL 78

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38305043
Glad to help.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video shows how to recover a database from a user managed backup
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question