I changed Service_Name in ..\network\admin\TNSNAMES.ORA file
Now when I open ODBC 64 bit DataSource > User DSN > MyOracleDSN > Configure = > I still find old Service_Name in the drop-down for TNS Service Name field.
Is it possible to refresh the Service_Name list in the drop-down to reflect the change ?
How ?
screenshot here
Here is a typical tnsnames.ora entry
PDB01 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = vbol83-02)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = pdb01.localdomain)
)
)
The "service name" that the odbc adapter (just like any other client program) is the very first line:
PDB01 =
The odbc driver, just like any other oracle client program (sqlplus, etc) simply makes a call to the tns stack and says 'connect me to "some name"'. The tns stack then looks for an entry for "some name" in the tnsnames.ora. In this example, "some name" is PDB01. Finding it, then then uses the rest of the information (beginning with " (DESCRIPTION =") and constructs a request that is passed on to the os network layer.
Related
when I log on some oracle database, I can connect without tnsnames.ora. However, when I try to log on some other database, it reject because of TNS:connection timeout. What is changed? What does TNS file do? Why I have to have this ora file?
Thank you
File tnsnames.ora just resolves your database alias to full databases address.
Assume you have an entry as this:
ORA11 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.0)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ORA12)
)
)
Then you can start for example SQL*Plus
sqlplus SCOTT#ORA11
or
sqlplus SCOTT#"(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.0)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=ORA12)))"
It does the same, the first way is just more convenient.
My tnsnames.ora looks like this:
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)**
But when I try connecting using SQL Developer as follows I get the error: No more data to read from socket.
Role: SYSDBA
ConnectionType: Basic
HostName: localhost
Port: 1521
SID: CLRExtProc
Can you please let me know what I am doing wrong? I can connect using the service_name, or when using service name in SID, but why does it not work when I use the SID defined in tnsnames.ora.
As per my understanding, the SID corresponds to the instance name for the database. Is it not possible to connect using it?
Best Regards,
Harshit
The CLRExtProc entry in the tnsnames.ora is for external processes. That is not the database SID you use for normal client connections.
The ORCL entry is defined to use servicename orcl. The service name and SID may or may not be the same. The database instance has a single SID, while it can have multiple service names, which may include a domain.
In your case it seems there is no domain, and the SID and service name are the same. If you want to connect from SQL Developer with the SID then use orcl. I'm not sure why you would want use that instead of the service name though. Read more about accessing the database.
You are also connecting AS SYSDBA, possibly as SYS, which isn't something you should do routinely. Hopefully you are not creating objects under a built-in schema; create your own user/schema and do everything under that instead.
I am creating a data source on a reporting tool of IBM (Cognos). That asks SQL*Net connect string.
Following is my tnsnames.ora entry. I am able to connect with SQLPLUS and TNSPING from the client.
OVDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.22.1.180)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = OVDB)
)
)
What would be my SQL *Net connect string? Is it OVDB?
Cognos wants to connect with Oracle database through it (OCI).
Yes, it's the name (or alias, or whatever) of the entry in your TNSNames file.
IBM support documentation 'Where do I find the SQL*Net connect string to connect to an Oracle Database?'
Try:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP) (HOST=172.22.1.180) (PORT=1521)) (CONNECT_DATA=(SERVER=DEDICATED) (SERVICE_NAME=OVDB)))
I'm new here so I introduce myself, my name is Ettore Giallaurito and my job is in the IT services in Italy.
My question:
I'm trying to connect to an Oracle DB instance through an odbc (System DNS) connections under XP but I get an error ORA1254 TNS:could not resolvethe connect identifier specified.
I'm using oracle instant client 11.2 and I've my tnsnames properly configured, since I can get connected with DBVisualizer using the TNS method.
To be honest I do get connected in this case, but I need to insert the full connect string:
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = repsit01.sit.sor)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = REPSIT01))
)
since it doesn't get me in if I use just the SID, in my case REPSIT01 as showed below.
My tns entry is as follow:
REPSIT01 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.1)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = REPSIT01))
)
Any help would be much apprecciated.
Thanks in advance Ettore.
Try setting the environment variable TNS_ADMIN to the directory where your tnsnames.ora file resides.
I'm trying to connect my local Oracle 11g database using server explorer in Visual Studio 2010. I tried to setup everything as per instruction, but I'm still getting an ORA-12504 error.
Here is the error:
Here is my tnsnames.ora contents:
# tnsnames.ora Network Configuration File: C:\app\rsahi\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
VENUS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = SPRPRG020)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = VENUS)
)
)
LISTENER_VENUS =
(ADDRESS = (PROTOCOL = TCP)(HOST = SPRPRG020)(PORT = 1521))
listener.ora file contents,
# listener.ora Network Configuration File: C:\app\rsahi\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = SPRPRG020)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\rsahi
Try this, in Visual Studio's Server Explorer Data Connection panel:
Data source name: SPRPRG020/VENUS
i.e. the Data source name format is SERVER_NAME_OR_IP/DATABASE_NAME
In the "Connection Properties" -> "Advanced" set in the "Data Source" field the information in format HOST/SERVICE_NAME. E.g. 127.0.0.1/TEST
Without having much knowledge in connecting ODP.NET with an Oracle DB, I suggest you start using SERVICE_NAME (e.g: VENUS) in your connection parameters.
Oracle states that:
From 11g onwards, the feature of using the hostname provided in the /etc/hosts file, as the alias / service name has been changed. As a result, the user will have to provide the service name while connecting OR configure the target listener with a default service name.
One way to bypass the SERVICE_NAME client side requirement is to force the Listener always sending you on the same SERVICE by telling it to do so in the tnsnames.ora
DEFAULT_SERVICE_LISTENER = VENUS
But I do not suggest you do that as it's quite restricting.
I have experienced the same problem when I was trying to create LinkedServer with Oracle 11g. My oracle instance name was: PC-2.my.xgen and my listener name was "NB". The last parameter of first statement is actually the concatenation of Oracle server instance and listener name.
So I have write down the following statements in SQL server.
--add a linked server into SQL server
--last parameter contains OracleInstance / Listener Name of desired database
EXEC sp_addlinkedserver 'OracleLinkedServer4', 'Oracle', 'MSDAORA', 'PC-2.my.xgen/nb'
--add login information into linked server
EXEC sp_addlinkedsrvlogin 'OracleLinkedServer4', false, Null, 'system', '123456'
In Oracle database "NB" I have a table named : CRD_CIL_NOTIFICATION_TYPE. So I have written down the following statement to get the records.
select * from OracleLinkedServer4..SYSTEM.CRD_CIL_NOTIFICATION_TYPE
In the "Connection Properties" -> "Advanced" set in the "Data Source" field the information in format HOST:PORT/SERVICE_NAME. E.g. 10.xxx.xxx.xxx:1521/SIDNAME