|Advanced Topics: Automating Tenup ||
When using Tenup, and especially when writing shell scripts that contain Tenup commands, it is important to effectively manage your session status. In some cases you will want to start a new session, while in others you will want to reuse a session. Tenup provides options for all these situations.
This section focuses on two options that will help you manage your Tenup sessions. But first, let's clarify what a session is exactly. When you login to 1010data you are assigned a unique session ID. This ID has many purposes, one of which is to make sure that a single username can't login to 1010data more than once at the same time. If you try to login to 1010data while you already have a session ID associated with your username, you have two options: terminate the existing session and start a new one, or possess the existing session.
Tenup allows you to resume a session by "posessing" it. To possess a session you will include the -K option in your Tenup command, as follows:
$ tenup64 -K -u [USERNAME] -C [CONNECTION_STRING] [PATH_TO_NEW_TABLE] @[QUERYFILE]
The command above will find the open session associated with your user ID and use it to load a new table with Tenup. An example of a shell script that uses this technique is provided later in this section.
$ tenup64 -k -u [USERNAME] [PASSWORD] -C [CONNECTION_STRING] [PATH_TO_NEW_TABLE] @[QUERYFILE]
$ tenup64 -k -L -u [USERNAME] -C [CONNECTION_STRING] [PATH_TO_NEW_TABLE] @[QUERYFILE]In this example we terminate any existing session that might be open, start a new session, load a table and stay logged in to 1010data after finishing.
$ tenup64 -K -l -u [USERNAME] -C [CONNECTION_STRING] [PATH_TO_NEW_TABLE] @[QUERYFILE]