Teradata connection string using Windows Authentication - windows

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)')

Related

How to get Oracle DB connection string

I need to connect my Microsoft Report Builder to Oracle DB but I could not seem to find the correct connection string for Oracle.
I tried:
Specifying username and password
Data Source=MyOracleDB;User Id=myUsername;Password=myPassword;Integrated Security=no;
but it returned:
Is it saying that I need to download the Oracle driver? Or should I get the connection string for Oracle DB?
If you don't already have it, you will need the Oracle Client installed. It will include an ODBC driver. ODBC is a wrapper for the Oracle Client, not a replacement. When setting up your connection you will also need to get the connection properties from the DBA (e.g. hostname/ip address, port, service name, username and password).
See documentation here:
https://docs.oracle.com/en/database/oracle/oracle-database/19/adfns/odbc-driver.html
https://www.oracle.com/database/technologies/releasenote-odbc-ic.html

Informatica Connection to OCI ADW during installation

I'm trying to install Informatica 10.1 on OCI and thereby connecting it to ADW for the INFA users access.
I've successfully established connectivity with ADW through sqlplus using the wallet keys. However, during the Informatica installation I'm not able to connect to the ADW database. Below is an excerpt of the connection that is being tried by the installer.
Configure the database for the domain configuration repository:
Database type:
* 1->Oracle
2->SQLServer
3->DB2
4->Sybase
(Default: 1):
Database user ID: (default :- dbadmin) :
User password: (default :- ) :
Configure the database connection
1->JDBC URL
* 2->Custom JDBC Connection String
(Default: 2):
I'm wary on the custom JDBC Connection String that is being asked. Usually the default string is something like this:
jdbc:informatica:oracle://somestringfromtnsnames.oraclecloud.com:1521;ServiceName=somestringfromtnsnames.adb.oraclecloud.com
But in this case I'm connecting to ADW via wallet & ideally the wallet information should be provided. I just am not sure how. I've prepared a string in accordance to the same which I thought was correct, but it doesn't work.
jdbc:informatica:oracle:#tnsnamesalias?TNS_ADMIN=/path/to/my/wallet/store
Has anyone got any idea on this? Any pointers would be helpful.
From what I understand, the DataDirect JDBC drivers used by Informatica do not support Oracle's encryption, which is required to access ADW. It appears that you can use Oracle Client on an existing Informatica installation to add ADW as a target, but not using JDBC or ODBC. There appear to be limitations to this in terms of metadata access, and some import steps will need to be completed manually.
In spite of what it implies in "Autonomous Database 3rd Party Tools and Applications" for Informatica, the only way to complete a new installation - according to the steps in Appendix A of the doc - is to first disable the SQL*Net encryption. This requires a level of access to the Oracle configuration files and processes that does not exist for Autonomous Database services (i.e. access to sqlnet.ora and lsnrctl). It only exists if you are running your own VM host (Infrastructure as a Service) with a stand-alone installation of Oracle Database that you fully control.

Export Database connection to Oracle Developer

I have a database Connection established in odbcad and Microsoft Access (aswell as working in Excel) via ODBC and want to also get it working in Oracle SQL developer.
It is a Windows SQL Server as far as i know and I have tried several Settings, of which None works. I have also installed Driver for ODBC. I would like to Import Settings into SQL developer as applied in MS Access, is there any possibility?
No, SQL Developer is a Java application and uses a JDBC driver.
But if you look at the odbc properties for your connection, those should largely translate to what you need to define a basic connection.
Oracle:
Server name or IP address of the DB, port # for the listener, and the name of the SID or Service, plus a valid username and password is all you need to connect to Oracle.
What error do you get when you try to connect?
Show us what you're trying.
Update:
You're trying to connect to SQL Server but you're getting"
Native SSPI library not loaded
You're trying to use OS Authentication for your connection. For this to work with the jTDS driver, you need to copy a DLL file named ntlmauth.dll (which is for NT authentication) under the jtds-x.x.x-dist\x86\SSO\ or jtds-x.x.x-dist\x64\SSO\, to any directories in the PATH environment.
Please update your question such that's it's clear you're connecting to SQL Server and share the error message so others can find it.
I imagine this question is a duplicate of many previous iterations of the same challenge.

UFT connection with Redshift

We are getting error while trying to connect UFT with Redshift:
Dim dbConnection
Srvname = "Driver={Amazon Redshift (x64)};Server=serverName; Database=DBName; UID=****; PWD=****; Port=****;"
Set dbConnection = CreateObject("ADODB.Connection")
dbConnection.Open Srvname
Error coming as:
Datasource name not found and no default driver specified.
But with all same credential we can able to connect redshift with "SQL Workbench".
SQL Workbench is using a different Connector (most probably JDBC or some other technology). The ADODB.Connection Object is trying uses the ODBC Drivers installed for the Operating System, so first things frist you need to install the ODBC Driver.
After this is don, depending on your credential management policy, you may need to simply use the proper Connection String or configure stuff in the ODBC wizard of Microsoft Windows.
SQL Workbench uses Amazon Redshift JDBC compatible driver. Try downloading ODBC driver. Follow the below link

Oracle odbc connection

I'm trying to connect using different ODBC clients (Advanced query tools and ODBC Query Tool) to my remote Oracle database but every time getting the following error : ORA-12560: TNS:protocol adapter error
my connection settings are:
Driver={Microsoft ODBC for Oracle};dbq=192.168.10.11:1521/TEST_DB;Uid=username;Pwd=password;
Could you please explain what is wrong in my connection settings or am I need to configure something else?
Somewhere in your connection string, the Oracle SID or Service Name needs to be specified. The following are two examples, with one specifying SERVICE_NAME and the other specifying SID:
Driver={Microsoft ODBC for Oracle};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=199.199.199.199)(PORT=1523))(CONNECT_DATA=(SID=dbName)));Uid=myUsername;Pwd=myPassword;
Driver={Microsoft ODBC for Oracle};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=199.199.199.199)(PORT=1523))(CONNECT_DATA=(SERVICE_NAME=dbName)));Uid=myUsername;Pwd=myPassword;
Check your driver documentation to make sure you are including all of the required connection options. I believe the minimum required details are server, port, SID or SERVICE Name, UID, and PWD.
Tony Hall
Driver={Microsoft ODBC for Oracle};
CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server)(PORT=7001))(CONNECT_DATA=(SERVICE_NAME=myDb)));
Uid=myUsername;Pwd=myPassword;

Resources