A port of Microsoft's AdventureWorksDW demo database to Teradata.
-
Either
BTEQ
must be installed on your client orARC
must be installed on the Teradata system (for TDExpress). -
The load user needs the
CREATE DATABASE
right in the target database.
-
Download both AWDWrestore.arc (restore script) and AWDWARC (database backup) files and copy it to a folder on your TDExpress, e.g.
/tmp
-
Logon to the Teradata system and create a database:
CREATE DATABASE AdventureWorksDW AS PERM = 500e+06;
-
Modify the
AWDWrestore.arc
script to match your target system. -
Open a terminal window and run
cd /tmp
arcmain < AWDWrestore.arc
There will be warning message:
02/26/2019 05:09:29 *** Warning ARC1256:Cross release data restore requires
that one of the following Teradata SQL conversion scripts
be run to complete the restore: post_data_restore.
which can be ignored as no conversion is needed.
-
Download AdventureWorksDW_Teradata.zip and extract the zip file to a folder, e.g.
C:\Samples\AdventureWorksDW_Teradata
. -
Modify the file
_logon.txt
to match your target system. Optionally modify the database name. -
Open a cmd (or PowerShell) window, change to the folder and run the file
_install.btq
using bteq:
cd C:\Samples\AdventureWorksDW_Teradata
bteq < _install.btq > _install.log
-
Download AdventureWorksDW_Teradata.zip and extract the zip file to a folder, e.g.
~/Samples/AdventureWorksDW_Teradata
. -
Modify the file
_logon.txt
to match your target system. Optionally modify the database name. -
Open a terminal window, change to the folder and modify the data in three csv files from Windows to Linux path syntax:
cd ~/Samples/AdventureWorksDW_Teradata
sed -i 's/\\/\//' DimEmployee.csv
sed -i 's/\\/\//' DimProduct.csv
sed -i 's/\\/\//' DimSalesTerritory.csv
- Then run the file
_install.btq
using bteq:
bteq < _install.btq > _install.log
If the install is running without errors you will see this message repeated 30 times:
*** WARNING: OUT OF DATA.
Otherwise check the _install.log
for errors
Before re-running the install script the database must be dropped or all objects removed
DROP DATABASE AdventureWorksDW;
or
DELETE DATABASE AdventureWorksDW;
When the database is not dropped the script will return an error, but still run successfully:
*** Failure 5612 A user, database, role, or zone with the specified name already exists.