Marc

Marc

  • 1.9k
  • 205
  • 46.6k

Remotely Recompile

May 6 2015 10:55 AM
I am working on a c# application that does a schema upgrade remotely.  I am able to get the upgrade to work all the way up to its time to recompile the new objects.  The code used for the local recompile works fine, but am getting the error when running utl_recomp remotely, saying utl_recomp must be declared, which I have only found out that I need to be logged in as sysdba.  My connection string to the client server is connecting as a sysdba, so I don't understand what the issue is.
hear is an example
OracleCommand dbCmd = new OracleCommand("begin utl_recomp.recomp_serial('" + mySchema + "'); end;", conn);
dbCmd.CommandType = CommandType.Text;
dbCmd.ExecuteNonQuery();
Is using an oracleCommand what I should be doing here or should I try using a process to recompile mySchema? My SQL isn't the strongest so I am not sure if I should be doing a alter package type of deal or not.  
Thoughts?
Thanks!