I created webapp on one server to query an oracle database housed on another server
It works from within visual studio,”view in browser” but when the page is server from IIS the following is
displayed
System.Data.OracleClient.OracleException:
ORA-12154: TNS:could not resolve the connect identifier specified
Any help is much appreciated; [:'(]
full details of the setup are below, is this a permissions issue.
I have read many many posts and believe that I have everything configured correctly ?
SERVERone:
Windows 2003 server running IIS 6.0 with .NET framework 2.057 and oracle InstantClient.
Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
I have a tnsname.ora and sqlnet.ora saved to the same directory (C:\instantClient\instantclient10_1)
I have a corresponding enviroment variable to that folder TNS_ADMIN C:\instantClient\instantclient10_1
“Authenticated Users” has FULL CONTROL
permissions on this folder and subfolders
Permission for read execute are also set for IWAM_SERVERone , IUSR_SERVERone, SERVERtwo/ASPNET
SERVEtwo:
Windows 2003 sever which is running an instance of Oracle 9i database.in
ORA home folder
“Authenticated Users” has FULL CONTROL permissions and sub folders
Permission for read execute are also set for IWAM_SERVERone, IUSR_SDMS-SERVERone, SERVERtwo ASPNET
I can successfully connect from SERVERone to SERVERtwo using
TOAD 9.0.1 and I can query the database.
More Details.....
I want to create a web app on SERVERone to queryan oracle database on SERVERtow
I created an ASP.NET application using visual web developer.
I addded a sqldatasource and configured the sqldatasource to use “oracle database” as the
data source, and the data provider “.NET Framework Data Provider for Oracle”
I set the
Server Name to the entry from the Tnanames.ora file an dentered the username and password
When I click TEST CONNECTION it works , I then added a select * from xyz query
WHEN I RUN THE PAGE FROM WITHIN VWD it works perfectly ( “view in browser”)
However when I add the site to IIS and launch the page I get the ORA-12154 error
TNSNAME.ORA entry
HOMER=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = 182.198.100.14)
(PORT = 1521)
)
)
(CONNECT_DATA =
(SID = ERR)
(GLOBAL_NAME = ERR.world)
)
)
sqlnet.ora ( this is the only line in this file , I also tried NTFS to no avail)
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName
%>"
SelectCommand='SELECT * FROM XYZ'>
<SelectParameters>
WEB CONFIG Entry
<
ORA-12154: TNS:could not resolve the connect identifier specified
Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details:
System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[OracleException (0x80131938): ORA-12154: TNS:could not resolve the connect identifier specified
did you give permissions to the ASP.NET users for ORacle home folder and subfolders too[Check this at subfolders level whether the permissions were set or not]
in asp.net2.0 after enteruing into that section in machine.config then press "psace bar" so that the intelligence window will open for to avoid the spelling mistakes.
But I think there will be two process model sections are available in 2.0.please check it and add since I dont have 2.0 in my pc at this moment I unable to figure it which section ecatly it is.
Thanks again for your help Ram,
I found the second sectioin in the machien.config under <system.web>
I added the userName attribute using the intellisense as suggested. I set teh userName property to system.
Unfortunatley it did not resolve the TNS error I'm recieving. The section in my machien.config is as follows
aidoco
Member
379 Points
96 Posts
asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect identif...
Feb 07, 2007 09:54 AM|LINK
I created webapp on one server to query an oracle database housed on another server
It works from within visual studio,”view in browser” but when the page is server from IIS the following is displayed
System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
Any help is much appreciated; [:'(]
full details of the setup are below, is this a permissions issue.
I have read many many posts and believe that I have everything configured correctly ?
SERVERone:
Windows 2003 server running IIS 6.0 with .NET framework 2.057 and oracle InstantClient.
Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
I have a tnsname.ora and sqlnet.ora saved to the same directory (C:\instantClient\instantclient10_1)
I have a corresponding enviroment variable to that folder TNS_ADMIN C:\instantClient\instantclient10_1
“Authenticated Users” has FULL CONTROL permissions on this folder and subfolders
Permission for read execute are also set for IWAM_SERVERone , IUSR_SERVERone, SERVERtwo/ASPNET
SERVEtwo:
Windows 2003 sever which is running an instance of Oracle 9i database.in
ORA home folder “Authenticated Users” has FULL CONTROL permissions and sub folders
Permission for read execute are also set for IWAM_SERVERone, IUSR_SDMS-SERVERone, SERVERtwo ASPNET
I can successfully connect from SERVERone to SERVERtwo using TOAD 9.0.1 and I can query the database.
More Details.....
I want to create a web app on SERVERone to queryan oracle database on SERVERtow
I created an ASP.NET application using visual web developer.
I addded a sqldatasource and configured the sqldatasource to use “oracle database” as the data source, and the data provider “.NET Framework Data Provider for Oracle”
I set the Server Name to the entry from the Tnanames.ora file an dentered the username and password
When I click TEST CONNECTION it works , I then added a select * from xyz query
WHEN I RUN THE PAGE FROM WITHIN VWD it works perfectly ( “view in browser”)
However when I add the site to IIS and launch the page I get the ORA-12154 error
TNSNAME.ORA entry
HOMER=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(HOST = 182.198.100.14)
(PORT = 1521)
)
)
(CONNECT_DATA =
(SID = ERR)
(GLOBAL_NAME = ERR.world)
)
)
sqlnet.ora ( this is the only line in this file , I also tried NTFS to no avail)
SQLNET.AUTHENTICATION_SERVICES= (NONE)
DATA SOURCE
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>" SelectCommand='SELECT * FROM XYZ'>
<SelectParameters>
WEB CONFIG Entry
<
ORA-12154: TNS:could not resolve the connect identifier specified
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve the connect identifier specified
Source Error:
Stack Trace:
[OracleException (0x80131938): ORA-12154: TNS:could not resolve the connect identifier specified]System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc) +84System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) +688System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) +135System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +37System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +28System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +429System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +70System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +512System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +85System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +102System.Data.OracleClient.OracleConnection.Open() +34System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +121System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +137System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +83System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1770System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +17System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70System.Web.UI.WebControls.GridView.DataBind() +4System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +69System.Web.UI.Control.EnsureChildControls() +87System.Web.UI.Control.PreRenderRecursiveInternal() +41System.Web.UI.Control.PreRenderRecursiveInternal() +161System.Web.UI.Control.PreRenderRecursiveInternal() +161System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1360
<div class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: center" align=center></div>
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
Oracle .net 2.0 VS.2005
ramana123
Participant
841 Points
241 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Feb 08, 2007 05:13 AM|LINK
Hi
did you give permissions to the ASP.NET users for ORacle home folder and subfolders too[Check this at subfolders level whether the permissions were set or not]
/Ram/
aidoco
Member
379 Points
96 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 01, 2007 10:04 AM|LINK
Hi
Thanks for the reply. My Oracle Hoem folder ( c:/instanClient/) has permissions for "ASP.NET Machine Account " for all sub folders
Thsi is really bugging me now , can anyone help?
Aidan
hivani
Member
51 Points
55 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 02, 2007 06:13 AM|LINK
me too getting the same error if got the solution please inform to me
my address:
A . Shiva Prasad
GIS Developer
MIDWESTINFOTECH Pvt LIMITED
70 , Kanakapura main road , JP Nagar 6th Phase
Opposite to family mart Bangalore
INDIA
@mail : shiva.prasad@midwestinfotech.com , altrenate mail is : asp.347@gmail.com
mobile : +919886451711
ramana123
Participant
841 Points
241 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 02, 2007 08:05 AM|LINK
Hi,
If you are using asp.net2.0 then processmodel attribute in machine.config file values set to "system".Other than this no guessses...
if this also not sort out your problem means you should reinstall the s/w.
/Ram/
aidoco
Member
379 Points
96 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 02, 2007 10:31 AM|LINK
HI
Thanks Ramana123,
It seems to be system alreday.
<section name="processModel" type="System.Web.Configuration.ProcessModelSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" allowLocation="false" />
The bosses are now trying to get rid of asp.net for this application and use pl/sql.
I really want to use asp.net , ANY HELP IS MUCH APPRECIATED GUYS
ramana123
Participant
841 Points
241 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 02, 2007 10:44 AM|LINK
Hi,
It seems your machine.config doesnt have the attribute username= 'system' try with after adding best of luck..
/Ram/
aidoco
Member
379 Points
96 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 02, 2007 01:22 PM|LINK
Thanks again for teh reply RAM.
When I add username='system or userName='system' or userName="system"
I get the teh parser error message below , Any thoughts, have I mispelled it ?
Thank you again
Parser Error Message: Unrecognized attribute 'userName'. Note that attribute names are case-sensitive.
Machine.config entry...
<section name="processModel" userName="system" type="System.Web.Configuration.ProcessModelSection, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineOnly" allowLocation="false"/>
ramana123
Participant
841 Points
241 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 05, 2007 02:49 AM|LINK
Hi,
in asp.net2.0 after enteruing into that section in machine.config then press "psace bar" so that the intelligence window will open for to avoid the spelling mistakes.
But I think there will be two process model sections are available in 2.0.please check it and add since I dont have 2.0 in my pc at this moment I unable to figure it which section ecatly it is.
/Ram/
aidoco
Member
379 Points
96 Posts
Re: asp.net to oracle application produces error ORA-12154 :TNS:could not resolve the connect ide...
Mar 05, 2007 09:16 AM|LINK
Hi
Thanks again for your help Ram,
I found the second sectioin in the machien.config under <system.web>
I added the userName attribute using the intellisense as suggested. I set teh userName property to system.
Unfortunatley it did not resolve the TNS error I'm recieving. The section in my machien.config is as follows
<system.web>
<processModel userName="system" autoConfig="false"/>
I also tried
<system.web>
<processModel userName="system" autoConfig="true"/>
I am now at a complete loss as to what the problem is?