Home » SQL & PL/SQL » Client Tools » connection using sqlplus
connection using sqlplus [message #250117] Sun, 08 July 2007 02:26 Go to next message
cgk_js
Messages: 48
Registered: December 2005
Member
i can able to connect using the connection descriptor

how can i connect without that...

eg sqlplus user_adm/user_pwd@prod

need to connect as sqlplus user_adm/user_pwd

Re: connection using sqlplus [message #250118 is a reply to message #250117] Sun, 08 July 2007 02:40 Go to previous messageGo to next message
Michel Cadot
Messages: 64108
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can't if the database is not local.
Otherwise just set your ORACLE_SID environment variable.

Regards
Michel
Re: connection using sqlplus [message #250120 is a reply to message #250118] Sun, 08 July 2007 02:52 Go to previous messageGo to next message
cgk_js
Messages: 48
Registered: December 2005
Member
actually i can able to connect in production machine,

i cannot do the same in the testing machine.

i had added the ORACLE_SID in the .profile, still i cannot connect and when i run unix jobs,for connection oracle using
pro*c EXEC SQL CONNECT :userid identify by :passwd;
i am getting this error|12154

>>>>> oerr ora 12154

12154, 00000, "TNS:could not resolve the connect identifier specified"
// *Cause: A connection to a database or other service was requested using
// a connect identifier, and the connect identifier specified could not
// be resolved into a connect descriptor using one of the naming methods
// configured. For example, if the type of connect identifier used was a
// net service name then the net service name could not be found in a
// naming method repository, or the repository could not be
// located or reached.
// *Action:
// - If you are using local naming (TNSNAMES.ORA file):
// - Make sure that "TNSNAMES" is listed as one of the values of the
// NAMES.DIRECTORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA)
// - Verify that a TNSNAMES.ORA file exists and is in the proper
// directory and is accessible.
// - Check that the net service name used as the connect identifier
// exists in the TNSNAMES.ORA file.
// - Make sure there are no syntax errors anywhere in the TNSNAMES.ORA
// file. Look for unmatched parentheses or stray characters. Errors
// in a TNSNAMES.ORA file may make it unusable.
// - If you are using directory naming:
// - Verify that "LDAP" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Verify that the LDAP directory server is up and that it is
// accessible.
// - Verify that the net service name or database name used as the
// connect identifier is configured in the directory.
// - Verify that the default context being used is correct by
// specifying a fully qualified net service name or a full LDAP DN
// as the connect identifier
// - If you are using easy connect naming:
// - Verify that "EZCONNECT" is listed as one of the values of the
// NAMES.DIRETORY_PATH parameter in the Oracle Net profile
// (SQLNET.ORA).
// - Make sure the host, port and service name specified
// are correct.
// - Try enclosing the connect identifier in quote marks.
//
// See the Oracle Net Services Administrators Guide or the Oracle
// operating system specific guide for more information on naming.



Re: connection using sqlplus [message #250129 is a reply to message #250117] Sun, 08 July 2007 09:45 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
>You can't if the database is not local.
At least on *nix you can by using TWO_TASK.
TWO_TASK=remote_alias
export TWO_TASK
sqlplus username/password
-- connects to the DB referenced by "remote_alias" in tnsnames.ora file
Re: connection using sqlplus [message #250512 is a reply to message #250118] Tue, 10 July 2007 05:51 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Michel Cadot wrote on Sun, 08 July 2007 03:40
You can't if the database is not local.
Otherwise just set your ORACLE_SID environment variable.


You can connect to a remote DB without using '@' on Windows by setting:

C:\set local=<tns_alias_of_remote_db>
Re: connection using sqlplus [message #250521 is a reply to message #250512] Tue, 10 July 2007 06:06 Go to previous messageGo to next message
Michel Cadot
Messages: 64108
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Right! thanks for the correction.

Regards
Michel
Re: connection using sqlplus [message #250555 is a reply to message #250521] Tue, 10 July 2007 07:38 Go to previous messageGo to next message
cgk_js
Messages: 48
Registered: December 2005
Member
Hi anacedent,

i have tried by using TWO_TASK in the .profile file and i can able to connect to oracle by sqlplus user_name/password with the connection description.

Thanks for the valuable advice.

Gopal

Re: connection using sqlplus [message #256558 is a reply to message #250555] Mon, 06 August 2007 00:25 Go to previous messageGo to next message
surenhr
Messages: 45
Registered: August 2007
Location: gurgoan
Member
C:\set local=<tns_alias_of_remote_db>

what do you mean by tns_alias sir.?
Thanks and Regards
Re: connection using sqlplus [message #256562 is a reply to message #250117] Mon, 06 August 2007 00:40 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
surenhr,
if you have a problem, start your own thread/post.
Re: connection using sqlplus [message #256565 is a reply to message #256562] Mon, 06 August 2007 00:44 Go to previous messageGo to next message
surenhr
Messages: 45
Registered: August 2007
Location: gurgoan
Member
Ok ..thanks
Re: connection using sqlplus [message #256746 is a reply to message #250117] Mon, 06 August 2007 08:50 Go to previous message
alkhirbash
Messages: 1
Registered: August 2007
Junior Member
you can connect by :-
1- go to tnsnames.ora file open it and write this in the end of
file:

service_name =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = servername)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
save and close the file
you can change (service_name) by any name you want
host = (servername) write the name of your server instead of servername

service_name= (orcl) change it by your oralce_sid in server

the go to registery form run
in form home : for example if it (home1) in right side create new string and change it name to local after that click double click on local it will show small box write in your (servicename) that you did in the tnsnames.ora file.
Previous Topic: doubt in sql*plus
Next Topic: Can I show milliseconds in TOAD ?
Goto Forum:
  


Current Time: Mon Dec 05 05:02:20 CST 2016

Total time taken to generate the page: 0.09719 seconds