cancel
Showing results for 
Search instead for 
Did you mean: 

User/Schema Mismatch Found in Database During Upgrade

former_member185327
Active Participant
0 Kudos

Hi Experts,

During our System Upgrade from ERP 6.0 EHP 6 to EHP 8 I have encountered an error in the Extraction phase as below.

Now this demo system was being copied from our production System. As per this note I have executed the below query

use <SID>

select * from sys.schemas where name = '<schema>'

However I got the mismatch between the Schema ID and Principal ID.

But when I executed the same Query in Production Server the Schema ID and Principal ID are showing Same.

As a matter of fact I have also executed the SQL Query Script which was attached in this Note and we are getting "Error in Query Execution" and each time the Value of the Schema  ID is getting increased by 5.

Here is the latest outcome of the query below.

Can anyone have any clue how this can be fixed ?

It will be really helpful.

Thanks and Regards

Anurag

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi Anurag,

I had the exact same issue while upgrading to NW740. SUM tool was reporting mismatch but when I ran the script from 1086375. It completed successfully but the error still persists.

Then I ran below query to check the mismatch

use <DB>

select schema_id('<db>'), user_id('<db>')


No mismatch was being displayed.


After this i executed


use <DB>

select * from sys. schemas where principal_id = user_id('<DB>').


replace DB with the SID of your DB


Not sure how, but the output of this query showed me the inconsistency and then when i ran the script from 1086375 it fixed the mismatch and the upgrade went on fine.


It looks like the issue happens on the system with MSSQL as DB and which are being refreshed from some other system. (e.g. SBX or QA).


Thanks,

Manas

former_member185327
Active Participant
0 Kudos

Hi Everyone,

I finally able to found out the exact cause by knowing the Database Role against which the user was assigned.

I replaced the required user with the dbo and transferred the role to the dbo.

After that I ran the attached query suggested in that Note again and the issue is now resolved.

Thanks and Regards

Anurag

Former Member
0 Kudos

Hi Anurag,

Have you changed the sid from biq to tqe for set @SchemaToFix ?

former_member185327
Active Participant
0 Kudos

Hi  Chinmay,

I have attached the Query Execution File. I have ran the query and the output is also there.

I have replaced biq with tqe, but I haven't done any other things.

Thanks and Regards

Anurag

manish_singh13
Active Contributor
0 Kudos

Hi Anurag,

Please update the result of below query:

select * from sys. schemas where principal_id = user_id('<schema>')



Thanks,

MPS

Former Member
0 Kudos

Hi Anurag,

The sapnote should solve your problem if the script execution was successful.

So, how did you run the script? What change you made in the input parameter of the script?

Is your system ABAP or JAVA.

Regards,

Prithviraj

former_member185327
Active Participant
0 Kudos

Hi Prtihvijit,

I am attaching the Log File where the query is executed and also the result is there. Hope it will be helpful for analyzing.

It is an ABAP System by the way and I am using SQL Server 2014.

Thanks and Regards

Anurag Das