How to hide Logon Password in Teradata MLoad Script

2.1k Views Asked by At

I have written a Multiload script to Load Data in TeraData Database and the commands in the script is like:

.LOGTABLE Employee_log;  
.LOGON 192.168.1.1/dbc,dbc; 
.BEGIN MLOAD TABLES Employee_Stg;  
.LAYOUT Employee;  
.FIELD in_EmployeeNo * VARCHAR(10);  
.FIELD in_FirstName * VARCHAR(30); ....

But the password is clearly visible in the script. Is there a option to secure the password or any alternate way/command to logon and then run the script.

2

There are 2 best solutions below

3
On

You can create a logon file and run it in your MLOAD script using the following command
.RUN FILE logonfile.txt

In the logon file you can provide the statement that you used in your script .LOGON 192.168.1.1/dbc,dbc;

2
On

Restrict access to logonfile.txt, though only the user can read it

chmod go-rwx logonfile.txt

or use tdwallet

.LOGON 192.168.1.1/dbc,$tdwallet(dbc)

tdwallet keeps the entries safely away, only access via logon command. There is no function to get an entry in cleartext.