【问题标题】:Problem to make first migrate using Oracle in Django在 Django 中使用 Oracle 进行首次迁移的问题
【发布时间】:2019-03-04 19:26:08
【问题描述】:

我正在尝试在我的 Django 项目中连接 Oracle,但没有成功。

我的版本:

Python 3.7 x86
Django 2.1.1
Oracle Client 12.2.0.1.0 x86
Oracle Database 12.2.0.1.0 x64
cx-Oracle 7.0.0

settings.py 文件:

 DATABASES = {
 'default': {
  'ENGINE': 'django.db.backends.oracle',
  'NAME': 'lopestrc',
  'USER': 'django',
  'PASSWORD': 'django',
  'HOST': '192.168.0.208',
  'PORT': '1521'
  } 
}

我的 tnsping 响应很好,我可以从我的客户端站连接到数据库。

但是,当我第一次尝试迁移时,我收到以下错误:

django.db.utils.DatabaseError: ORA-00955: name is already used by an existing object

我没有在互联网上找到任何帮助。不知道该怎么办了。

有人可以帮忙吗?

谢谢

【问题讨论】:

    标签: django oracle cx-oracle ora-00955


    【解决方案1】:

    该错误意味着连接确实成功,但 Django 尝试执行的某些语句失败。我不确定 Django 本身是否有能力记录它正在执行的语句,但是如果你将环境变量 DPI_DEBUG_LEVEL 设置为值 16,cx_Oracle 6+ 可以这样做。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-26
      • 2013-11-19
      • 2015-08-18
      • 1970-01-01
      • 2021-11-20
      • 2011-10-26
      相关资源
      最近更新 更多