Last post Mar 09, 2011 03:26 PM by reddy.net
Mar 08, 2011 02:12 PM|reddy.net|LINK
I need to connect to oracle database (10g) which is on differenet server.
Can i use the latest ODP.net provider or i need to use ODP.net provider related to oracle 10g only???
After installing the ODP.Net what are the next steps to do in order to connect to database.... Can u guys pls help me... This is totally new to me (connecting to oracle... i have worked with sql databases till now...)
Mar 08, 2011 02:25 PM|kedarrkulkarni|LINK
u can use latest ODP.
if u have worked with sql server then it should be easy to oracle too
u need to create tns entry (in tnsnames.ora file in oracle->network->admin directory ) of the server u r trying to connect
then, taste that u can connect to oracle database using oracle tool like sqlplusw /plsql developer/toad etc.
if everything is working then in web.config of u r app, give servername as tns name and username, pass of oracle database
use oracleconnection, oraclecommand classes in u r code to create connection and querying
that should be enough..
hope this helps...
Mar 08, 2011 05:28 PM|reddy.net|LINK
I have downloaded the ODAC112021.zip universal
installer from http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html
1) After executing this setup file, in the last step it is asking to execute the sql scripts. Where should i execute this scipts????
2) I got two folders created product\11.2.0\client_1 and product\11.2.0\client_2.
3) I can see the tnsnames.ora file in only client_2 folder. How to create a tns entry... i need to open with note pad and just add the tns entry??
Mar 08, 2011 08:13 PM|Lannie|LINK
You do not need to run the scripts unless you plan to use Oracle's version of users, roles, accounts, etc.
You only need one client home. Not sure how you ended up with two.
Yes, you will need to add to TNSNAMES.ORA with connection information for the remote database,
and resolve any firewall issues between the client server and the database server
to accommodate Oracle's use of listening ports, etc.
Mar 09, 2011 02:24 AM|kedarrkulkarni|LINK
tns entry in tnsnames.ora file isvery important for oracle connectivity... if u r oracle server is already being used by somebody else or if u have deidecated dba for oracle, then try to get tnsentry from them... generallly tnsentry looks like below..
(ADDRESS = (PROTOCOL = TCP)(HOST = XXX.XXX.XXX.XXX)(PORT = 1521))
(SERVER = DEDICATED)
(SERVICE_NAME = tnsName)
here, ip address of oracle server should be provided as host in address field.
also, servicename should be as per listner configured on oracle database..
once, tns entry is added in tnsnames.ora file, try connecting to databas using sqlplusw or any other oracle client tool
then use tnsname (in above entry) as servername in web.config file
hope this helps..
Mar 09, 2011 10:07 AM|reddy.net|LINK
I have done the above steps.
When i am trying to connect to oracle database using TNS, it is giving the following error.
Status : Failure -Error loading native JDBC driver library
Pls need help on this
Mar 09, 2011 03:26 PM|reddy.net|LINK
Fixed the issue. I do not have ide whats the exact problem is...
Uninstalled the existing oracle clients i had oracle 11g done before
1) Installed the oracle client for 10 g
2) Installed the ODP.Net drivers for 10g
3) Test through the SQL Developer (It worked)
4) In Visual Studio in the connection string i need to give the total connect identifier , not the TNS name.