Let's see how to make the Teradata Express for VMware (TDE-V) image easily accessible for moving flat files to and from the image.
Having Teradata Express on VMware is a great tool. I am a big fan of VMware and having Teradata installed on an image makes my life a lot easier. I have been working with TDE-V since it came out a few weeks ago. It installed easily and the Linux instance and Teradata database came up without any issues. The Introduction article on DevX from hyperj gave plenty of info to get everything running.
One of the first things that I noticed about the Teradata database is that it is empty. I have some sample data on another machine that could be loaded. There are many tools available – TPT, bteq, etc., and they are already installed and configured on the VM. Getting data to the VM image, however, can be painful. The VM image network settings are such that they can only “see” the machine that is running the VM image. In order for the VM image tools to be able to load the data, the files must first be landed on the host machine and then ftp’ed to the VM machine. Not a big deal for small files, but a pain for larger files.
There are some configuration changes that can be made to facilitate moving files to and from the TDE-V. First, change the VM image from a “NAT” network to a “bridged” network. Changing to a bridged network makes the VM machine look like another machine on your local network. It is as if there was another physical box booted up and available. It is also accessible from any other machine on the same local network. This change is easy to do and won’t damage anything in the image. In VMware Workstation this change is a simple button to push. I am not sure how to do this on other VM platforms, but it should be straightforward.
Data can now be ftp’ed to the new box from anywhere on the local network. If you find ftp to be clunky, you can also use Windows Explorer. Windows Explorer can be easier than ftp as it will allow point and click for copying and pasting of files. To use Windows, will we want to map a drive letter to the VM image. This is easy to configure.
TDE-V is running Linux and the host machine is windows. We will use Samba to help the file systems talk to each other. Samba is a software package that allows Windows to assign a drive letter to a Linux directory. Samba is already installed on the VM image, but it isn’t running. To start Samba you log into the TDE-V image as root. Start a terminal window and type:
The Samba daemon starts. It is pre-configured to “share” the Linux user’s home directories. I recommend adding a new Linux user (I don’t want to use the root user). The GUI “User Management” on the TDE-V image makes this an easy task. I added a user “steve”. Even though the user “steve” has a Linux password, it does not have a Samba password. To assign a Samba password for user “steve” in the TDE-V image from a root prompt type:
smbpasswd –a steve
It prompts for a password and a confirmation. This can be the same password used when adding the Linux user or it can be different.
That is it for the Linux configuration; now for the Window’s configuration. One way to map a Windows drive is at a windows command prompt. Type:
net use y: \<IP Address>\users <passwd> /user:<username>
y: is the drive letter you want to use in Windows
<IP Address> is the IP address of the TDE-V image
<passwd> is the Samba password you assigned with smbpasswd
<username> is the Linux user you created on the TDE-V image
Windows returns a message saying the command completed successfully. The TDE-V image is now accessible from windows explorer as Y:. A quick copy/paste and the data files are loaded on the VM image. The next step is to create some tables and import the data.
To summarize, by changing the network connection on the TDE-V image to “bridged” and by using Samba, moving data for loading into the Teradata database becomes straightforward.