# Create a zipped xml model, named expectedmodel-v?.zip representing a specific database schema
# this model should represent an expected model that can be used to validate a database model update to that same version
#
# REM The used database connection is defined in the referred absserver.properties
#
# You can also pass parameters as java parameters. The format is
# databaseUrl databaseUser databasePassword nameOfExpectedXMLModel nameOfActualXMLModel
# where
#	databaseUrl 		      represents the URL of the database to connect to, in format jdbc:oracle:oci8:@<SID>
#	databaseUser		      The name of the database user in <SID> to connect to
#	databasePasword		      The password of the database user in <SID> to connect to
#	nameOfExpectedXMLModelZipFile The full file name of the zipped xml file representing the expected data model. 
#
# example
#	%JAVA_HOME%\bin\java.exe -Xmx512m absgroup.CreateExpectedXMLFromSchema jdbc:oracle:oci8:@ABS1 UNI UNIPWD c:\abssolute\expectedUNImodel.xml.zip
#	Will create the zipped database model file c:\abssolute\expectedUNImodel.xml.zip based on the data model of user UNI, SID ABS1, with password UNIPWD

#!/bin/bash
#
################################################################################
export ORACLE_HOME=/abs/instantclient_11_1
export OJDBC_JAR=jdbc/lib/ojdbc6.jar   # Set the correct OJDBC jar file name here. The given path is as seen from $ORACLE_HOME
export JAVA_HOME=/abs/jdk1.6.0_11
export DDLUTILSPATH="/abs/ddlutils"
################################################################################

export CLASSPATH=$ORACLE_HOME/$OJDBC_JAR:$DDLUTILSPATH/lib:$CLASSPATH
export PATH="$ORACLE_HOME/bin":"$JAVA_HOME/bin":"$PATH"
cd $DDLUTILSPATH/lib
java -Xmx512m absgroup.CreateExpectedXMLFromSchema
