HI,
In Visual Studio 2010 I select Add new connection and then I chose Oracle server. Then I choose Oracle provider for .Net. And this window comes.
I wonder what I should write in the Data Source text field if I the Oracle database is at server with name AZSSRV and IP address 172.117.17.1 ? Any help will be appreciated
After getting inspired with #Harrison's answer I finally was able to create a successful connection with Oracle Database located in a remote server. So I did exactly the way Harrison told me -created an environment variable named TNS_ADMIN and gave it the path where the TNSNAMES.ORA file is located(in my case it is :C:\app\Mikola\product\11.2.0\client_1\Network\Admin\Sample).But this on it own was not enough. I had to add some parameters to the file by opening it in a simple Text editor like Notepad.Here I'm posting the inner look of the TNSNAMES.ORA file:
OracleServerHost =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.117.17.1)(PORT = 1521))
(CONNECT_DATA =(SID = ORCL)
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
After saving and restaring VS 2010 I got "OracleServerHost" in the Data Source name drop down list.
P.S. Modifying the TNSNAMES.ORA file might not be necessary if you had already configured the file during the installation of Oracle Client.
Your entries from TNSNames.ora should appear here and you would select the one that you need to use.
Since the drop down does not seem to be working, it would indicate that VS2010 cannot find your Oracle home.
An easy solution to this is to create an environmental variable called
TNS_ADMIN
and place the path to the TNSNames.ora file you wish to you
as such
C:\app\MyDir\product\11.2.0\client_1\Network\Admin\
Close VS2010. Make the environment variable changes, then reopen, the drop down should then show you the available ora connections you may want to use.
(you can look # this thread for a bit more info: http://forums.oracle.com/forums/thread.jspa?threadID=2213359&tstart=0)
hth
Related
I Google[d] for this error ORA-12560: TNS:protocol adaptor error but not able to find the actual reason and how to solve this error ?
Can anyone tell me a perfect solution to solve login problem.
Go to the windows machine that hosts the Oracle database server
Go to Start -> Run -> Services.msc in Windows.
Locate OracleService < SID > (here OracleServiceORCL) and click on Start to start the oracle database service (if not already running)
Once it is up and running, from the command prompt run the following:
tnsping < tnsalias >
(tnsalias entry you can find it in tnsnames.ora file)
In my case I didn't have an OracleService (OracleServiceORCL) in Windows Services.msc as described in Bharathi's answer.
I executed this command:
C:\> ORADIM -NEW -SID ORCL
and then the OracleService called OracleServiceORCL just showed up and got started in Services.msc. Really nice.
Source: https://forums.oracle.com/forums/message.jspa?messageID=4044655#4044655
Seems like database is not up. It might be due to restarting machine and the instance is not set to autostart and it so not started munually after starting from services Screen.
Just goto Command prompt
Set Oracle SID
C:>set oracle_sid=ORCL
Now run Net start command.
C:>net start oracleserviceORCL
from command console, if you get this error you can avoid it by typing
c:\> sqlplus /nolog
then you can connect
SQL> conn user/pass #host:port/service
Add to the enviroment vars the following varibale and value to identify the place of the tnsnames.ora file:
TNS_ADMIN
C:\oracle\product\10.2.0\client_1\network\admin
In my case (for OracleExpress) the service was running, but I got this issue when trying to access the database via sqlplus without connection identifier:
sqlplus sys/mypassword as sysdba
To make it work I needed to add the connection identifier (XE for Oracle Express), so following command worked ok:
sqlplus sys/mypassword#XE as sysdba
If you still get ORA-12560, make sure you can ping the XE service. Use:
tnsping XE
And you should get OK message along with full connection string (tnsping command is located in oracle's installation dir: [oracle express installation dir]\app\oracle\product\11.2.0\server\bin). If you can not ping make sure your tnsnames.ora file is reachable for sqlplus. You might need to set TNS_ADMIN environment variable pointing to your ADMIN directory, where the file is located, for example:
TNS_ADMIN=[oracle express installation dir]\app\oracle\product\11.2.0\server\network\ADMIN
After searching alot got a simple way to solve it.
Just follow the steps.
Check status of your listener.
open command prompt and type lsnrctl status
You will get no listener.
Now open listener.ora file which is present in following directory: C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN
Open that file and change the host parameter with you computer name
You can get your computer name by right click on My Computer and check you computer name, and replace host parameter with your computer name as follows:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = Electron-PC)(PORT = 1521)
)
)
)
So here you can observe HOST = Electron-PC, which is my computer name.
Save the listener.ora file and again return to cammand propt
3.Type the following in command prompt lsnrctl start
This will start the OracleTNSListner.
you can check it in the service by opening services tab of Task Manager. if not started automatically you can start it.
Just this much and you are ready to work again on oracle.
Best of Luck.
Quite often this means that the listener hasn't started. Check the Services panel.
On Windows (as you are) another common cause is that the ORACLE_SID is not defined in the registry. Either edit the registry or set the ORACLE_SID in a CMD box. (Because you want to run sqlplusw.exe I suggest you edit the registry.)
I have solved the problem the easy way. My oracle was running just fine in the past. After I installed MS SQL Server was when I noticed this problem. I just uninstalled MS SQL Server on my machine then the problem was gone. Make sure you restart your computer after that. Now I can connect to Oracle database through SQLPlus again. My guess is that there's some conflict between the two. Hope this helps.
Another possible solution that just worked for me...considering I was using my local login as the dba permissions.
Follow the steps to get to Services. Right click on the instance and go to 'Log On'? (might not be the name but it's one of the tabs containing permissions). Change the settings to use LOCAL.
If none the above work, then try this :
Modify the LISTENER.ora (mine is found in : oracle\product\11.2.0\dbhome_1\NETWORK\ADMIN\listener.ora) ==> add a custom listener that points to your database(SID), example my SID is XZ0301, so :
## Base XZ03001
SID_LIST_LISTENER_XZ03001=(SID_LIST=(SID_DESC=(ORACLE_HOME =
E:\oracle\product\11.2.0\dbhome_1)(SID_NAME= XZ03001)))
LISTENER_XZ03001=(DESCRIPTION_LIST=(ADDRESS=(PROTOCOL =
TCP)(HOST=MyComputerName)(PORT= 1521)))
DIAG_ADR_ENABLED_LISTENER_XZ03001=ON
ADR_BASE_LISTENER_XZ03001=E:\oracle
Restart your machine
For Windows 7, use the following to modify the LISTENER.ora:
- Go to Start > All Programs > Accessories
- Right click Notepad and then click Run as Administrator .
- File>open and navigate to the tnsnames.ora file.
- Make the changes then it should allow you to save
It really has worked on my machine. But instead of OracleServiceORCL I found OracleServiceXE.
Flow the flowing steps :
Edit your listener.ora and tnsnames.ora file in
$Oracle_home\product\11.2.0\client_1\NETWORK\ADMIN location
a. add listener.ora file
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C: [here c is oralce home directory]
b. add in tnsnames.ora file
SCHEMADEV =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = dabase_ip)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = SCHEMADEV)
)
)
Open command prompt and type
sqlplus username/passowrd#oracle_connection_alias
Example : username : your_database_username
password : Your_database_password
oracle_connection_alias : SCHEMADEV for above example.
Just to add up, follow the screenshot and choose local account to start if not selected. Then start the service.
You need to tell SQLPlus which database you want to log on to. Host String needs to be either a connection string or an alias configured in your TNSNames.ora file.
ORA-12560: TNS:erro de adaptador de protocolo
set Environment Variables: ORACLE_BASE, ORACLE_HOME, ORACLE_SID
make sure your user is part of ORACLE_GROUP_NAME (Windows)
make sure the file ORACLE_HOME/network/admin/sqlnet.ora is:
SQLNET.AUTHENTICATION_SERVICES = (NTS)
(Windows) Be carefull when you add a new Oracle client: adding a new path to the PATH env. variable can mess things up. The first entry in this variable makes a difference: certify that the sqlplus executable in the ORACLE_HOME (ORACLE_HOME/bin) comes first in the PATH env. variable.
I try 2 option:
You change service OracleService in Service Tab -> Running
Login with cmd command: sqlplus user_name/pass_word#orcl12C
Note: orcle12c -> name of OracleService name run in you laptop
Below fixes can be applied to resolve TNS 12560 error
Get Latest patch for SQL*NET client software
Set $ORACLE_HOME and $PATH variable (should be accessible for System user)
Check permissions on PC client
Check $TNS_ADMIN variable
Check if network has firewall or antivirus issues
Check if windows services Run >> Services.msc has OracleXE or OracleORCL service running
Check below link in case of net tracing error:
http://dba-oracle.com/t_sql_net_tracing.htm
In my case, (ORA-12560: TNS protocol adapter error)Issue cause of database connection issue like database, user name and password.
Once you got the issue. Initially you have to check connection details, after check the oracle service and further more.
I missed some connection details, So only i got TNS protocol adapter error,
I will changed the connection details, It would be working fine.
I have SQL Server 2012 and Oracle 11g installed on the same virtual machine and OS is Windows Server 2012. I am trying to connect Oracle to SQL Server. I have kept the machines same in the hopes that process will be easier. I created the machine 2 days ago to test the connection process before applying it on server.
Following are the steps I have taken.
1) Created ODBC Connection for SQL Server with the name sqlodbc with the simple/non-admin user credentials which is tested successfully.
2) My tnsnames.ora file is below
sqlodbc
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST = localhost)(PORT = 1433))
(CONNECT_DATA =(SID = sqlodbc))
(HS = OK)
)
[SQL Server port is 1433] [I even tried with the port 1521 but same problem]
3) The SID_LIST_LISTENER part from listener.ora file is as follow
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME=sqlodbc)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = hsodbc)
)
)
4) I have created initsqlodbc.ora file at [Oracle_Home]\hs\admin with following
HS_FDS_CONNECT_INFO = sqlodbc
HS_FDS_TRACE_LEVEL = off
5) I created the public database link
create public database link sqls
connect to "user" identified by "pass"
using 'sqlodbc';
I went through other threads on here but I could not find any solution for my problem.
I am trying to run the following command
select * from empnew#sqls
Where have I gone wrong with the configuration? Or if there is any step that I have missed? Or I have taken the wrong approach altogether?
I would really appreciate any help I can get.
Thank you.
[NOTE: When I restarted the machine, and I tried running the same command, I was getting the "Database not open error" initially but then it changed into the TNS error later on after a minute or so.]
So there must have been some syntax error which was giving me the issue.
I recreated the ODBC connection, re-written entries in tnsnames.ora and listener.ora file and removed all the previous commented entries. The spaces and " and brackets can cause problems so just make sure everything is accounted for.
My updated ora files can be found at this location for future references. (its another question for different error but contains all the information in correct format.)
Issue connecting Oracle 11g to SQL Server 2012 -- ORA-12523: TNS:listener could not find instance appropriate for the client connection
Try this TNSNAMES.ora entry instead:
sqlodbc
(DESCRIPTION =
(ADDRESS = (PROTOCOL = tcp)(HOST = localhost)(PORT = 1433))
(CONNECT_DATA =(SERVICE_NAME = sqlodbc))
(HS = OK)
)
I am trying to accessing my Oracle database over Network. I have Google a lot and found many solutions, but those doesn't work for me.
The problem is that, I want to access my Oracle Database from One Computer to another Computer over my Local Network.
What I did is....
I found a Solution to modify listener.ora file with
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=dbp.devProject.com)(PORT=1521)))
When I modify this file and tried to run and access the Database nothing will happens, and it throws an Error, the port number you have specified is used by another listener, so i have changed port Number but I am not able to access Database.
2. I have configure a new listener with the help of oracle's tool Net Manager, which made a Listener for me, but it does not make accessible database over Network.
Here Some required results.
lsnrctl status : Listener using listener name LISTENER has already been started.
Connection String : jdbc:oracle:thin:#dbp.devProject.com:4541:myDB
Database Version :
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
status shows me this.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
Alias : LISTENER
Version : TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
Start Date : 14-MAY-2015 11:58:05
Uptime : 0 days 2 hr. 29 min. 50 sec
Trace Level : off
Security : ON: Local OS Authentication
SNMP : OFF
Listener Parameter File : product\11.2.0\dbhome_1\network\admin\listener.ora
Listener Log File : \listener\alert\log.xml
Listening Endpoints Summary...
1. (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
2. (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Someone please Help me.
Thanks for your Help..
Whenever you encounter this kind of errors while creating remote access for you database, follow these steps beforehand.
Create a Listener using Net Manager tool of Oracle or create it Manually.
After generating Listener, check out "listener.ora"
[Located : ORACLE_INSTALLED_DIR\product\11.2.0\dbhome_1\NETWORK\ADMIN]
file, for your entry. (is there any Entry for the Listener which you have created just before. If you found your Entry than and than do next steps otherwise do it from FIRST step.)
If you found the Entry for your Listener, Open Command Prompt and fire command lsnrctl status. This will give you all currently running Listeners List, find out the one which you created just before.
Check out the Host Name and Port Number for your Listener.
Generate the Connection String as per the details you found in lsnrctl status
Connect with Database, and You can access the Database from anywhere in your Network.
If your host name and port number is listener then You could try this option by enabling port number in firewall settings.
Opening Ports in Windows Firewall
Open the Control Panel. ...
Open Windows Firewall. ...
Click the Advanced Settings link. ...
Select "Inbound Rules". ...
Create "New Rule" under "Inbound Rules". ...
Select "Port" from the first screen of the wizard. ...
Choose TCP or UDP. ...
Enter in the port range. ...
Finish the wizard.
Create an entry in TNSNAMES.ORA file on the system from which you are trying to connect to the database. (TNSNAMES.ORA is located in ORACLE_INSTALLATION_PATH/Network/Admin/ folder)
Sample entry:
DB_HOST_NAME =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DB_HOST_NAME)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)
If you have more than one Oracle clients installed, you might need to update this in all those TNSNAMES.ORA
I have a database "TEST", to which I connect at address 123.45.67.89:1521.
How do I connect to it using PL/SQL Developer?
In the "database" section of the logon dialog box, enter //hostname.domain:port/database, in your case //123.45.67.89:1521/TEST - this assumes that you don't want to set up a tnsnames.ora file/entry for some reason.
Also make sure the firewall settings on your server are not blocking port 1521.
I would recommend creating a TNSNAMES.ORA file. From your Oracle Client install directory, navigate to NETWORK\ADMIN. You may already have a file called TNSNAMES.ORA, if so edit it, else create it using your favorite text editor.
Next, simply add an entry like this:
MYDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 123.45.67.89)(PORT = 1521))
(CONNECT_DATA = (SID = TEST)(SERVER = DEDICATED))
)
You can change MYDB to whatever you like, this is the identifier that applications will will use to find the database using the info from TNSNAMES.
Finally, login with MYDB as your database in PL/SQL Developer. It should automatically find the connection string in the TNSNAMES.ORA.
If that does not work, hit Help->About then click the icon with an "i" in it in the upper-lefthand corner. The fourth tab is the "TNS Names" tab, check it to confirm that it is loading the proper TNSNAMES.ORA file. If it is not, you may have multiple Oracle installations on your computer, and you will need to find the one that is in use.
The problem is not the TNS file, in PLSQL Developer, if you don't have the oracle installation, you need to provide the location of the OCI.DLL file.
In PLSQL DEV app go to Tools-Preferences-Oracle/connections-OCI Library.
In my case I put the next address C:\Oracle\InstantClient-win32-11.2.0.1.0\oci.dll.
If have Weblogic app installed, I didnt tried but if you want try to put the next location
C:\Oracle\Middleware\wlserver_10.3\server\adr.
In addition to Richard Cresswells and dpbradleys answer:
If you neither want to create a TNS name nor the '//123.45.67.89:1521/Test' input works (some configurations wont), you can put
(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 123.45.67.89)(PORT = 1521)) (CONNECT_DATA = (SID = TEST)(SERVER = DEDICATED)))
(as one line) into the 'database' section of the login dialog.
I am facing to this problem so many times till I have 32bit PL/SQL Developer and 64bit Oracle DB or Oracle Client.
The solution is:
install a 32bit client.
set PLSQL DEV-Tools-Preferencies-Oracle Home to new 32bit client Home
set PLSQL DEV-Tools-Preferencies-OCI to new 32 bit home /bin/oci.dll For example: c:\app\admin\product\11.2.0\client_1\BIN\oci.dll
Save and restart PLSQL DEV.
Edit or create a TNSNAMES.ORA file in c:\app\admin\product\11.2.0\client_1\NETWORK\admin folder like mentioned above.
Try with TNSPING in console like
C:>tnsping ORCL
If still have problem, set the TNS_ADMIN Enviroment properties value pointing to the folder where the TNSNAMES.ORA located, like: c:\app\admin\product\11.2.0\client_1\network\admin
Username : username
Password : password
Database : //123.45.67.89:1521/TEST
Connect as : Normal
this work for me and (version 13.0.6.1911 64 bit)
I am trying to use MS access to connect to a Oracle database.
I keep on getting the following error message:
ORA-12154: TSN- could not resolve the connect identifier secified
The Oracle Drivers OracleClient10g can verify that the database server exists.
I have a section in my tsnnames.ora file that looks like this:
UBASEP10G =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = bxxx-xxx.yyyy.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = UBASE)
)
)
per my attempts to get this error resolves I added this to the sqlnet.ora file:
NAMES.DIRECTORY_PATH= (HOSTNAME, ONAMES, TNSNAMES,LDAP,EZCONNECT)
When using the Windows ODBC driver configuration utility it asks for the following
following information
DATA SOURCE NAME : MYSOURCE NAME
TSN SERVICE NAME:UBASEP10G
USERID:MYUSERID
any suggestions ?????
I don't have Access, but using Excel 2007, I had to do the following:
Open ODBC Administrator (in the Administrator Control Panel)
For either User DSN or System DSN, click Add...
Select "Oracle in OraDb10g_home1" as the driver
In the Oracle ODBC Driver Configuration, I entered:
Data Source Name: myOracleDsn
Description: This is my DSN for my Oracle Database
TNS Service Name: oratns
User ID: scott
Click Test Connection, and enter "tiger" for the password. Obviously, I'm connecting to my scott/tiger sample Oracle database. Also, when I installed Oracle, I picked oratns as my TNS name. The other two values above are arbitrary -- you'll see them in dialogs in Excel.
If the test works, click OK.
Go to Excel and make a new connection to a DSN. The dialog will show "myOracleDsn" as an option. Select it, enter "tiger" for the password again, and you should get a working connection.
Try changing (CONNECT_DATA = (SERVICE_NAME = UBASE) ) to (CONNECT_DATA = (SID = UBASE) ) in your TNSNAMES.ora file.
ServiceName and SID aren't necessarily the same and consequently aren't always interchangeable.
The SERVICENAME parameter refers to a particular GLOBAL_DBNAME specified in the listener.ora file on the database server. It's an alias for an instance on the server. You can have multiple servicenames on a server referring to the same SID. The SID parameter refers to a particular instance on that server.
The advantage of using servicename on the client side is that the DBA can change the actual instance being referenced by a servicename transparently to the clients using that name. I can have this on the server listener.ora file:
(SID_DESC =
(GLOBAL_DBNAME = THESERVICE)
(ORACLE_HOME = d:\oracle\10.2.0_DB)
(SID_NAME = SID1)
Later, I can change the actual database being referenced by switching the listener.ora configuration:
(SID_DESC =
(GLOBAL_DBNAME = THESERVICE)
(ORACLE_HOME = d:\oracle\10.2.0_DB)
(SID_NAME = SID2)
and nobody's the wiser on the client side. No changes were necessary in the tnsnames.ora files on the clients.
Can you log in to the database in question via SQL*Plus? Doing this from another machine with a working connection (or the DB server itself) is fine also.
If so, run this:
select value from v$parameter where name='service_names';
In your TNSNAMES.ORA, use one of the values listed there for the SERVICE_NAME.
In you ODBC connection, all you'll need is to set the TNS Service Name to the name you used above, "UBASEP10G"
Let's back up to square one. Open a command window and connect to your database:
sqlplus myuserid/mypassword#UBASEP10G
Does this connect successfully?
Since the answer is no, is there a way you CAN connect successfully to this database? BQ is correct, your problem is with the servicename of UBASE. You need to determine what the listener on the server thinks the name of that database is. Do you have access to the server? Can you execute the command "lsnrctl status" on the server? This will tell you the services that are registered with the listener, and look something like this:
Services Summary...
Service "UBASE" has 1 instance(s).
Instance "UBASE", status READY, has 1 handler(s) for this service...
Try tnsping and report your results.
Bad:
C:\>tnsping notreal.world
TNS Ping Utility for 32-bit Windows: Version 9.2.0.5.0 - Production on 29-OCT-2008 15:56:47
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
C:\oracle\ora92\network\admin\sqlnet.ora
TNS-03505: Failed to resolve name
Good:
O:\>tnsping real.world
TNS Ping Utility for 32-bit Windows: Version 9.2.0.5.0 - Production on 29-OCT-2008 15:57:42
Copyright (c) 1997 Oracle Corporation. All rights reserved.
Used parameter files:
C:\oracle\ora92\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)
(HOST = DBSERVER.DOMAIN.COM)(PORT = 1521)) (LOAD_BALANCE = YES) (FAILOVER = YES))
(CONNECT_DATA = (SERVICE_NAME = REAL.WORLD)
(FAILOVER_MODE = (TYPE = SELECT) (METHOD = BASIC) (RETRIES = 10) (DELAY = 3))))
OK (40 msec)