diff --git a/samples/features/sql-big-data-cluster/bootstrap-sample-db.cmd b/samples/features/sql-big-data-cluster/bootstrap-sample-db.cmd index d74b8ae2..347e06cf 100644 --- a/samples/features/sql-big-data-cluster/bootstrap-sample-db.cmd +++ b/samples/features/sql-big-data-cluster/bootstrap-sample-db.cmd @@ -38,6 +38,7 @@ REM Copy the backup file, restore the database, create necessary objects and dat echo Copying sales database backup file to SQL Master instance... %DEBUG% kubectl cp tpcxbb_1gb.bak mssql-master-pool-0:/var/opt/mssql/data -c mssql-server -n %CLUSTER_NAMESPACE% || goto exit +REM Download and copy the sample backup files if /i %AW_WWI_SAMPLES% EQU --install-extra-samples ( if NOT EXIST AdventureWorks2016_EXT.bak ( echo Downloading AdventureWorks2016_EXT sample database backup file... @@ -71,6 +72,10 @@ if /i %AW_WWI_SAMPLES% EQU --install-extra-samples ( echo Configuring sample database(s)... %DEBUG% sqlcmd -S %SQL_MASTER_INSTANCE% -Usa -P%SQL_MASTER_SA_PASSWORD% -i "%STARTUP_PATH%bootstrap-sample-db.sql" -o "bootstrap.out" -I -b -v SA_PASSWORD="%KNOX_PASSWORD%" || goto exit +REM remove files copied into the pod: +echo Removing database backup files... +kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak" + for %%F in (web_clickstreams inventory customer) do ( if NOT EXIST %%F.csv ( echo Exporting %%F data... diff --git a/samples/features/sql-big-data-cluster/bootstrap-sample-db.sh b/samples/features/sql-big-data-cluster/bootstrap-sample-db.sh index 92fb198c..f3f65b01 100644 --- a/samples/features/sql-big-data-cluster/bootstrap-sample-db.sh +++ b/samples/features/sql-big-data-cluster/bootstrap-sample-db.sh @@ -78,6 +78,10 @@ echo Configuring sample database... export SA_PASSWORD=$KNOX_PASSWORD $DEBUG sqlcmd -S $SQL_MASTER_INSTANCE -Usa -P$SQL_MASTER_SA_PASSWORD -I -b < "$STARTUP_PATH/bootstrap-sample-db.sql" > "bootstrap.out" || (echo $ERROR_MESSAGE && exit 2) +# remove files copied into the pod: +echo Removing database backup files... +kubectl exec mssql-master-pool-0 -c mssql-server -i -t -- bash -c "rm -rvf /var/opt/mssql/data/*.bak" + for table in web_clickstreams inventory customer do echo Exporting $table data...