QGIS - 3.0.1

I am trying to connect to the Oracle database. I am not an expert in QGIS, pyqgis at all. I took help of following code to connect to Oracle database. Connecting directly to an Oracle Database using PyQGIS

I used the above code using my hostname, port, database name, username and password.

I get following message when I run the code through OsGeo4W shell.

C:\Program Files\QGIS 3.0\bin>python-qgis.bat "C:\Arundhati\Automation Test Scri
pt\Radio Signal\QGIS_Test_Run3.py"
Oracle driver not available
QSqlDatabase: QOCI driver not loaded
Could not open connection.
QSqlQuery::exec: database not open

How to install the QOCI driver? I couldn't find any help online.

closed as off-topic by Vince, whyzar, nmtoken, neogeomat, xunilk May 25 '18 at 3:07

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • If you search on "Oracle database not open" you should find plenty of links to steps to repair an offline Oracle database. This is not client-specific, as it is a server problem. – Vince May 24 '18 at 17:57
  • Are you sure about this? My guess was it could not open the connection because driver is not available? – Jay May 24 '18 at 18:06
  • Yes. It's been the better part of a decade since I last used Oracle, but "database not open" had been an indication of failure to start successfully for the two decades before that, – Vince May 24 '18 at 18:10
  • But the database is not offline. I am using it right now. – Jay May 24 '18 at 18:19
  • The error message "database not open" is an Oracle error indicating the server is offline (technically started, but in an intermediate state). stackoverflow.com/questions/27280405/… – Vince May 24 '18 at 18:24

I used to same code but I used the QOCISPATIAL driver while making database connection which worked perfectly. I hope it is useful for someone.

Not the answer you're looking for? Browse other questions tagged or ask your own question.