Hi. I am executing `tbuild` with a job script that makes use of templates to delete from a staging table and load data into that table from a delimited text file. When I execute this command logged in as my user it succeeds. However, when I execute it logged in as someone else, it fails with:
The error message is clear enough: logged on as the other user, tbuild does not have permission to view a schema file. But why? Isn't tbuild creating the file and reading it in the same session?
Here is the command I am using:
tbuild -f /home/myusername/Delete_Table_Then_Load_File.txt -u TargetTdpId = 'foo', TargetUserName = 'bar', TargetUserPassword = 'baz', TargetTable = 'MY_STG_SCHEMA.MY_STG_TABLE', FileName = '/home/myusername/my_data_file.dat', DCPFileList = 'N', Format = 'Delimited', LogTable = 'MY_STG_SCHEMA.MY_STG_TABLE_L', DeleterLogTable = 'MY_STG_SCHEMA.MY_STG_TABLE_L', SourceFormat = 'Delimited', DCPSkipRows = 1, DCPSkipRowsEveryFile = 'Y', DCPOpenMode = 'Read', DCPTextDelimiter = '|', DCPQuotedData = 'Optional', DCPOpenQuoteMark = '"', DCPCloseQuoteMark = '"', LoadInstances = 1, DCPInstances = 1 TPT_20151130_153443
Here is /home/myusername/Delete_Table_Then_Load_File.txt:
What are the write permissions on that directory?
The failure might be on the creation of the file, not the open to read it.
Thanks, Steve. After posting this, I realized I can get the same effect without logging in as a different user, simply by running the command from different directories. When I run the command from my home directory, all is well. But when I run it from the root directory, I get the error.
So am I to conclude that `tbuild` is attempting to write a temporary file in the current working directory? Is there any way to tell it to write (and read) the file to a different directory? The reason I ask is because ultimately a job scheduler will be executing this and, evidently, it always does so from a directory to which it does not have read (or write) permissions (probably the root directory).
Yes, TPT currently attempts to create the temp files in the current working directory.
We are currently working on a fix that will create the temp files in the same directory as the log files (since everyone running TPT must have write access to that directory). There is currently no timetable for when this fix will be available.