Я пытаюсь установить sh соединение через Python (версия 3.7.4) с базой данных Oracle 9i (у меня есть некоторые важные таблицы, которые все еще там).
Я пытался использовать JayDeBeApi, но он утверждает, что для работы ему нужен Microsoft Visual C ++ 14.0. Поскольку я использую свой рабочий компьютер, у меня нет разрешения на установку программного обеспечения. Затем я нашел пакет SQLAlchemy, который установлен правильно (версия 1.3.15), но у меня возникают некоторые проблемы при попытке подключения к моей базе данных.
Вот что я пытаюсь сделать:
import sqlalchemy
oracle_db = sqlalchemy.create_engine('oracle://user:password@hostname:1521/service')
conn = oracle_db.connect()
result = conn.execute('select * from TABLE_NAME')
for row in result:
print(row)
И это «результат»
Traceback (most recent call last):
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 2285, in _wrap_pool_connect
return fn()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 303, in unique_connection
return _ConnectionFairy._checkout(self)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 773, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 492, in checkout
rec = pool._do_get()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\impl.py", line 139, in _do_get
self._dec_overflow()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\compat.py", line 178, in raise_
raise exception
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\impl.py", line 136, in _do_get
return self._create_connection()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 308, in _create_connection
return _ConnectionRecord(self)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 437, in __init__
self.__connect(first_connect_check=True)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 657, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\compat.py", line 178, in raise_
raise exception
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 652, in __connect
connection = pool._invoke_creator(self)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\default.py", line 488, in connect
return self.dbapi.connect(*cargs, **cparams)
cx_Oracle.DatabaseError: ORA-03134: Connections to this server version are no longer supported.
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Ricardo\_AF\python\teste_oracle9.py", line 8, in <module>
conn = oracle_db.connect()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 2218, in connect
return self._connection_cls(self, **kwargs)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 103, in __init__
else engine.raw_connection()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 2318, in raw_connection
self.pool.unique_connection, _connection
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 2289, in _wrap_pool_connect
e, dialect, self
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 1555, in _handle_dbapi_exception_noconnection
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\compat.py", line 178, in raise_
raise exception
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\base.py", line 2285, in _wrap_pool_connect
return fn()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 303, in unique_connection
return _ConnectionFairy._checkout(self)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 773, in _checkout
fairy = _ConnectionRecord.checkout(pool)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 492, in checkout
rec = pool._do_get()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\impl.py", line 139, in _do_get
self._dec_overflow()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\compat.py", line 178, in raise_
raise exception
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\impl.py", line 136, in _do_get
return self._create_connection()
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 308, in _create_connection
return _ConnectionRecord(self)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 437, in __init__
self.__connect(first_connect_check=True)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 657, in __connect
pool.logger.debug("Error on connect(): %s", e)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\langhelpers.py", line 69, in __exit__
exc_value, with_traceback=exc_tb,
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\util\compat.py", line 178, in raise_
raise exception
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\pool\base.py", line 652, in __connect
connection = pool._invoke_creator(self)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\strategies.py", line 114, in connect
return dialect.connect(*cargs, **cparams)
File "C:\Program Files\Python37\lib\site-packages\sqlalchemy\engine\default.py", line 488, in connect
return self.dbapi.connect(*cargs, **cparams)
sqlalchemy.exc.DatabaseError: (cx_Oracle.DatabaseError) ORA-03134: Connections to this server version are no longer supported.
Мне кажется, что эта версия SQLAlchemy использует cx_ Oracle (которая не подключается к версии 9i). Что я могу сделать? Есть ли предыдущая версия этого пакета, которую я должен установить? Есть ли другой пакет, который может помочь мне подключиться к моей базе данных?
Заранее спасибо!