Home » SQL & PL/SQL » SQL & PL/SQL » Can i edit/add to tnsnames.ora file with SQLPLUS? (tnsnames.ora)
Can i edit/add to tnsnames.ora file with SQLPLUS? [message #300851] Mon, 18 February 2008 04:53 Go to next message
sammeras
Messages: 28
Registered: September 2007
Location: Israel
Junior Member

Hello,
I have 2 databases (A,B). I Created DBLINK from A to B (I opened the tnsnames.ora file and added:
orcl=
(DESCRIPTION =
	(ADDRESS_LIST =
		(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.16.220)(PORT = 1521))
	)
	(CONNECT_DATA =
		(SERVER = DEDICATED)
		(SID = orcl)
	)
)


DBLINK work well Smile

Can i edit tnsnames.ora from sqlplus (like i edit SPFILE)?
"alter system set control_files=’+DATA’,'+RECOVERY’ scope=spfile"



Thanks guys
Re: Can i edit/add to tnsnames.ora file with SQLPLUS? [message #300856 is a reply to message #300851] Mon, 18 February 2008 05:46 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Not unless you are creating some PL/SQL procedure to edit the file. However, if it serves your purpose, you can simply include the tns entry itself when you create the DB link.

create database link TESTDB using '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=
(PROTOCOL=TCP)(HOST=192.168.16.220)(PORT= 1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=orcl)))'
Re: Can i edit/add to tnsnames.ora file with SQLPLUS? [message #300870 is a reply to message #300856] Mon, 18 February 2008 07:01 Go to previous message
sammeras
Messages: 28
Registered: September 2007
Location: Israel
Junior Member

Thanks,
I added CONNECT TO ... Razz



CREATE DATABASE LINK TestDbLink 
CONNECT TO versiondb IDENTIFIED BY versiondb
USING '(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=
(PROTOCOL=TCP)(HOST=192.168.16.220)(PORT= 1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SID=orcl)))'



Previous Topic: Need Urgent help
Next Topic: Package Specification
Goto Forum:
  


Current Time: Tue Dec 06 10:31:12 CST 2016

Total time taken to generate the page: 0.11734 seconds