I am running the Oracle Developer DB VM on Virtualbox. On my local I am running macOS and have downloaded Oracle's SQLDeveloper. I have successfully connected to the database using the configuration found here. I am hoping to connect the the database in R, for example like this:
con <- DBI::dbConnect(odbc::odbc(),
Driver = "[your driver's name]",
Host = "localhost",
SVC = "[your schema's name]",
UID = "hr",
PWD = "oracle",
Port = 1521)
I have also tried connecting to the database using ODBC Manager and iODBC Administrator but am having trouble finding any driver & driver manager configuration that will have a successful connection like I got from SQL Developer. Every error I've gotten implies the configuration is wrong. I'm hoping to translate the successful SQL Developer connection into either a successful R connection or a connected DSN.
Related
I am using Python3.6 and pyodbc to try and connect to Teradata. I need this for a script I want to hand off to an end user to update from data. I would prefer that each user not have to be instructed to setup their own DSN connection with a specific name I hard encode into the script.
I think I have the driver correct now as well as the server and DB name. What I can't figure out is how to get the connection string to not require a username and password.
Helpful info:
This is for windows OS. When I go to ODBC connections in windows, connection mechanism is listed as LDAP and i can connect through the Teradata program as well.
What does work:
Connection directly through the Teradata program (showing Teradata itself knows who I am)
Using DSN="DSN_name" where DSN_Name is the name under ODBC connections found in windows. Showing I can connect via DSN.
-Looking at ODBC Data Source Admin shows Driver matches what I have. "Server Name or ID" matches "servername" below.
Tried:
connect_string = 'Driver={Teradata Database ODBC Driver
16.20};DBCName=servername;Database=db_name;MechanismName=LDAP;UseIntegratedSecurity=1;'
con = pyodbc.connect(connect_string)
which gives:
pyodbc.Error: ('HY000', '[HY000] [Teradata][ODBC] (11210) Operation not allowed during the transaction state. (11210) (SQLExecDirectW)')
connect_string = 'Driver={Teradata Database ODBC Driver
16.20};DBCName=servername;Database=db_name;MechanismName=LDAP;'
con = pyodbc.connect(connect_string)
or
connect_string = 'Driver={Teradata Database ODBC Driver
16.20};DBCName=servername;Database=db_name;Authentication=LDAP;'
con = pyodbc.connect(connect_string)
which gives:
pyodbc.InterfaceError: ('28000', '[28000] [Teradata][ODBC Teradata Driver] (2) Unable to logon with Authentication Mechanism selected. (2) (SQLDriverConnect)')
I have also tried a few other suggested authentication mechanisms in addition to LDAP, but this is the one listed in Teradata and ODBC connections.
In SQL_Server I use something like trusted_connection=yes to achieve the same effect I desire which doesn't seem to work in the above examples.
error:
pyodbc.OperationalError: ('08001', '[08001] [Teradata][ODBC] (10380) Unable to establish connection
with data source. Missing settings: {[Password] [Username]} (10380) (SQLDriverConnect)')
I'm attempting to make a connection to an Oracle Database with Microsoft Power BI Desktop.
Originally I was getting the following error message:
"The recommended provider ('Oracle.DataAccess.Client') is not
installed. You can continue with your current provider, however it has
been deprecated and may not work properly."
I've installed Oracle Database Access Components (ODAC), specifically "64-bit ODAC 12c Release 4 (12.1.0.2.4) for Windows x64" from this link. The message no longer appears. However, I now get a second error after attempting to connect to a database (which I can connect through Oracle's SQL Developer with no issues):
Unable to connect
We encountered an error while trying to connect.
Details: "Oracle: ORA-12541: TNS:no listener"
After install, there doesn't seem to be a "listener.ora" file located in %ORACLE_HOME%\network\admin\ folder at all. I do see "sqlnet.ora" and "tsnames.ora" but nothing else. Did I install the proper application or am I missing something? I tried doing a search of the file on the computer but nothing came up. Thanks.
If you are still having the problem see this Power BI Desktop Help page.
Manage your data Source - Oracle Power BI Desktop Help
Oracle Client --> [ Oracle Listener on Database Server --> Oracle Database Username ]
The Oracle Listener is normally located on the Oracle Database Server. Each Oracle Database running on the server will register Service Names with the Oracle Listener.
Oracle database initialization parameter local_listener
local_listener (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521)))
The local_listener is on the database server, the localhost port 1521.
The Oracle Client Networking Description Files are:
[Oracle Home Directory]\Network\Admin\sqlnet.ora
and
[Oracle Home Directory]\Network\Admin\tnsnames.ora
See the sqlnet.ora line [ NAME.DIRECTORY_PATH= (TNSNAMES, EZCONNECT) ]
Default is TNSNAMES.
TNSNAMES reads the description from the tnsnames.ora file.
Add your tnsnames description to the tnsnames.ora file. Use the CONTOSO connection description below as a guide.
Check with the Database Administrator, for HOST, PORT and the database SERVICE_NAME parameters.
Use the Oracle tnsping command to check the connection description.
tnsping CONTOSO
CONTOSO = (DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = oracleserver.contoso.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = CONTOSO)
)
)
Please remember that this is for the Power BI Desktop.
If you plan to move your Power BI Project to a Cloud Services or to a Local Power BI reporting server, check with your Server Administrator for connection information.
I've installed Oracle client in my machine, when I'm trying to connect to the oracle database server from Oracle SQL Developer am getting the following error:
Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
But am able to connect to the server using sql plus and TOAD as well from my machine. What is the issue if Toad connects to the server why cant my Oracle sql developer could not connect??
checked all the possible solutions like:
tns strings checking, telnet to the server and its port,
changing the oracle home in the sqldeveloper->tools->preferences->database->advanced tab.
None solved my issue. Is this the firewall issue?
If it is so how am able to connect using TOAD/sql plus ??
UPDATE: I'm connecting to the Oracle database server using the VPN.
Any help is much appreciated.
Thanks in advance.
Am a newbie to oracle, I've Oracle Database installed on my windows machine and I can connect to the database without any problem from my machine using the sqlPlus / SQL Developer. And I have a java application in my machine which needs to connect to the Database using JDBC driver. After downloading the ojdbc driver I can connect to the java application by providing the connection url as jdbc:oracle:thin:#127.0.0.1:1521:orcl
Now, I want to know how can I connect to my oracle database that is installed in my machine (ip address:10.0.xx.xx) from the java application which is running in another machine (ip address:10.0.yy.yy). BTW both the machines are connected in LAN.
Do I need to change anything in listener configuration or in tnsnames.ora file?
I checked these links for reference before posting this question:
How to connect to an Oracle DB from another system
also Cannot access oracle using sqlplus from another machine on the LAN
Please Suggest me how can I do this one. Thanks in advance.
The JDBC url has this form
jdbc:oracle:thin:#HOST:PORT:SID
So if you wanted to connect to an oracle server running on 10.1.2.3, on port 1521 (the default one), and on a database named 'stackoverflowdb' you'd use:
jdbc:oracle:thin:#10.1.2.3:1521:stackoverflowdb
Can we connect from excel (excel-VBA) to oracle(in a remote server) without
installing oracle client in the client system... I tried all the options
below but it is throwing error as oracle client should be installed.
below is the connectionstring i have used
1)strConnection = "Provider=OraOLEDB.Oracle;Data Source=SourceName;User Id=Username;
Password=password;"
2)strConnection = "Provider=MSDAORA;Data Source=SourceName;UserId=Username;
Password=password;"
3)strConnection = "Provider=MSDAORA.1;User ID=Username/password;Data
Source=SourceName;Persist Security Info=False"
4)strConnection = "Driver={Microsoft ODBC for Oracle};SERVER=(DESCRIPTION=
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.6)(PORT=1521)
)(CONNECT_DATA (SERVICE_NAME=SERVICEName)));uid=Username;
pwd=password;Uid=Username;Pwd=password;"
5)strConnection = "SERVER=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.2.6)
(PORT=1521))(CONNECT_DATA =(SERVICE_NAME=SERVICEName)));
uid=Username;pwd=password;"
You need some form of client to connect to an Oracle database, local or remote.
You have two choices:
Install an Oracle SQL*Net client. If your server is Oracle 10g or higher you don't need the full-blown client: you can use the more lightweight Instant Client.
Buy an n-tier ODBC driver which supports generic connectivity. OpenLink is one, there are others.
".can we not connect to the oracle
database with only the Drivers or
providers present in our OS(Windows
XP).."
Think of it this way: the ODBC drivers do not connect to the database, they connect to SQLNet. Then SQLNet connects to the database.
"what is the difference between
Drivers,providers with the client. "
The Oracle provided drivers are better tuned for Oracle than the ones MS provides, but in this context they are the same: both require the presence of an Oracle client to work.