python manage.py migrate出现ORA-00955

m0_38087678 2019-04-19 05:40:00
麻烦大家帮我看下如下错误,感谢各位朋友:
我的环境是:

python环境是:Python 3.6.0

数据库已经连上了,我oralce中已经查到有这个链接了,执行python manage.py makemigrations是成功的,并且已经生成了信息,如下:

但是在python manage.py migrate时候就会报以下错误:
注:红色是由于我已经执行过了makemigrations后了,请关注非红色部分
PS E:\python_xx\product_project2> python .\manage.py makemigrations
Migrations for 'prod_text':
prod_text\migrations\0001_initial.py
- Create model BookInfo
- Create model HeroInfo


PS E:\python_xx\product_project2> python .\manage.py migrate
Operations to perform:
Apply all migrations: admin, auth, contenttypes, prod_text, sessions
Running migrations:
Applying contenttypes.0001_initial...Traceback (most recent call last):
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 62, in execute
return self.cursor.execute(sql)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\oracle\base.py", line 497, in execute
return self.cursor.execute(query, self._param_generator(params))
cx_Oracle.DatabaseError: ORA-00955: name is already used by an existing object

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File ".\manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\__init__.py", line 364, in execute_from_command_line
utility.execute()
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\__init__.py", line 356, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\base.py", line 330, in execute
output = self.handle(*args, **options)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\commands\migrate.py", line 204, in handle
fake_initial=fake_initial,
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\executor.py", line 115, in migrate
state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\executor.py", line 145, in _migrate_all_forwards
state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\executor.py", line 244, in apply_migration
state = migration.apply(state, schema_editor)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\migration.py", line 129, in apply
operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\operations\models.py", line 97, in database_forwards
schema_editor.create_model(model)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\base\schema.py", line 319, in create_model
self.execute(sql, params or None)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\base\schema.py", line 136, in execute
cursor.execute(sql, params)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 79, in execute
return super(CursorDebugWrapper, self).execute(sql, params)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 64, in execute
return self.cursor.execute(sql, params)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\utils.py", line 94, in __exit__
six.reraise(dj_exc_type, dj_exc_value, traceback)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\utils\six.py", line 685,in reraise
raise value.with_traceback(tb)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 62, in execute
return self.cursor.execute(sql)
File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\oracle\base.py", line 497, in execute
return self.cursor.execute(query, self._param_generator(params))
django.db.utils.DatabaseError: ORA-00955: name is already used by an existing object
...全文
187 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
m0_38087678 2019-04-19
  • 打赏
  • 举报
回复
这是重新删除migrations目录后重新执行的结果: E:\python_xx\product_project2>python manage.py makemigrations Migrations for 'prod_text': prod_text\migrations\0001_initial.py - Create model BookInfo - Create model HeroInfo E:\python_xx\product_project2>python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, prod_text, sessions Running migrations: Applying contenttypes.0001_initial...Traceback (most recent call last): File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 62, in execute return self.cursor.execute(sql) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\oracle\base.py", line 497, in execute return self.cursor.execute(query, self._param_generator(params)) cx_Oracle.DatabaseError: ORA-00955: name is already used by an existing object The above exception was the direct cause of the following exception: Traceback (most recent call last): File "manage.py", line 22, in <module> execute_from_command_line(sys.argv) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\__init__.py", line 364, in execute_from_command_line utility.execute() File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\__init__.py", line 356, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\base.py", line 283, in run_from_argv self.execute(*args, **cmd_options) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\base.py", line 330, in execute output = self.handle(*args, **options) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\core\management\commands\migrate.py", line 204, in handle fake_initial=fake_initial, File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\executor.py", line 115, in migrate state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\executor.py", line 145, in _migrate_all_forwards state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\executor.py", line 244, in apply_migration state = migration.apply(state, schema_editor) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\migration.py", line 129, in apply operation.database_forwards(self.app_label, schema_editor, old_state, project_state) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\migrations\operations\models.py", line 97, in database_forwards schema_editor.create_model(model) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\base\schema.py", line 319, in create_model self.execute(sql, params or None) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\base\schema.py", line 136, in execute cursor.execute(sql, params) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 79, in execute return super(CursorDebugWrapper, self).execute(sql, params) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 64, in execute return self.cursor.execute(sql, params) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\utils.py", line 94, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\utils\six.py", line 685, in reraise raise value.with_traceback(tb) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\utils.py", line 62, in execute return self.cursor.execute(sql) File "C:\Python36\lib\site-packages\django-1.11.20-py3.6.egg\django\db\backends\oracle\base.py", line 497, in execute return self.cursor.execute(query, self._param_generator(params)) django.db.utils.DatabaseError: ORA-00955: name is already used by an existing object
m0_38087678 2019-04-19
  • 打赏
  • 举报
回复
补充下: 我将settings.py中配置数据库换成sqlit3就可以正常,但是只要使用ORACLE就会有问题(可以连接上,但是执行命令有错),oracle版本是:Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production DATABASES = { 'default': { 'ENGINE': 'django.db.backends.oracle', 'NAME': 'zgdbb', #数据库名称 'USER': 'bossgj', #用户名 'PASSWORD': 'xxxxx', #密码 'HOST': 'xxxx', #HOST 'PORT': '18094', #端口 } }
内容概要:本文聚焦于“含虚拟惯量阻尼的大功率并网逆变器VSG控制策略与仿真验证”,系统研究虚拟同步发电机(VSG)技术在大功率并网逆变器中的应用,旨在提升新能源并网系统的动态响应能力与运行稳定性。通过引入虚拟惯量与虚拟阻尼控制机制,使逆变器能够模拟传统同步发电机的惯性与阻尼特性,有效应对电网频率波动和负载突变带来的冲击。文档深入剖析了VSG的核心控制原理,包括有功-频率、无功-电压的下垂控制模型,并基于Simulink平台构建完整的系统仿真模型,对不同工况下的动态性能进行仿真分析与验证,充分展示了VSG在提升并网系统稳定性、增强电网支撑能力方面的优越性。; 适合人群:具备电力电子、自动控制理论及新能源并网技术背景,从事电气工程、可再生能源系统仿真与控制研究的研究生、科研人员以及相关领域的工程技术人员。; 使用场景及目标:① 掌握VSG控制策略在大功率并网逆变器中的具体实现方法与参数设计流程;② 学习基于Simulink搭建高保真度并网逆变器动态仿真模型的技术路径;③ 深入探究虚拟惯量与虚拟阻尼对改善电网频率响应、抑制功率振荡的作用机理,服务于微电网、高比例可再生能源接入等复杂电力系统的稳定性优化与控制策略研究。; 阅读建议:建议结合提供的Simulink仿真文件同步操作,重点关注VSG控制环路的结构设计与关键参数(如虚拟惯量、阻尼系数)的整定方法,通过设置不同的电网扰动工况(如负载切换、频率突变)观察系统响应特性,从而深入理解VSG的动态调节机制与控制优势。同时可参考文中涉及的其他电力系统控制案例,拓展对现代智能电网综合控制策略的认知视野。

37,738

社区成员

发帖
与我相关
我的任务
社区描述
JavaScript,VBScript,AngleScript,ActionScript,Shell,Perl,Ruby,Lua,Tcl,Scala,MaxScript 等脚本语言交流。
社区管理员
  • 脚本语言(Perl/Python)社区
  • WuKongSecurity@BOB
加入社区
  • 近7日
  • 近30日
  • 至今

试试用AI创作助手写篇文章吧