Add a new snippet
Error And Resolution
TENACITY and SLEEP in Teradata
TENACITY and SLEEP
Tenacity and Sleep commands can be used together to control the timings for log on operations.
Below is an example of Tenacity usage. Suppose the commands in the script are:
Tenacity 1; Sleep 15;
The Tenacity duration is 60 minutes and the Sleep interval is 15 minutes.
When Teradata FastLoad tries to log on for a new session, and the Teradata Database indicates that the maximum number of load sessions is already running, the Teradata FastLoad utility:
What will happen?
Logs off any new sessions that were logged on
Waits (i.e. sleeps) for 15 minutes
Tries again to log on to the Teradata Database
Teradata FastLoad repeats this process until it has either logged on for the required number of sessions or the total of time it waits (or sleeps) equates the amount of time specified by the Tenacity command (which is 60 minutes as in the example). In the latter case, FastLoad terminates with an error message.
In this example, the maximum total of time intervals FastLoad can wait equates to the Tenacity duration specified.
What happens when the value of Sleep is greater than Tenacity? If in the above example, the Sleep command is “Sleep 17;” The first 3 sleeps take 51 minutes, the last (or the fourth) sleep takes 17 minutes then the total of sleep time is 68 minutes that is greater than the Tenacity duration which is 60 minutes. It is more than what of the user expects and are willing to wait. Therefore, to ensure that the total of sleep time matches with the Tenacity duration, FastLoad automatically adjusts the last sleep time interval to 9 minutes and displays the below message to inform user about this adjustment.
Sleep interval is dynamically adjusted and reset to 9 minutes
Another example of Sleep time adjustment is when the specification of the Sleep time interval is greater than that of the Tenacity duration:
In that case, the Sleep time is 65 minutes and the Tenacity is 60 minutes. When Teradata FastLoad tries to log on for a new session, and the Teradata Database indicates that the maximum number of load sessions is already running. FastLoad automatically adjusts the Sleep time interval to 60 minutes before going to sleep and displays the message:
Sleep interval is adjusted to 60 minutes as it exceeds tenacity
Note: This article discusses about Teradata FastLoad automatically adjusts Sleep time interval to match with the Tenacity duration. But other SA utilities (FastExport, MultiLoad and TPump) also have the Tenacity feature and do the same automatic adjustment logic.
Tags for TENACITY and SLEEP in Teradata
multi load sample script with tenacity
difference between tenacity and sleep
wait command in teradata
what is tenacity informatica
sleep in bteq
Contribute to Forget Code, help others.