System Exception on command line when using /ignore switch

Hello Redgate team,

We are currently implement Schema Compare for oracle to ease our deploiement process. We use it in command line scheduled by Jenkins.
We successfully managed to compare our code base on the file system with the database and generate reports and deployment script
This command line works
"C:\Program Files\Red Gate\Schema Compare for Oracle 4\SCO.exe" /source .\{MY_SCHEMA} /target MY_SCHEMA/passwd@my.oracledb.com:1521/service{MY_SCHEMA} /report:.\report_scripts\report.html /scriptfile:.\report_scripts\scriptfile.sql /filter:.\Filter.scpf /indirect

As soon as we add /ignore /storage or /behavior in the command line then the comparison fails. Executing the following command :
"C:\Program Files\Red Gate\Schema Compare for Oracle 4\SCO.exe" /source .\{MY_SCHEMA} /target MY_SCHEMA/passwd@my.oracledb.com:1521/service{MY_SCHEMA} /report:.\report_scripts\report.html /scriptfile:.\report_scripts\scriptfile.sql /filter:.\Filter.scpf /indirect /storage:all

gives this error :
Reading dependency information
Registering database one
Registering database two
Error: One or more errors occurred.
Unexpected error: Comparison failed
Comparison failed
System.Exception
   at RedGate.Oracle.SchemaCompare.CommandLine.Program.RunComparison(IUsageHelper usageHelper, IDataSource source, IDataSource target, SchemaMapping schemaMapping, Optio
options, ISchemaComparisonState& state)
   at RedGate.Oracle.SchemaCompare.CommandLine.Program.Main(String[] cmdLineargs)

Activating verbose loglevel, I get the following exception in the log file
17:13:44.449|Fatal  |TaskRunner          |15 |System.AggregateException: One or more errors occurred. ---> System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#Wlh(IScriptExecutor #vIc)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#E9Pe.#EjVe(IScriptExecutor #9Z)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#mUle[#NrPb](IScriptExecutor #vIc, Func`2 #sxPb)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#mUle(IScriptExecutor #vIc, Action`1 #sxPb)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#HT0e.#FjVe()
   at System.Threading.Tasks.Task.Execute()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.WaitAll(Task[] tasks, Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.Populate()
---> (Inner Exception #0) System.InvalidCastException: Unable to cast object of type 'System.DBNull' to type 'System.String'.
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#Wlh(IScriptExecutor #vIc)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#E9Pe.#EjVe(IScriptExecutor #9Z)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#mUle[#NrPb](IScriptExecutor #vIc, Func`2 #sxPb)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#mUle(IScriptExecutor #vIc, Action`1 #sxPb)
   at RedGate.Oracle.SchemaCompare.ObjectModel.DatabaseFactory.#HT0e.#FjVe()
   at System.Threading.Tasks.Task.Execute()<---

Do you have any idea on how I can solve this?
Is there something wrong on my command or is it a bug on the command line?

Thanks for your help

Benjamin
Tagged:

Best Answer

  • Eddie DEddie D Posts: 1,780 Rose Gold 5
    Hi Benjamin

    Thank you for your forum post. I believe that I have answered this question in Support Ticket #103781.

    The fact that the error occurs when adding the /storage:all switch to your syntax you experience the reported problem makes me suspect that you need to set the default behavior and ignore options.

    Reviewing the two commands you are using, the first does not include any of the following 3 switches:
    /behavior: , /ignore: and /storage:

    The comparison engine will use the default options:
    /behavior:scriptheader /behavior:detectcolumnrenames
    /ignore:slowdependencies /ignore:dependentobjects /ignore:whitespace /ignore:doublequotes /ignore:sequencevalue /ignore:storage /ignore:mviewvalue

    By specifying the /storage:a the default no longer apply.

    Please run your command line syntax as follows with all the above switches added except for the /ignore:storage to resolve the problem.
    https://documentation.red-gate.com/sco4/using-the-command-line/command-line-switches
    "C:\Program Files\Red Gate\Schema Compare for Oracle 4\SCO.exe" /source .\{MY_SCHEMA} /target MY_SCHEMA/passwd@my.oracledb.com:1521/service{MY_SCHEMA} /report:.\report_scripts\report.html /scriptfile:.\report_scripts\scriptfile.sql /filter:.\Filter.scpf /indirect /behavior:scriptheader /behavior:detectcolumnrenames /ignore:slowdependencies /ignore:dependentobjects /ignore:whitespace /ignore:doublequotes /ignore:sequencevalue /ignore:mviewvalue /storage:all
    

    Many Thanks
    Eddie
    Eddie Davis
    Senior Product Support Engineer
    Redgate Software Ltd
    Email: support@red-gate.com
Sign In or Register to comment.