Teradata TPT Script

Tools

Teradata TPT Script

I am attempting to write a TPT script to move data from one table to another. The tables are on two different Teradata systems (one is production the other is test). My source and target table are exactly the same in every way (fields, datatypes,...). I was able to get the script to work no problem.

Here is my question. Since the tables are exactly the same, does the script need to have DEFINE SCHEMA listing all the fields and data types?

Sure would be nice not to have to define field level details. My ultimate goal is to create a dynamic TPT script moving a variable table list and it would be sure nice not to have to go down to field level definitions.
41 REPLIES
Teradata Employee

Re: Teradata TPT Script

We do understand that it would be nice to not have to specify a schema object in the script, and we are working towards that goal. If you have further questions on this, do not hesitate to ask, and please send all questions to the Tools section of the Developers Exchange site.

Thanks!
-- SteveF
N/A

Re: Teradata TPT Script

Hi, 

I am new to TPT, i want to generate TPT script dynaminally, as my tables may change from time to time. i need a script which will dynamically fetch the Source and target table information from a meta data table.

Plz help me with the same.

Thanks in advance.

Regards,

Sam

N/A

Re: Teradata TPT Script

To be more precise in regards of my query as above, i need to move tables from system to another.

My source and destination table schema will be same.

I want a single script, which can move any table, only by changing the table details (table name, etc).

Teradata Employee

Re: Teradata TPT Script

You have 2 choices.

1. use Easy Loader (executable is called "tdload"); in TTU 14.0 we allow you to supply the source table name and target table name (and logon credentials for each machine) and we will generate the script and run TPT and move the data for you.

2. if you cannot use TPT 14.0 then a simple, general purpose, script can be created, whereby you pass in the table names and logon credentials through parameters (job variables).

The TPT User Guide has examples of how to do this.

-- SteveF
N/A

Re: Teradata TPT Script

Thanks Feinholz.....

By TPT version is 12.0, so easy load is out of frame.

Yup, checked out job variables, its realy of my use, but before i proceed i have a few questions to get clarified :-

  1. Is TPT supported in MacOS? I am forced to ask this question, because in supported platform section there is no MacOS.
  2. What is the significance of Tdpid, username & password in the operator defination section of the script?If we are already logged in to Td before running the script, why to use these creds? 
  3.  I am working in hadoop env, my TPT script is also here. i want this script to execute here, wherein it connects to the TD server and to the extraction job.


Is this possible? If yes, what changes need to be made in the script so that it can connect to the TD server.


Note:-When i tried with the normal TPT script with no changes regarding the connection to the TD server, and run the script using tbuild -f <Script name> in the hadoop env, got the error "No Command found". I suppose this is because this command is purely teradata oriented.


I am in great need of your's help.

Thanks in advance,

Regards,

Samya


Teradata Employee

Re: Teradata TPT Script

TPT is not yet supported on Mac OS X.

That effort is planned (but not committed) for 4Q12.

TdpId/Username/UserPassword is the only mechanism by which TPT can connect to Teradata.

As a user you may be logged in to TD, but running TPT is just running an application on the server and that does not mean the application is connected to TD.

So, your TPT script must contain the TdpId, UserName and Password of the database to which you want to connect and load.

If you got a "No command found", then TPT is not installed on the box from which you invoked the command.

-- SteveF
N/A

Re: Teradata TPT Script

Thanks Feinholz....Your reply was very helpful in the basic understanding of TPT script.

Now i have moved forward a bit, my current situation is i want to login to a given machine(which is in my network) from my local machine, then want to execute the TPT script(already present in the remote machine) from there itself. As i am using java code to connect, i have made a shell script in my local, which i call from my java code(in local), which in turn do the necessary process of connecting to the remote machine and executing the script.

The contents of my .sh is  ssh XYZ@abc.com "cd TPT;/opt/teradata/client/13.10/tbuild/bin/tbuild -f Sample_TPT_Script"

BT its giving the following error message when i am running the script:-

Error retrieving TWB root directory: Error 0 (0)

More to say, when i am doing it from the local terminal, no such error is comming.

I am in a deadlock, dont know of how to move forw......

Pz help with ur inputs ASAP.

Thanks in advance.....

Regards,

Sam

N/A

Re: Teradata TPT Script

I forgot to state that:-

/opt/teradata/client/13.10/tbuild/bin/ - is the path of the tbuild command in the remote machine, as without this path its saying "tbuild : not found"

Teradata Employee

Re: Teradata TPT Script

Are you sure the entire environment is set up correctly?

Did you make sure that TWB_ROOT is set up and is available in the environment from the Java app that is connecting to the remote machine?

-- SteveF