I am having an issue to connect my C++ application to my Oracle DB,I get an error
"[OracleException] errcode: 1804, desc: Error while trying to retrieve text for error ORA-01804".
I got the same error for cx_oracle (via python). For this specific case ORACLE_HOME was missing in environment variables.
Set Oracle_home with Windows Cli (use your oracle folder):
setx ORACLE_HOME "C:\oracle\oc121\"
On some of the DB connections TNS_ADMIN is required also set that as well:
setx TNS_ADMIN "%ORACLE HOME%\network\admin"
I use OCCI in CentOS 7, and encounter the same issue, just add libociicus.so to LD_LIBRARY_PATH to resolve the issue.
You are receiving ORA-01804 by the database, the description of ORA-01804 is:
failure to initialize timezone information
Cause: The timezone information file was not properly read.
I was experiencing such trouble with C++ OCCI application which caught oracle::occi::SQLException when it was trying to connect to oracle db.
ORA-01804:
failure to initialize timezone information
Cause: The timezone information file was not properly read.
The reason was that my linux oracle client was missing some timezone related files in its $ORACLE_HOME directory.
The solution was to simply copy those files from another instance of oracle client.
Another possible reason: Binary have no permission to access the OCCI library ...
I encounter such situation due to my mistakenly setting mode of folder in which OCCI library is.
In my case, libociicus.so (can be found in the Oracle Instant Client) was missing.
Another trivial yet hard to determine cause for this might be that Oracle installation folder is incomplete. For me, a reason for this was that some process just (unsuccessfully) uninstalled Oracle client.
It was really tricky as bin folder from PATH env. var contained oci.dll (and lots of other DLL-s), but elsewhere under C:\oracle\11\ there were other files missing.
So: check that installation folder contains all required files!
I know this is an old question, but there are no answers can fix my case (oracledb package of nodejs, macOS).
but, again, I found a solution for myself.
The solution is that move libociei.dylib into /usr/locale/lib folder. That's it.
For me, it's because the version of my instant client and the database server is using a different version. So I had to match their version to solve this error. Apparently, Oracle can't read the DB timezone if their version is different.
The following isn't really a good solution. I'm not sure myself what made the deal. But for me the solution was to:
drop all other oracle clients from my PC
clear ORACLE_HOME and PATH from paths to dropped clients
restart the PC
After that the error was gone
Related
My python script reads through around half of the dataset (around 5000 rows out of 10000) and all of a sudden produces this error midway:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send())
I'm using pypyodbc to connect to the Azure SQL server. I haven't been able to find the solution anywhere online. I don't even know whats the cause that's leading to this error.
Please help.
Hope you are doing well. Have you had a chance to look at pyodbc and pymssql?
They have a better community presence and are actively maintained. If the script fails with these drivers as well, there might be an issue with your script. I can try to help you troubleshoot if you share it.
Let me know if the issue gets fixed with the other drivers and if it does not I can help you out.
Thanks,
Meet Bhagdev
Program Manager, Microsoft
I tried to reproduce the issue, but failed. And I observed that the package last updated in 2013. It's an old and no longer maintenance package for Python ODBC. So I don't recommend to continue to use it to access the latest Azure SQL Database.
I strongly recommended you to use the package pymssql. It's the Azure offical recommend odbc driver for Python, please refer to https://azure.microsoft.com/en-us/documentation/articles/sql-database-libraries/.
It can very good support any OS environment contains Windows, Linux, MacOS. You can refer to these docs https://azure.microsoft.com/en-us/documentation/articles/sql-database-develop-python-simple-windows/, https://azure.microsoft.com/en-us/documentation/articles/sql-database-develop-python-simple-ubuntu-linux/ and https://azure.microsoft.com/en-us/documentation/articles/sql-database-develop-python-simple-mac-osx/ to getting started.
If you want to dive into the package usgae, please refer to the offical document http://pymssql.org/en/latest/index.html.
Best Regards.
I am using netsight.windowsauthplugin version 2.3.1 in my Plone CMS installation on a linux server. The domain/realm is a windows domain.
My sysadmin gave me a .keytab file and set up the DNS A and PTR record, I have configured /etc/krb5.conf (the same way I have it for a spring java webapp on an another server), configured zope, but when I try to log in with Intrernet Explorer from my pc, I get an error:
GSSError: (('Unspecified GSS failure. Minor code may provide more
information', 851968), ('No key table entry found matching HTTP/#',
39756033))
What am I missing? My plone python interpreter cannot resolv a proper name? It cannot read the keytab or krb5.conf file?
There's a lot that can/could go wrong (or has to go right) before SSO works. To focus directly on your error report it seems that the PAS plugin in Plone cannot correctly get the GSSAPI service name.
In the latest master version on github (https://github.com/netsight/netsight.windowsauthplugin) there is a 'GSSAPI service' property you can add to the SPNEGO object stored in acl_users. Use this version and set the GSSAPI Service property to 'HTTP#www.mydomain.com'.
Note the '#' here, I think this is also wrong in the default value netsight.windowsauthplugin calculates where it adds a '/' as separator (suggesting it's an SPN, but it is the GSSAPI servide hint to the kerberos library.
If you run into other problems after this, please first try to enable kerberos library tracing by adding a KRB5_TRACE=/location/to/krbtrace-mysite.log environment variable before you start your Plone site (assuming you can run it from the terminal on some unixy environment). This KRB5_TRACE only works with newer kerberos releases but will provide you a lot more insight as to what is going wrong when you have to debug any further.
I have two RHEL servers running Python 2.4 and 2.6 separately. There is an Oracle database on the other server I need to access.
I was trying to install cx_oracle on my RHEL server but found out that the Oracle client must be installed first.
The problem is, I don’t have permission to install Oracle's client on both RHEL servers. On the same servers, a Perl program can connect to the Oracle db using:
DBI->connect("dbi:Oracle:host=myhost.prod.com;sid=prddb",'username','password')
Can Python do the same without installing cx_oracle and the Oracle client? Or are there any suggestions about how to write a module myself to do the same thing?
Thanks in advance!
An excerpt from https://forum.omz-software.com/topic/184/oracle-database:
There's no pure python client for Oracle and likely never will be. Even wonderful third-party toolsets like SQLalchemy still rely on cx_Oracle underneath to do the actual communication to the Oracle database servers.
—also, deciding by Google, the answer is no: there do not seem to be any pure Python Oracle clients in existence as of today.
Usually, all you need are the libraries, which don't necessarily require sudo rights. Extract them to a place the software will be able to read from and set the following environment variables accordingly:
ORACLE_HOME=path/to/where/you/extracted/libs
TNS_ADMIN=path/to/tnsnames.ora
I have had best luck skipping tnsnames, and just specifying the host, port, etc in the connection, but it's quite possible you'll need it for cx_oracle...I don't remember from when I used it ages ago.
if you don't want use cx_Oracle you should use expect scripting. ( for python pexpect). But you need to be carefully for handle all expectations.
I tried with libvirt. Unfortunately libvrt does not support KVM completely, and I have been constantly getting error messages and warnings stating, that it does not support the platform. Is there an alternate package or method that someone can suggest
Virtualbricks, CLI : http://www.virtualbricks.eu/
KVM-Admin, CLI : http://www.linux-kvm.org/page/Kvmtools
Ganeti, CLI : http://docs.ganeti.org/ganeti/current/html/
These three software are what you looking for : Python made and not based on libvirt.
I still using libvirt without any problem, so I maybe can help you with that.
the following script written by russel bartini may be helpful to you. this is a python script for managing, backup and restoring the VM running on KVM.
Here is the link :virt-back.py
I have a written a very small web-based survey using cgi with python(This is my first web app. ).The questions are extracted from a MySQL database table and the results are supposed to be saved in the same database. I have created the database along with its table locally. My app works fine on my local computer(localhost). To create db,table and other transaction with the MySQL i had to do import MySQLdb in my code.
Now I want to upload everything on my personal hosting. As far as I know my hosting supports Python,CGI and has MySQL database. And I know that I have to change some parameters in the connection string in my code, so I can connect to the database, but I have two problems:
I remember that I installed MySQLdb as an extra to my Python, and in my code i am using it, how would I know that my hosting's python interpretor has this installed, or do I even need it, do I have to use another library?
How do I upload my database onto my hosting?
Thanks
If you have shell access, you can fire up the python interpreter by running python and type import MySQLdb at the >>> prompt. If you get no errors in return, then its installed.
Likewise, if you have shell access, this page will help you with importing and exporting using the mysql command. I found it by googleing "import export mysql".
You can write a simple script like
import MySQLdb and catch any errors
to see if the required package is
installed. If this fails you can ask
the hosting provider to install your
package, typically via a ticket
The hosting providers typically also provide URL's to connect to the MySQL tables they provision for you, and some tools like phpmyadmin to load database dumps into the hosted MySQL instance
To check if MySQLdb library is installed on your hosting, simply open a python shell and type: import MySQLdb. If everthing goes ok, you're readt to go. If you get: ImportError: No module named MySQLdb, that means the the library is not installed and you nedd to install it.
You need that library or some library that provides similar support, because Python does not support native access to MySQL databases.
To transfer you database to your hosting check mysqldump.