Command Line Tool
This chapter describes how to use TASCMD, a command line tool, to query and manage files stored in a disk space.
Overview
TASCMD commands can be used to query disk spaces and query and manage files stored in a disk space. It can also be used to save a file from a local directory to a disk space and vice versa.
When a TASCMD command is executed, TASCMD accesses the TAS instance and requests necessary data or jobs.
TASCMD Execution
When executing TASCMD, specify connection information for the target TAS instance as follows:
[Example 1] TASCMD Execution Parameters
TASCMD connects to the local TAS instance through an entered port number. The port number must be entered, and the TAS instance must booted before executing TAS and its command.
TASCMD Commands
The following describes each TASCMD command.
cd
Changes the current path.
du
Displays the total disk space occupied by the files and directories in the
specified path, or the total capacity of the disk spaces.
exit
Terminates TBASCMD.
help
Displays help about TBASCMD commands.
ls
Displays the list of files and directories in the specified path, or disk spaces.
lsds
Displays the detailed list of disk spaces.
pwd
Displays the current path.
rm
Removes TAS files.
cp
Creates a new TAS file by copying a TAS file.
cpfromlocal
Creates a new TAS file by copying a local file.
cptolocal
Creates a local file by copying a TAS file.
mkdir
Creates a directory.
mv
Moves a TAS file.
check
Checks compatibility of TAS files.
A file name or path option can be specified as absolute or relative path.
Absolute path
Starts with the '+' symbol followed by the disk space name and path in the disk space.
[Example 2] Absolute Path
Relative path
Path relative to the current path. It is combined with the current path for use in a command.
[Example 3] Relative Path
The following symbols can be used in a relative path.
"."
Current path.
".."
Parent path. If the last '/' in a path or the current path is a disk space, this indicates the top-level path ('+').
Additional path can be appended after a "." or "..".
[Example 4] Relative Path Symbol Example
cd
Changes the current path.
Usage
path
Path to which the current path is changed, if it exists.
du
Displays the total disk space occupied by the files and directories in the specified path, or the total capacity of the disk spaces. If the top-level path (+) is specified, the total and free sizes of disk spaces are displayed.
Usage
-a
Displays the disk space occupied by all files of the subdirectories in the specified
path.
path
Path (optional). If not specified, the current path is used.
Example
The following example displays the size of files and their size adjusted for mirroring.
The following example displays the total and free sizes of disk spaces.
exit
Terminates TASCMD.
Usage
help
Displays help about TASCMD commands. If a command is not specified, help is displayed for all commands.
Usage
ls
Displays the list of files and directories in the specified path, or disk spaces. If the top-level path (+) is specified, a disk space list is displayed.
Usage
-a
Displays the list of all files of the subdirectories in the specified path.
-s, --size
Displays the file size as well as the specified path.
-l, --long
Displays the file information as well as the specified path.
path
Path (optional). If not specified, the current path is used.
Example
The following example displays a list of files.
The following example displays a list of disk spaces.
lsds
Displays the detailed list of disk spaces. The information includes the disk space number, name, and status, redundancy level, sector size, meta block size, size allocated on disk, total size, and free size.
Usage
Example
pwd
Displays the current path.
Usage
Example
rm
Removes TAS files.
Usage
-f, --force
Ignores non-existent files and does not display an error message.
-r, --recursive
Removes a directory.
-v, --verbose
Displays the processing results.
files
Path and name of file(s) to remove. One or more files can be specified.
Example
When the rm command is executed while the database is running, errors occur to all files except for the .arc file.
cp, cpfromlocal, cptolocal
cp creates a new TAS file by copying an existing TAS file, pfromlocal creates a new TAS file by copying a local file, and cptolocal creates a local file by copying an existing TAS file. Each command also displays the copied file size, time taken to copy the file, and speed.
If the specified new file name already exists, an error message is displayed without copying the file.
Usage
infile, outfile
Can be specified as absolute or relative paths. outfile is created by copying the
file specified by infile. The copied capacity, required time, and speed are output.
-redun redun_no
Specifies a mirror of a target file. Copies a mirror that corresponds to the redundancy number (redun_no). redun_no can has a number between 0 and 2,
depending on the redundancy level of the target file.
-t file_type
-r, --recursive
Copies the directory.
-v, --verbose
Displays the processing results.
-b, --blksize
Defines the block size of the file.
--bs BYTES
Sets input and output block sizes to BYTES, determining the number of bytes
read and written at a time. This option overrides ibs and obs settings.
--ibs BYTES
Sets infile input and output block sizes to BYTES, determining the number of bytes
read from the infile at a time.
--obs BYTES
Sets outfile input and output block sizes to BYTES, determining the number of
bytes written to the outfile at a time.
--count N
Copies N number of blocks.
--skip N
Starts reading from the Nth block of the infile.
--seek N
Starts writing from the Nth block of the outfile.
Example
mkdir
Creates a directory.
Usage
-f, --force
Ignores the existing directory and does not display an error message.
dirname
Name of a directory to create.
Example
mv
Moves a file.
Usage
-v
Displays the processing results.
src_file, dest_file
Can be designated as either an absolute or relative path. Files designated as
src_file are changed to dest_file.
Example
check
Checks compatibility of the TAS file information the user knows.
Usage
--ds_no
Disk space number the user knows.
--file_no
File number the user knows.
--blksize
Block size the user knows.
--size
File size the user knows.
filename
Name of the file to be checked. An absolute or relative path can be entered.
Example
TBASCMD Error Codes
The following describes causes and solutions for errors that may occur when using TAS.
ERROR CODE -1: invalid tas port number
Cause
A negative number, 0, or a non-numeric string was entered as a port number.
Action
Check the port number.
ERROR CODE -2: more arguments needed
Cause
No argument was entered when executing tbascmd.
Action
Enter a required argument.
ERROR CODE -3: invalid argument
Cause
An invalid argument was entered when executing tbascmd.
Action
Enter a valid argument.
ERROR CODE -4: connection failed
Cause
Failed to connect to a TAS instance through a port number.
Action
Check the port number or whether the TAS instance is running.
ERROR CODE -5: invalid command "INPUT CMD"
Cause
An invalid ascmd command was entered.
Action
Enter a valid ascmd command.
ERROR CODE -6: length of command cannot exceed "ASCMD_CMD_LEN_MAX"
Cause
The length of an entered ascmd command exceeds the maximum length.
Action
Enter an ascmd command with the length less than or equal to 2048 characters.
ERROR CODE -7: invalid option "INPUT OPTION" for command "INPUT CMD"
Cause
An entered ascmd command and option do not match.
Action
Check the ascmd command and option.
ERROR CODE -8: invalid option "INPUT OPTION"
Cause
An option that is not defined in ascmd was used.
Action
Enter an option that is defined in ascmd.
ERROR CODE -9: blksize cannot exceed "ASCMD_BLOCK_SIZE_MAX"
Cause
The block size entered as an option for the cpfromlocal command exceeds the
maximum size.
Action
Enter ASCMD_BLOCK_SIZE with the size less than or equal to 32 KB.
ERROR CODE -10: invalid file type "INPUT FILE TYPE" valid types [data, redo, ctrl, temp, arch]
Cause
The file type specified as an option for the cpfromlocal command is not one of
types defined in ascmd.
Action
Check if the file type specified as an option is defined in ascmd.
ERROR CODE -12: too many arguments for command "INPUT CMD"
Cause
The number of arguments for the ascmd command is greater than the required
number.
Action
Check the usage of the ascmd command.
ERROR CODE -13: need more arguments for command "INPUT CMD"
Cause
The number of arguments for the ascmd command is less than the required
number.
Action
Check the usage of the ascmd command.
ERROR CODE -14: invalid argument "INPUT ARG" for command "INPUT CMD"
Cause
One or more arguments were entered for a command that does not need an
argument.
Action
Check the usage of the ascmd command.
ERROR CODE -15: cannot parse NULL path
Cause
A file path is null.
Action
Enter a non-null file path.
ERROR CODE -16: length of path must be less than "ASCMD_PATH_LEN_MAX"
Cause
The length of a file path exceeds the maximum length.
Action
Enter a file path with the length less than or equal to 256 characters.
ERROR CODE -18: path "INPUT PATH" has invalid form
Cause
A file path format is invalid.
Action
Enter a valid file path.
ERROR CODE -19: no such path
Cause
An entered file or path does not exist.
Action
Enter a file or path that exists.
ERROR CODE -20: length of diskspace name must be less than "ASCMD_DS_NAME_LEN_MAX"
Cause
The length of a diskspace name exceeds the maximum length.
Action
Enter a diskspace name with the length less than or equal to 48 characters.
ERROR CODE -22: no such diskspace "INPUT DS NAME"
Cause
Failed to find a diskspace in an entered path.
Action
Create a diskspace in the entered path, or enter a path where the diskspace is
located.
ERROR CODE -23: no diskspace found
Cause
There is no diskspace.
Action
Create a diskspace.
ERROR CODE -24: length of file name must be less than "ASCMD_FILE_NAME_LEN_MAX"
Cause
The length of a file name exceeds the maximum length.
Action
Enter a file name with the length less than or equal to 48 characters.
ERROR CODE -25: invalid filename ‘FILENAME’
Cause
A file name is invalid.
Action
Enter a valid file name.
ERROR CODE -26: file 'FILENAME' already exists
Cause
A file name entered for the cp command already exists.
Action
Enter another file name.
ERROR CODE -27: length of directory path must be less than "ASCMD_PATH_LEN_MAX"
Cause
The length of a path exceeds the maximum length.
Action
Enter a path with the length less than or equal to 255 characters.
ERROR CODE -29: cannot use directory with cp command
Cause
One or more file names entered for the cp command are a directory path.
Action
Enter a file path or name.
ERROR CODE -30: cannot alloc memory
Cause
Failed to allocate memory to a buffer for file copy.
Action
Request analysis from Tmax research center.
ERROR CODE -31: asfd_pread failed
Cause
Failed to read a file while running the cp command.
Action
Check if the file paths and names are correct, and check permissions for the files.
ERROR CODE -32: asfd_pwrite failed
Cause
Failed to write a file while running the cp command.
Action
Check if the file paths and names are correct, and check permissions for the files.
ERROR CODE -33: file resize failed
Cause
Failed to resize a file for alignment.
Action
Request analysis from Tmax research center.
ERROR CODE -35: file name is not entered ascmd is not allowed to remove diskspace
Cause
A path used as an argument for the rm command has only a diskspace name
without a file name.
Action
Enter a valid file name. To remove a diskspace, use DROP DISKSPACE in tbsql.
ERROR CODE -36: ascmd command should be given after -c, --cmd option
Cause
A command was not entered after ascmd -c or --cmd.
Action
Check the usage of the ascmd command.
ERROR CODE -37: cannot open file
Cause
Failed to open a file while running the cp command. The causes are various.
Action
Request analysis from Tmax research center.
ERROR CODE -38: tas failed to get ds list
Cause
Failed to read a diskspace list.
Action
Request analysis from Tmax research center.
ERROR CODE -39: tas failed to get file info
Cause
Failed to get file information such as a file size and redun number.
Action
Request analysis from Tmax research center.
ERROR CODE -40: valid input should be given to option 'OPTION'
Cause
An invalid value was entered after cpfromlocal -b, --blksize, -t, --type, or another option.
Action
Check the usage of the cpfromlocal command.
Last updated