TPT - Scripting

Tools

TPT - Scripting

Hi Team,

 

I am new to TPT utility of Teradata. I wrote an automatic script generator which takes source table name , target table name and connection details which automatically generates the TPT script and runs it with tbuild -f .

 

The script was working fine but recently I stucked with an issue. In my target database I don't have access to create tables so when I run the script it always fails as TPT forms internal intermediate  MLOAD tables (et , uv) in the target database. 

 

Is there any way that I can specify the database for these intermediate tables externally . I give the log table's database internally but not finding a way to externally give MLOAD intermediate tables .

 

Seriously in need of your help.

 

Please suggest.

 

Thanks-

13 REPLIES

Re: TPT - Scripting

Yes! you can specify ET and UV tables with different database name. You should check manuals for that.

Re: TPT - Scripting

Hi ,

 

Thanks for your quick response.

 

In the Load operator What is the syntax to specify ET and UV tables like specified for errortable 1 2 and log table below

 

   DEFINE OPERATOR LOAD_OPERATOR()
   DESCRIPTION 'TERADATA PARALLEL TRANSPORTER LOAD OPERATOR'
   TYPE LOAD
   SCHEMA EMPLOYEE_SCHEMA
   ATTRIBUTES
   (
      VARCHAR PrivateLogName    = 'GT11_loadoper_privatelog',
      INTEGER MaxSessions       =  32,
      INTEGER MinSessions       =  1,
      VARCHAR TargetTable       = 'TARGET_EMP_TABLE',
      VARCHAR TdpId             = @MyTdpId,
      VARCHAR UserName          = @myusername,
      VARCHAR UserPassword      = @MyPassword,
      VARCHAR AccountId,
      VARCHAR ErrorTable1       = 'GT11_LOADOPER_ERRTABLE1',
      VARCHAR ErrorTable2       = 'GT11_LOADOPER_ERRTABLE2',
      VARCHAR LogTable          = 'GT11_LOADOPER_LOGTABLE'
   );
 
Thanks much in advance.
Teradata Employee

Re: TPT - Scripting

Set the WorkingDatabase attribute to the database in which you want the tables to be created.

The contect of the job will switch to that database.

 

-- SteveF

Re: TPT - Scripting

**bleep**

 

I have issue when running 2 or more TPT jobs simultaneously. There is no issue when job is running one at a time.

 

ex. I have job 1 to extract sales data from Teradata and generate file. 2nd TPT script extracts customer master data from teradata and generate file. If I am running both jobs parallely then 2nd TPT script writes the data into 1st file and 2nd file is not generating. It means, job1 is creating with Job2 data and there is no file for Job 2.

 

Note:- I am using export operator

 

It is very unique issue when 2 TPT scripts (export operator) runs in paralle but there is no issue when it runs at different time.

 

Request you to share some pointer.

 

I am using below command:-

tbuild -f <ctl file> -v <parameter file> -s 1

 

Thanks,

Re: TPT - Scripting

Hello,

 

I have issue when running 2 or more TPT jobs simultaneously. There is no issue when job is running one at a time.

 

ex. I have job 1 to extract sales data from Teradata and generate file. 2nd TPT script extracts customer master data from teradata and generate file. If I am running both jobs parallely then 2nd TPT script writes the data into 1st file and 2nd file is not generating. It means, job1 is creating with Job2 data and there is no file for Job 2.

 

Note:- I am using export operator

 

It is very unique issue when 2 TPT scripts (export operator) runs in paralle but there is no issue when it runs at different time.

 

Request you to share some pointer.

 

I am using below command:-

tbuild -f <ctl file> -v <parameter file> -s 1

 

Thanks,

Teradata Employee

Re: TPT - Scripting

Use the -j command line option to assign a unique job name for each job.

Otherwise TPT uses the logon id of the user for the "job id" of the job and TPT does not allow more than 1 job at a time with the same job id.

-- SteveF

Re: TPT - Scripting

Thanks for the response. This is a framework and will be shared across multiple applications. In that way, there is an impact as only 1 job will be active and remaining jobs will be in queue.

 

I have tried with -C option still the same result.

 

Do we have any other option to run more than 1 jobs at a time without impacticing each other.

 

Thanks,

-Dibya

Teradata Employee

Re: TPT - Scripting

As explained:

TPT uses the logon id of the user for the "job id" of the job and TPT does not allow more than 1 job at a time with the same job id.

Use the -j command line option to assign a unique job name for each job.

 

I am not sure what you were expecting when using the -C command line option.

 

-- SteveF

Re: TPT - Scripting

When 1 instance of 1 job is active then there is no issue. I have issue when Job1 and Job2 both run at a same time. i.e. both are separate jobs.

 

when both Job1 and Job 2 starts at the same time then file for job 1 gets created with incorrect format and file for job 2 never gets created. If we open file for job 1 then it will have data of Job2.

 

This is where we have issue. We are using export operator in TPT.

 

You mean, below approach will solve the issue.

ex.

 

tbuild -f <file> -v <param file> -j job1

tbuild -f <file> -v <param file> -j job2

 

Thanks,

-Dibya