dnnwerk / dnnScript

Improve Stability & Performance of DNN (AKA DotNetNuke) CMS Platform
Other
20 stars 0 forks source link

Errors on applying TurboSchema script #4

Closed roman-yagodin closed 6 years ago

roman-yagodin commented 6 years ago

I've got following errors then I try to apply TurboSchema script after TurboDBConfig and TurboDNN scripts successfully applied:

Original messages (in russian):

Сообщение 1505, уровень 16, состояние 1, строка 2
Выполнение инструкции CREATE UNIQUE INDEX прервано, поскольку обнаружен повторяющийся ключ для объекта с именем "dbo.vw_TabUrls" и индекса с именем "PK_vw_TabUrls". Повторяющееся значение ключа: (0, 142, -1, 1).
Выполнение данной инструкции было прервано.
Сообщение 207, уровень 16, состояние 1, процедура vw_ProfileBase, строка 13
Недопустимое имя столбца "PropertyKey".
Сообщение 1088, уровень 16, состояние 12, строка 2
Не удалось найти объект "dbo.vw_ProfileBase", так как он не существует, или отсутствуют разрешения.
Сообщение 1088, уровень 16, состояние 12, строка 2
Не удалось найти объект "dbo.vw_ProfileBase", так как он не существует, или отсутствуют разрешения.
Сообщение 1088, уровень 16, состояние 12, строка 2
Не удалось найти объект "dbo.vw_ProfileBase", так как он не существует, или отсутствуют разрешения.
Сообщение 1088, уровень 16, состояние 12, строка 2
Не удалось найти объект "dbo.vw_ProfileBase", так как он не существует, или отсутствуют разрешения.
Сообщение 208, уровень 16, состояние 1, процедура vw_Profile, строка 22
Недопустимое имя объекта "dbo.vw_ProfileBase".
Сообщение 208, уровень 16, состояние 1, процедура GetUsersByPropertyName, строка 22
Недопустимое имя объекта "dbo.vw_Profile".
Сообщение 208, уровень 16, состояние 1, процедура UserProfileGranted, строка 26
Недопустимое имя объекта "dbo.vw_ProfileBase".
Сообщение 8171, уровень 16, состояние 2, процедура GetTabUrls, строка 34
Недопустимое указание "noexpand" для объекта "dbo.vw_TabUrls".

Messages, translated with Google:

Message 1505, level 16, state 1, line 2
The CREATE UNIQUE INDEX statement was aborted because a duplicate key was found for the object named "dbo.vw_TabUrls" and an index named "PK_vw_TabUrls". Duplicate key value: (0, 142, -1, 1).
The execution of this instruction has been interrupted.
Message 207, level 16, state 1, procedure vw_ProfileBase, line 13
Invalid column name "PropertyKey".
Message 1088, level 16, state 12, line 2
The "dbo.vw_ProfileBase" object could not be found because it does not exist or there are no permissions.
Message 1088, level 16, state 12, line 2
The "dbo.vw_ProfileBase" object could not be found because it does not exist or there are no permissions.
Message 1088, level 16, state 12, line 2
The "dbo.vw_ProfileBase" object could not be found because it does not exist or there are no permissions.
Message 1088, level 16, state 12, line 2
The "dbo.vw_ProfileBase" object could not be found because it does not exist or there are no permissions.
Message 208, level 16, state 1, procedure vw_Profile, line 22
Invalid object name "dbo.vw_ProfileBase".
Message 208, level 16, state 1, procedure GetUsersByPropertyName, line 22
Invalid object name "dbo.vw_Profile".
Message 208, level 16, state 1, procedure UserProfileGranted, line 26
Invalid object name "dbo.vw_ProfileBase".
Message 8171, level 16, state 2, procedure GetTabUrls, line 34
Invalid "noexpand" for the "dbo.vw_TabUrls" object.

DNN 8.0.4 SQL Server 2012

sleupold commented 6 years ago

Roman, sorry for the late reply.

You need to make sure, TurboDNN has been executed, prior to running TurboSchema. This should remove all issues displayed in your report. You may run TurboDNN without applying TurboSchema afterwards, but this will not provide you with the real performance improvement.

sleupold commented 6 years ago

regarding the first error: are there two tabs with same parent and taborder, maybe one deleted? SELECT * FROM dbo.tabs where ParentID = 142 and TabOrder = -1 Is one of both deleted?

roman-yagodin commented 6 years ago

I will check it out, thanks.

roman-yagodin commented 6 years ago

It looks like I do have some duplicates with same ParentID and TabOrder.

I think I should try to re-apply TurboDBConfig and TurboDNN on a untouched database from backup first and check again. I'll inform you about the results.

roman-yagodin commented 6 years ago

This time a get another error (now then applying TurboDNN script):

Conflict of the ALTER TABLE statement with the FOREIGN KEY constraint "FK_Feedback_Modules".
The conflict occurred in the database "Dnn804Copy", the table "dbo.Modules", column 'ModuleID'.
sleupold commented 6 years ago

Roman, regarding the duplicate tabs: is one of each deleted and the other not?

sleupold commented 6 years ago

regarding FK issue: is there a line number mentioned by chance? Which version of Feedback module do you have installed? Thanks, Sebastian

sleupold commented 6 years ago

Roman, would you mind to check, whether there are moduleID values in your Feedback table, which have no corresponding entry in Modules table by running the following statement: SELECT * FROM dbo.Feedback WHERE ModuleID NOT IN (SELECT ModuleID FROM dbo.Modules) If would be nice if you could check in database backup from before Turbo execution, whether there was a foreign key from feedback to modules and whether it is enabled by running "SELECT name, is_disabled, is_not_trusted, delete_referential_action_desc FROM sys.foreign_keys WHERE Name Like 'FK_Feedback_Modules'. Thank you

roman-yagodin commented 6 years ago

Thanks, Sebastian!

The foreign key exists in the original database, the SELECT name, is_disabled, is_not_trusted, delete_referential_action_desc FROM sys.foreign_keys WHERE Name Like 'FK_Feedback_Modules gives:

name is_disabled is_not_trusted delete_referential_action_desc
FK_Feedback_Modules 0 1 CASCADE

There are indeed orphaned records in the Feedback table with non-existent ModuleID, so I've cleaned them up by DELETE FROM dbo.Feedback WHERE ModuleID NOT IN (SELECT ModuleID FROM dbo.Modules)

After that TurboDNN and TurboSchema scripts were applied w/o any issues.