Navicat备份还原 – [Err] 创建视图失败

huangapple go评论77阅读模式
英文:

Navicat backup restoring - [Err] Failed to create View

问题

我正在测试恢复数据库备份的过程,当涉及到视图时,大部分视图都已经恢复成功,但是对于一些视图,它给出了一个错误

我去检查了这个视图,发现它的选择语句是从另一个视图中选择的。

我的问题是,是否有一种方法可以强制恢复这个视图,即使它有错误?

我通过复制视图的选择查询,并创建一个同名的新视图来解决了这个问题...它完美地工作了。但是如果我完全丢失了模式/服务器,只剩下备份文件怎么办呢?
Navicat视图恢复错误

英文:

I was testing the restoring of my database backup
and when it comes to the views, most of them are restored but for some views it gives me an Error

I went to check the view, the view has a select statement that selects from another view.

My question is, is there a way to force it to restore the view even though it has an error?

I solved it by copying the select query of the view, and creating a new view with the same name.. it works perfectly but what if I completely lost the **schema / server **and all i have is the backup file
Navicat view restore ERROR

答案1

得分: 0

我意识到问题出在函数上,视图正在使用尚未在模式中恢复的函数。

更明确地说,恢复的顺序是“表格 > 视图 > 函数 > 事件”。
所以我必须先恢复“表格 > 函数 > 事件”,然后再恢复视图,这样就可以正常工作了。

英文:

I realized the problem was in the functions, the views were using functions that hasn't been restored yet in the schema.

To be more clear, The restore goes "Tables > Views > Functions > Events"
So i had to restore first "Tables > Functions > Events" Then i would restore the views, it worked perfectly fine.

huangapple
  • 本文由 发表于 2023年7月27日 18:10:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76778691.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定