diff --git a/utils/myEnvironmentTemplate.bat b/utils/myEnvironmentTemplate.bat index de54aa57ba..44282f2a3c 100644 --- a/utils/myEnvironmentTemplate.bat +++ b/utils/myEnvironmentTemplate.bat @@ -17,6 +17,7 @@ @Rem Database ... +@SET ADEMPIERE_DB_SERVER=@ADEMPIERE_DB_SERVER@ @SET ADEMPIERE_DB_USER=@ADEMPIERE_DB_USER@ @SET ADEMPIERE_DB_PASSWORD=@ADEMPIERE_DB_PASSWORD@ @SET ADEMPIERE_DB_URL=@ADEMPIERE_DB_URL@ diff --git a/utils/myEnvironmentTemplate.sh b/utils/myEnvironmentTemplate.sh index bb405ead9b..9c0d625aa9 100644 --- a/utils/myEnvironmentTemplate.sh +++ b/utils/myEnvironmentTemplate.sh @@ -23,6 +23,8 @@ JAVA_HOME=@JAVA_HOME@ export JAVA_HOME # Database ... +ADEMPIERE_DB_SERVER=@ADEMPIERE_DB_SERVER@ +export ADEMPIERE_DB_SERVER ADEMPIERE_DB_USER=@ADEMPIERE_DB_USER@ export ADEMPIERE_DB_USER ADEMPIERE_DB_PASSWORD=@ADEMPIERE_DB_PASSWORD@ diff --git a/utils/oracle/DBExport.bat b/utils/oracle/DBExport.bat index ee3697d824..4ebdc81020 100644 --- a/utils/oracle/DBExport.bat +++ b/utils/oracle/DBExport.bat @@ -6,14 +6,15 @@ @if (%ADEMPIERE_HOME%) == () goto environment @if (%ADEMPIERE_DB_NAME%) == () goto environment +@if (%ADEMPIERE_DB_SERVER%) == () goto environment @Rem Must have parameter: userAccount @if (%1) == () goto usage @Rem Clanup -@sqlplus %1/%2@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql +@sqlplus %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql @Rem The Export -@exp %1/%2@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDat.dmp Log=%ADEMPIERE_HOME%\data\ExpDat.log CONSISTENT=Y STATISTICS=NONE OWNER=%1 +@exp %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDat.dmp Log=%ADEMPIERE_HOME%\data\ExpDat.log CONSISTENT=Y STATISTICS=NONE OWNER=%1 @cd %ADEMPIERE_HOME%\Data @copy ExpDat.jar ExpDatOld.jar diff --git a/utils/oracle/DBExport.sh b/utils/oracle/DBExport.sh index 2345121647..50c7a3d031 100644 --- a/utils/oracle/DBExport.sh +++ b/utils/oracle/DBExport.sh @@ -19,10 +19,10 @@ if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] fi # Cleanup -sqlplus $1/$2@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Daily.sql +sqlplus $1/$2@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Daily.sql # Export -exp $1/$2@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDat.dmp Log=$ADEMPIERE_HOME/data/ExpDat.log CONSISTENT=Y OWNER=$1 +exp $1/$2@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDat.dmp Log=$ADEMPIERE_HOME/data/ExpDat.log CONSISTENT=Y OWNER=$1 cd $ADEMPIERE_HOME/data jar cvfM ExpDat.jar ExpDat.dmp ExpDat.log diff --git a/utils/oracle/DBExportFull.bat b/utils/oracle/DBExportFull.bat index 26c3842170..536a82ada6 100644 --- a/utils/oracle/DBExportFull.bat +++ b/utils/oracle/DBExportFull.bat @@ -6,14 +6,15 @@ @if (%ADEMPIERE_HOME%) == () goto environment @if (%ADEMPIERE_DB_NAME%) == () goto environment +@if (%ADEMPIERE_DB_SERVER%) == () goto environment @Rem Must have parameter: systemAccount @if (%1) == () goto usage -@sqlplus %1/%2@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql +@sqlplus %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Daily.sql -@exp %1/%2@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDatFull.dmp Log=%ADEMPIERE_HOME%\data\ExpDatFull.log CONSISTENT=Y STATISTICS=NONE FULL=Y +@exp %1/%2@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDatFull.dmp Log=%ADEMPIERE_HOME%\data\ExpDatFull.log CONSISTENT=Y STATISTICS=NONE FULL=Y @cd %ADEMPIERE_HOME%\data @jar cvfM data\ExpDatFull.jar ExpDatFull.dmp ExpDatFull.log diff --git a/utils/oracle/DBExportFull.sh b/utils/oracle/DBExportFull.sh index 18ee2a3b8a..81c909da82 100644 --- a/utils/oracle/DBExportFull.sh +++ b/utils/oracle/DBExportFull.sh @@ -18,7 +18,7 @@ if [ "$ADEMPIERE_HOME" = "" -o "$ADEMPIERE_DB_NAME" = "" ] exit 1 fi -exp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDatFull.dmp Log=$ADEMPIERE_HOME/data/ExpDatFull.log CONSISTENT=Y FULL=Y +exp $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDatFull.dmp Log=$ADEMPIERE_HOME/data/ExpDatFull.log CONSISTENT=Y FULL=Y cd $ADEMPIERE_HOME/data jar cvfM ExpDatFull.jar ExpDatFull.dmp ExpDatFull.log diff --git a/utils/oracle/DBRestore.bat b/utils/oracle/DBRestore.bat index d3888a0fed..ddf06b38a5 100644 --- a/utils/oracle/DBRestore.bat +++ b/utils/oracle/DBRestore.bat @@ -6,6 +6,7 @@ @if (%ADEMPIERE_HOME%) == () goto environment @if (%ADEMPIERE_DB_NAME%) == () goto environment +@if (%ADEMPIERE_DB_SERVER%) == () goto environment @Rem Must have parameter: systemAccount adempiereID AdempierePwd @if (%1) == () goto usage @if (%2) == () goto usage @@ -14,12 +15,12 @@ @echo ------------------------------------- @echo Re-Create DB user @echo ------------------------------------- -@sqlplus %1@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\CreateUser.sql %2 %3 +@sqlplus %1@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\CreateUser.sql %2 %3 @echo ------------------------------------- @echo Import ExpDat @echo ------------------------------------- -@imp %1@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDat.dmp FROMUSER=(%2) TOUSER=%2 STATISTICS=RECALCULATE +@imp %1@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\ExpDat.dmp FROMUSER=(%2) TOUSER=%2 STATISTICS=RECALCULATE @echo ------------------------------------- @echo Create SQLJ @@ -30,7 +31,7 @@ @echo Check System @echo Import may show some warnings. This is OK as long as the following does not show errors @echo ------------------------------------- -@sqlplus %2/%3@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\AfterImport.sql +@sqlplus %2/%3@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\AfterImport.sql @goto end diff --git a/utils/oracle/DBRestore.sh b/utils/oracle/DBRestore.sh index 82242278b3..6be152f37d 100644 --- a/utils/oracle/DBRestore.sh +++ b/utils/oracle/DBRestore.sh @@ -21,12 +21,12 @@ fi echo ------------------------------------- echo Re-Create DB user echo ------------------------------------- -sqlplus $1@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3 +sqlplus $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3 echo ------------------------------------- echo Import ExpDat echo ------------------------------------- -imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDat.dmp FROMUSER=\($2\) TOUSER=$2 +imp $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/ExpDat.dmp FROMUSER=\($2\) TOUSER=$2 echo ------------------------------------- echo Create SQLJ @@ -37,4 +37,4 @@ echo ------------------------------------- echo Check System echo Import may show some warnings. This is OK as long as the following does not show errors echo ------------------------------------- -sqlplus $2/$3@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql +sqlplus $2/$3@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql diff --git a/utils/oracle/ImportAdempiere.bat b/utils/oracle/ImportAdempiere.bat index 0c1d82b4ce..4265167a60 100644 --- a/utils/oracle/ImportAdempiere.bat +++ b/utils/oracle/ImportAdempiere.bat @@ -6,6 +6,7 @@ @if (%ADEMPIERE_HOME%) == () goto environment @if (%ADEMPIERE_DB_NAME%) == () goto environment +@if (%ADEMPIERE_DB_SERVER%) == () goto environment @Rem Must have parameters systemAccount AdempiereID AdempierePwd @if (%1) == () goto usage @if (%2) == () goto usage @@ -14,12 +15,12 @@ @echo ------------------------------------- @echo Re-Create DB user @echo ------------------------------------- -@sqlplus %1@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\CreateUser.sql %2 %3 +@sqlplus %1@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\CreateUser.sql %2 %3 @echo ------------------------------------- @echo Import Adempiere.dmp @echo ------------------------------------- -@imp %1@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\Adempiere.dmp FROMUSER=(reference) TOUSER=%2 STATISTICS=RECALCULATE +@imp %1@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\Adempiere.dmp FROMUSER=(reference) TOUSER=%2 STATISTICS=RECALCULATE echo ------------------------------------- echo Create SQLJ @@ -30,7 +31,7 @@ call %ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\create %ADEMPIERE_DB_USER%/%ADEM @echo System Check - The Import phase showed warnings. @echo This is OK as long as the following does not show errors @echo --------========--------========--------========-------- -@sqlplus %2/%3@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\AfterImport.sql +@sqlplus %2/%3@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\AfterImport.sql @goto end diff --git a/utils/oracle/ImportAdempiere.sh b/utils/oracle/ImportAdempiere.sh index dca379cd1d..45db1215e8 100644 --- a/utils/oracle/ImportAdempiere.sh +++ b/utils/oracle/ImportAdempiere.sh @@ -21,14 +21,14 @@ fi echo ------------------------------------- echo Re-Create DB user echo ------------------------------------- -echo sqlplus $1@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3 -sqlplus $1@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3 +echo sqlplus $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3 +sqlplus $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql $2 $3 echo ------------------------------------- echo Import Adempiere.dmp echo ------------------------------------- -echo "imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Adempiere.dmp FROMUSER=\(reference\) TOUSER=$2" -imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Adempiere.dmp FROMUSER=\(reference\) TOUSER=$2 +echo "imp $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Adempiere.dmp FROMUSER=\(reference\) TOUSER=$2" +imp $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Adempiere.dmp FROMUSER=\(reference\) TOUSER=$2 echo ------------------------------------- echo Create SQLJ @@ -39,5 +39,5 @@ echo ------------------------------------- echo Check System echo Import may show some warnings. This is OK as long as the following does not show errors echo ------------------------------------- -echo sqlplus $2/$3@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql -sqlplus $2/$3@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql +echo sqlplus $2/$3@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql +sqlplus $2/$3@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql diff --git a/utils/oracle/ImportReference.bat b/utils/oracle/ImportReference.bat index 13a0396616..e7b0904702 100644 --- a/utils/oracle/ImportReference.bat +++ b/utils/oracle/ImportReference.bat @@ -6,13 +6,14 @@ @if (%ADEMPIERE_HOME%) == () goto environment @if (%ADEMPIERE_DB_NAME%) == () goto environment +@if (%ADEMPIERE_DB_SERVER%) == () goto environment @Rem Must have parameter: systemAccount @if (%1) == () goto usage @echo ------------------------------------- @echo Re-Create new user @echo ------------------------------------- -@sqlplus %1@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\CreateUser.sql Reference Adempiere +@sqlplus %1@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\CreateUser.sql Reference Adempiere @echo ------------------------------------- @echo Import Reference @@ -23,7 +24,7 @@ imp %1@%ADEMPIERE_DB_NAME% FILE=%ADEMPIERE_HOME%\data\Reference.dmp FROMUSER=(re @echo Check System @echo Import may show some warnings. This is OK as long as the following does not show errors @echo ------------------------------------- -@sqlplus reference/adempiere@%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\AfterImport.sql +@sqlplus reference/adempiere@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% @%ADEMPIERE_HOME%\Utils\%ADEMPIERE_DB_PATH%\AfterImport.sql @goto end diff --git a/utils/oracle/ImportReference.sh b/utils/oracle/ImportReference.sh index 4d495cd071..5ba10de9c5 100644 --- a/utils/oracle/ImportReference.sh +++ b/utils/oracle/ImportReference.sh @@ -21,17 +21,17 @@ fi echo ------------------------------------- echo Re-Create new user echo ------------------------------------- -sqlplus $1@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql Reference Adempiere +sqlplus $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/CreateUser.sql Reference Adempiere echo ------------------------------------- echo Import Reference echo ------------------------------------- echo imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference -imp $1@$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference +imp $1@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME FILE=$ADEMPIERE_HOME/data/Reference.dmp FROMUSER=\(reference\) TOUSER=reference echo ------------------------------------- echo Check System echo Import may show some warnings. This is OK as long as the following does not show errors echo ------------------------------------- -sqlplus reference/adempiere@$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql +sqlplus reference/adempiere@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/AfterImport.sql diff --git a/utils/oracle/Start.bat b/utils/oracle/Start.bat index ef08982b22..818ad98b87 100644 --- a/utils/oracle/Start.bat +++ b/utils/oracle/Start.bat @@ -4,7 +4,7 @@ lsnrctl start @Echo Starting Database .... -@sqlplus "system/%ADEMPIERE_DB_SYSTEM%@%ADEMPIERE_DB_NAME% AS SYSDBA" @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Start.sql +@sqlplus "system/%ADEMPIERE_DB_SYSTEM%@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% AS SYSDBA" @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Start.sql @Echo Starting optional agent .... agentctl start diff --git a/utils/oracle/Start.sh b/utils/oracle/Start.sh index 89fc391bff..f8de498a4b 100644 --- a/utils/oracle/Start.sh +++ b/utils/oracle/Start.sh @@ -1,3 +1,3 @@ # $Id: Start.sh,v 1.6 2005/01/22 21:59:15 jjanke Exp $ -sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_NAME AS SYSDBA" @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Start.sql +sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME AS SYSDBA" @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Start.sql diff --git a/utils/oracle/Stop.bat b/utils/oracle/Stop.bat index b512417702..8631536471 100644 --- a/utils/oracle/Stop.bat +++ b/utils/oracle/Stop.bat @@ -1,7 +1,7 @@ @Rem $Id: Stop.bat,v 1.7 2005/01/22 21:59:15 jjanke Exp $ @Echo Stopping database .... -@sqlplus "system/%ADEMPIERE_DB_SYSTEM%@%ADEMPIERE_DB_NAME% AS SYSDBA" @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Stop.sql +@sqlplus "system/%ADEMPIERE_DB_SYSTEM%@%ADEMPIERE_DB_SERVER%/%ADEMPIERE_DB_NAME% AS SYSDBA" @%ADEMPIERE_HOME%\utils\%ADEMPIERE_DB_PATH%\Stop.sql @Echo Stopping Listener .... lsnrctl stop diff --git a/utils/oracle/Stop.sh b/utils/oracle/Stop.sh index 0b597822a3..498f9cd10f 100644 --- a/utils/oracle/Stop.sh +++ b/utils/oracle/Stop.sh @@ -4,5 +4,5 @@ # SET ORACLE_SID= # export ORACLE_SID -sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_NAME AS SYSDBA" @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Stop.sql +sqlplus "system/$ADEMPIERE_DB_SYSTEM@$ADEMPIERE_DB_SERVER/$ADEMPIERE_DB_NAME AS SYSDBA" @$ADEMPIERE_HOME/utils/$ADEMPIERE_DB_PATH/Stop.sql