Tuesday, February 15, 2011

EHPI fails at phase MAIN_SHDRUN/RUN_RADTBUCACT...

During the phase MAIN_SHDRUN/RUN_RADTBUCACT the process fails.  Inside the shadow instance, if you run the program RADTBUCACT manually, you will get the SQL error cannot find stored procedure 'sap_get_object_type'

If you look inside the database, you will see that the stored procedure is there under the <sid> schema, not the sid_shd schema. If you try to run MSSPROCS, you may run into problems as well, since the shadow instance is a remote connection.



To resolve this, you need to create the stored procedure manually.
The easiest way for non-DBA types is to browse to the stored procedures in your database using SQL Management Studio. Right-click on the sap_get_object_type procedure, and choose to script the object as "CREATE" to a query analyzer window. Then change the "CREATE proc" line to reference sid_shd rather than just sid and execute.


The following stored procedures will all have to be available in the sid_shd schema in order for MAIN_SHDRUN/RUN_RADTBUCACT to complete successfully:

  • sap_get_index_columns
  • sap_get_index_id
  • sap_get_index_type
  • sap_get_object_type
  • sap_get_single_table_of_index
  • sap_get_sqltext
  • sap_get_table_columns

However, if you do just these stored procedures, you will likely run into the same issue in Phase MAIN_SHDRUN/ACT_UPG, but it will not look as obvious.  The errors you see will have you running in circles trying to setup/fix the transport domain configuration because of RC=12, etc, but the problem really is the fact that there are more missing stored procedures (look at any cancelled batch jobs that were kicked off in your system during this phase, you will see them failing after not finding a stored procedure).  You can either step through this one stored procedure at a time, which will get extremely time-consuming, or you can simply create all of the stored procedures that exist under the sid schema.  The easiest way to do this is as follows:

  1. Open up SQL Management Studio
  2. Browse to the stored procedures in your SAP database (they are located under "programmability")
  3. Highlight all the stored procedures in the sid schema, right-click, and chose to script to QA window
  4. Do a find/replace. Replace all [sid]. with [sid_shd]. (do not forget the brackets and period "." or else you will be messing up the scripts.
  5. Execute

This will give you some warnings, but it will create all the stored procedures and will get you through this phase of the upgrade.

I hope this helps...